SelectOneChoice set default selected item

Hi
I have an edit form, that is loaded from a query. In this form there are some values that are setted using a selectOneChoice
The thing is that i need to set the selectOneChoice initial selected item acording to the values of the entity retrieved by the query
How can i do this ???
Thanks

Hi,
Thanks for your reply.
But I have already called a action on Add button.
Still I tried the way you suggested,
RichSelectOneChoice selectOneChoiceBinding = new  RichSelectOneChoice();
      selectOneChoiceBinding.setValue(Integer.toString(1));
      AdfFacesContext.getCurrentInstance().addPartialTarget(selectOneChoiceBinding.getParent());but this doesn't work.
I have binded(private RichSelectOneChoice customerIDNo;) that SelectOneChoice in bean.
So, I tried it like this also,
        customerIDNo.setValue(Integer.toString(1));
        AdfFacesContext.getCurrentInstance().addPartialTarget(customerIDNo.getParent());still it doesn't work.
please help.
Thanks,
Madhav.

Similar Messages

  • How i can set the selected item of a dropDown component from java code

    Hi
    Thank you for reading my post
    How i can set the slected item of a DropDown component from backing beans java code ?
    it is binded with a database , so one field determine its display and one other field determine its value , I want to set the selected item of this combobox
    In back code i have both value and display values to use them .
    can some one give me some help ?
    Thanks ,

    See code sample 3 at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    See also, the selection components row in the table under http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    It says
    One way to preselect items is to call setSelectedValue(Object[]) or setSelectedValue(Object) from the prerender() method. You pass in the return values of the items that you want preselected. Be sure to verify that getSelected() returns null before setting the default options, or you will overwrite the user's selections on a post-back.

  • How to set default selection in html:radio

    hai
    how to set default selection in <html:radio>.

    No it won't help.
    You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
    The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
    Bottom line: you can't put a default value into the input type="file" control.
    And a good thing too ;-)

  • How to set default selected checkbox in af:tableSelectMany /

    Hi,
    I am new to ADF technology, I am using JDev 10..3g.
    I want to set the checkbox as default selected for particular rows.
    but I don't know how to set default selected checkbox in <af:tableSelectMany />
    Is there any way to do this using ADF<af:tableSelectMany />
    Thanks,
    Mohammed

    Hi Jeroen,
    Thanks for reply. but the problem is that I am getting data from database and based on some flag I need to select checkbox while page is loading first time.
    at that time the table is null as till now it not rendered. and when its rendered it means page is displayed now.
    just before display I need to set checkbox as selected.
    I don't want to do like this (when user is pressing any command button then only is should update checkbox selection).
    Thanks,
    Mohammed.

  • Drop Down List - Setting the Default Selected Item

    I have a drop down list in my application that gets populated by a remote database.  When you select an item from the list, a screen full of thumbnails is populated based on the selection.  We have decided that when the user gets to this component in our air application, that it looks too empty and barren.  All that displays is a drop down list with an empty screen.  So we would like to set a default setting for the drop down list so that when the user gets to this component, a screen full of thumbnails is awaiting them and they can change it if they want.  My first instinct was just to set the selectedIndex property of the drop down list to the value that we want as the default, and that works, but it only changes the label in the dropdownlist, it doesn't actually populate the screen with the thumbnails.  That is because when an item is selected, it has to be commited to the drop down list by a CLOSE event that then sets off the close handler that populates the screen with thumbnails.  So after looking at the documentation, I found that there is a method called closeDropDown that states the following:
    closeDropDown
    method
    public function closeDropDown(commit:Boolean):void
    Close the drop-down list and dispatch a DropDownEvent.CLOSE event.
    Parameters
    commit:Boolean — If true, commit the selected data item.
    When I use this method, nothing happens.  In fact if I add a listener for the CLOSE event, the close event isn't getting fired.  So I am a little befuddled.  The only thing that I can figure is that I am setting the selectedIndex and not the selectedItem before I call the closeDropDown method, and if you look above, the documentation vaguely states that that "If true, commit the selected data item".  Do I need to set the selectedItem and not the selectedIndex?  If so, I am not exactly sure how to do this since I am using a service to populate my drop down list which kind of makes the dataprovider a little unclear to me in the code because it gets replaced by an AsyncListView.  Here is what I have.
    <fx:Script>
         <![CDATA[
            protected function dropDownList_creationCompleteHandler(event:FlexEvent):void{
              getAllAudio_descriptionsResult.token = audiodescriptionsService.getAllAudio_descriptions();
              getAllAudioResult.token = audioService.getAllAudio();
         private function audioDescriptionsCallResponderHandler(event:ResultEvent):void {
              audioDesc = event.result as ArrayCollection;
         private function audioCallResponderHandler(event:ResultEvent):void {
              audio = event.result as ArrayCollection;
              audioDescDropDown.selectedIndex = 2;
              audioDescDropDown.closeDropDown(true);
         ]]>
    </fx:Script>
    <fx:Declarations>
         <s:CallResponder id="getAllAudio_descriptionsResult" result="audioDescriptionsCallResponderHandler(event)"/>
         <audiodescriptionsservice:AudiodescriptionsService id="audiodescriptionsService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
         <s:CallResponder id="getAllAudioResult" result="audioCallResponderHandler(event)"/>
         <audioservice:AudioService id="audioService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
    </fx:Declarations>
    <s:DropDownList id="audioDescDropDown" x="43" y="65" width="185" height="34" fontFamily="MyriadProSemiBold"
                        fontSize="15" skinClass="skins.VideoSkins.Video.DropDownSkin"
                        color="0xE6E6E6" selectionColor="0x054F7C" rollOverColor="0x007CBA"
                        creationComplete="dropDownList_creationCompleteHandler(event)" labelField="audioCatName"
                        itemRenderer="renderers.DropDownList3" close="DDLAudioCloseHandler(event)">
         <s:AsyncListView list="{getAllAudio_descriptionsResult.lastResult}"/>
    </s:DropDownList>
    I would really appreciated hearing from anyone who has experience or insight into setting a default for a drop down list and actually forcing it to execute that default selection.  Any thoughts at all would be helpful.  Thanks!

    I don't see your close handler in the code you posted, so if you provided it and I missed seeing it, please forgive me.  I'm a bit unclear on why the open and close of your dropdown list is so critical to your functionality.  It seems to me that the page of data would be tied to the item selected in the drop down (which to my mind is the only purpose for the drop down to be there).  So why do you first need to open and close the drop down, rather than just taking the selected value and doing whatever you'd normally do with it to populate that page?
    What I'm getting at is that I'd expect that page to be a separate component that would just have a property for the selected "thing", and that you could populate it either manually, as I suggested, or through the close handler on your drop down--I wouldn't think that there should be a need to go through the close handler every time.  Even if you don't have it implemented the way I'm thinking, you may want to think about whether you need to go through the close handler every time, or whether you could break it out so that the close handler simply determines which item to select, then jumps to another function that actually does something with the selected value.  That way, you don't have to go through the overhead of opening and closing the drop down if you need to change its value programmatically.
    HTH;
    Amy

  • How do you set the selected item of a combobox?

    I looked around and didn't find an intrinsic method or
    function to set the selected index of a combobox. I wrote a
    function, but I thought I would see what the "best" way of doing it
    is?
    The function I wrote is;
    private function
    setComboSelectedItem(cmbBoxIn:ComboBox,strFindItem:String):void
    for (var i:int=0;i<cmbBoxIn.dataProvider.length;i++)
    if (cmbBoxIn.dataProvider(I) == strFindItem)
    cmbBoxIn.selectedIndex = i;
    break;
    The parentheses surrounding "i" above should be square
    brackets, but they do not display.
    Paul

    doing a calllater will solve this problem if your changing
    dataprovider and trying to set the selected index on an editable
    combox

  • How Can I Programatically (AS3) Set PopUpMenuButton Selected Item?

    Hi All,
    I have been googling this issue all afternoon and can't seem to figure it out. I would like to programatically pre-select an item from a PopUpMenuButton (PUMB) prior to it being displayed. I've seen various references to the following, but it doesn't work:
    Menu(myPUMB.popUp).selectedIndex = x;
    While this doesn't throw an error, it also doesn't change the text displayed on the PUMB when it is not expanded.
    Thoughts?
    Thanks!
    -Mike

    Hi Ryan,
    Unfortunately that won't work, as the dataProvider doesn't get set until the Application triggered the creationComplete event. And since that runs after the creationComplete event of the control, it should take care of any issues.
    I have solved my situation now by implementing a ComboBox control:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
         xmlns:mx="http://www.adobe.com/2006/mxml"
         creationComplete="applicationInit();"
    >
         <mx:Script>
              <![CDATA[
                 import mx.controls.Menu;
                 private var _data     :Array     = new Array("test", "this", "button");
                 private function applicationInit():void
                      this.myPUMB.dataProvider = this._data;
                      this.myPUMB.selectedIndex = 1;
              ]]>
         </mx:Script>
         <mx:ComboBox
              id="myPUMB"
         />
    </mx:Application>

  • Error setting the selected item in a dropdown component in a BPM

    Hi,
    The first step in the process is a human step where it's possible to select country in a dropdown box. The second step is also a human step where I try to display the same context that was selected in the first step.
    I use the "merge" operation in the mapping, but the item that I select in the first step in the process is not selected in the second step in the process.
    Does anyone know how to solve this?
    Best Regards
    Michael

    Hi Michael,
    Only simlple types are supported in WD for EHP1 (Binary, boolean, byte, date, decimal, double, float, integer, long, short, string, time, timestamp)
    No further Dictionary Types supported
    (for example: currency)
    Best Regards,
    Karthik
    Edited by: Karthik S J on Oct 15, 2008 2:34 PM

  • How to set default selection in tableSelectOne

    Hi Friends,
    How to set tableSelectOne through backing bean.
    I am opening a child window which will populate the list in table format. I am loading it through manually. Now i want to set the first record to be selected. Kindly let me know how to do it.
    The below is my code in jspx
    <af:table emptyText="#{mofRes['mofEgov.po.noItemsFound']}" rows="5" banding="row"
    bandingInterval="1" binding="#{BeneficiaryTableHandler.beneficiaryTable}"
    value="#{BeneficiaryTableHandler.beneficiaryTableModel}" var="rowBeneficiary"
    id="table2" width="900">
    <f:facet name="selection">
    <af:tableSelectOne binding="#{BeneficiaryTableHandler.beneficiarySelectOne}"
    id="tableSelectOne"/>
    </f:facet>
    <af:column sortable="false" sortProperty="bankName"
    headerText="#{mofRes['mofEgov.supplier.bankName']}"
    binding="#{BeneficiaryTableHandler.beneficiaryColumn3}"
    id="beneficiaryColumn3" formatType="icon">
    <af:outputText value="#{rowBeneficiary.bankName}"
    id="beneficiaryOutputText3"
    binding="#{backing_apps_po_POBeneficiaryOutput.beneficiaryOutputText3}"/>
    </af:column>
    <af:column sortable="false" sortProperty="bankActName"
    headerText="#{mofRes['mofEgov.supplier.bankActName']}"
    binding="#{BeneficiaryTableHandler.beneficiaryColumn1}"
    id="beneficiaryColumn1" formatType="icon"
    gridVisible="true">
    <af:outputText value="#{rowBeneficiary.bankActName}"
    id="beneficiaryOutputText1"
    binding="#{backing_apps_po_POBeneficiaryOutput.beneficiaryOutputText1}"/>
    </af:column>
    </af:table>
    Below code used in backing bean to create rows in the table
    for (int rwIndx = 0; rwIndx < siteLiseSize ; ++rwIndx) {
    beneficiaryBean = (BeneficiaryBean)beneficiaryList.get(rwIndx);
    handler.createRow(beneficiaryBean);
    logger.log(Level.INFO," --- Bank Name --- :"+beneficiaryBean.getBankActName()+": --- Bank Act No -- :"+beneficiaryBean.getBankActNo());
    public void createRow(BeneficiaryBean bean) {
    //logger.log(Level.FINE," ---- createRow Start --- ");
    ((Collection)beneficiaryTableModel.getWrappedData()).add(bean);
    //logger.log(Level.FINE," ---- createRow End --- ");
    Thanks & Regards
    VB

    This is probably too late to help, but I had a similar situation. There are a couple of ways to solve this.
    1. Set the ID values on the af:form, af:table, and af:tableSelectOne tags, and write some javascript code to select the first radio button, in the event there are no radio buttons selected. Something like this would work.
              function selectFirstRadio() {
                radioButtons = document.myform['mytable:myradios'];
                anypressed = false;
                for (i = 0; i < radioButtons.length; i++) {
                  radioButton = radioButtons;
    if (anypressed.checked) {
    anypressed = true;
    if (!anypressed) {
    document.myform['mytable:myradios'][0].checked = true;
    This would have an af:form with an id='myform', an af:table with an id='mytable', and an af:tableSelectOne with an id='myradios'
    The other method I used was, in the accessor for getting the value for the af:table was this:
        public DataModel getMyModel() {
            RowKeySet selectedItem = myTable.getSelectionState();
            if ((selectedItem == null) || (selectedItem.getSize() == 0)) {
                Object o = myModel.getWrappedData();
                List rows = (List)myModel.getWrappedData();
                try {
                    selectedItem.getKeySet().add( "0" );
                } catch (Throwable t) {
                    t.printStackTrace();
            return myModel;
        }'myTable' is a binding from an af:table to a UIXTable.
    I should add, this is for ADF 10.1.3.x, not ADF 11.
    Best of luck.
    Edited by: daiken on Mar 27, 2009 7:13 AM

  • JRadioButton in JTable can't set default selection

    Guys, I need your help in here.
    Basically, I want to have a JTable that will have a JRadioButton in one of its columns.
    Furthermore, upon loading the table, I want the radiobutton on the first row is selected as default.
    Below are my codes for the renderer, editor, and the part of the main code itself:
    public class RadioButtonEditor extends AbstractCellEditor implements TableCellEditor
        private JRadioButton _button = new JRadioButton();
         * The constructor. Used to create new RadioButtonEditor object
         * @param checkBox - given JCheckBox
        public RadioButtonEditor()
            this._button.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    fireEditingStopped(); 
        @Override
        public Component getTableCellEditorComponent(JTable table, Object value,
                boolean isSelected, int row, int column)
            if(value == null)
                return null;
            this._button.setSelected(isSelected);
            return this._button;
        @Override
        public Object getCellEditorValue()
            return this._button.isSelected();
    public class RadioButtonRenderer extends JRadioButton implements TableCellRenderer
        public Component getTableCellRendererComponent(JTable table, Object value,
                boolean isSelected, boolean hasFocus, int row, int column)
            System.out.println("MASUK: " + isSelected);
            if (value==null)
                System.out.println("1");
                return null;
            System.out.println("2");
            this.setSelected(isSelected);
            return this;
    //Part of the main code
    this._mainTable = null;
            DefaultTableModel dm = new DefaultTableModel();
            dm.setDataVector(this._myManager.getCreditListTableContents(this._dataStartIndex), this._myManager.getCreditListHeaderList());
            ButtonGroup buttonGroup = new ButtonGroup();
            for(int i=0; i<dm.getRowCount(); i++)
                JRadioButton temp = (JRadioButton)dm.getValueAt(i,0);
                buttonGroup.add(temp);
            this._mainTable = new JTable(dm){
                @Override
                public boolean isCellEditable(int row, int column)
                        if(column == 0)
                            return true;
                        else
                            return false;
                @Override
                public TableCellRenderer getCellRenderer(int row, int column)
                    TableCellRenderer renderer = super.getCellRenderer(row,column);
                    switch(column)
                        case 1: case 2: case 4: case 5: case 6: case 7: case 8:
                            ((JLabel)renderer).setHorizontalAlignment(SwingConstants.CENTER);
                            break;
                        case 3: case 9: case 10:
                            ((JLabel)renderer).setHorizontalAlignment(SwingConstants.LEFT);
                            break;
                    return renderer;
            this._mainTable.getColumn(this._myManager.getCreditListHeaderList()[0]).setCellRenderer(new RadioButtonRenderer());
            this._mainTable.getColumn(this._myManager.getCreditListHeaderList()[0]).setCellEditor(new RadioButtonEditor());
            JRadioButton tempBttn = (JRadioButton)this._mainTable.getModel().getValueAt(0,0);
            tempBttn.getModel().setSelected(true);But still I can't make it.
    Really need help guys.
    Thnx a lot
    -Peter

    in this form works as I excepted
    import java.awt.Component;
    import java.awt.Dimension;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JRadioButton;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.UIManager;
    import javax.swing.border.Border;
    import javax.swing.border.EmptyBorder;
    import javax.swing.plaf.UIResource;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellRenderer;
    public class JRadioButtonTableTest {
        public static void main(String args[]) {
            DefaultTableModel model = new DefaultTableModel(new Object[][]{{Boolean.TRUE}, {Boolean.FALSE}, {Boolean.TRUE},
                        {Boolean.FALSE}, {Boolean.TRUE}, {Boolean.FALSE}, {Boolean.TRUE}}, new Object[]{"Boolean"}) {
                private static final long serialVersionUID = 1L;
                @Override
                public Class getColumnClass(int col) {
                    return Boolean.class;
            JTable table = new JTable(model);
            table.setDefaultRenderer(Boolean.class, new BooleanRenderer());
            JFrame f = new JFrame("JRadio Button Renderer Test");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(new JScrollPane(table));
            f.setPreferredSize(new Dimension(100,200));
            f.setLocation(150, 200);
            f.pack();
            f.setVisible(true);
        static class BooleanRenderer extends JRadioButton implements TableCellRenderer, UIResource {
            private static final long serialVersionUID = 1L;
            private final Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
            BooleanRenderer() {
                super();
                setHorizontalAlignment(JLabel.CENTER);
                setBorderPainted(true);
            @Override
            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                if (isSelected) {
                    setForeground(table.getSelectionForeground());
                    super.setBackground(table.getSelectionBackground());
                } else {
                    setForeground(table.getForeground());
                    setBackground(table.getBackground());
                setSelected(value != null && ((Boolean) value).booleanValue());
                if (hasFocus) {
                    setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
                } else {
                    setBorder(noFocusBorder);
                return this;
        private JRadioButtonTableTest() {
    }JTable is sensitive to EDT at all,
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    table.setValueAt(Boolean.FALSE, row, column); // or TRUE
            });Edited by: mKorbel on 23.3.2011 9:22

  • How to make default selection blank for SelectOneChoice component

    Query 1
    I have a JSF page having databound selectOneChoice on an attribute of ViewObject. The attribute LOV configuration has the List, Return Value set with the same value. UI Hints --> Choice List Options is checked for "Include No Selection Item" with "blank Item First to List" from drop down. When JSF loaded, default selected item does not appear to be blank. I expect that No Select Item should be selected by default. Do let us know if anything specific to be done for this?
    Query 2
    I have a JSF page to which taskflow containing a single jsff draged as region. On submit of JSFF form, all the read-only text-fields on jsff are getting blank. I want to retain the values of read-only fields on jsff. Please advice.

    This is in reference to Jdev 11g, using jspx's in adfc-config..
    If your selectonechoice is like this,
                <af:selectOneChoice value="#{bindings.SolutionUnit.inputValue}"
                                    label="Cost Centre">
                  <f:selectItems value="#{bindings.SolutionUnit.items}"/>
                </af:selectOneChoice>The selected value depends on what is retruned by the 'value' property of your component. If my #{bindings.SolutionUnit.inputValue} returns a null value or a value which is not present in <f:selectItems value="#{bindings.SolutionUnit.items}"/>, then I will get a blank row selected...
    haven't worked much with regions, so..

  • How to set selected item of SelectOneMenu

    HI,
    I want to manually set the selected item of SelectOneMenu, can anyone tell me how can I do?
    Below is my code:
    <h:selectOneMenu binding="#{Monitor.dropdown1}" id="dropdown1" onchange="submit();" valueChangeListener="#{Monitor.pageItemsValueChange}">
        <f:selectItems binding="#{Monitor.dropdown1SelectItems}" id="dropdown1SelectItems" value="#{Monitor.pageItems}"/>
    </h:selectOneMenu>I tried to use dropdown1.setValue to set it, but I wonder which class type I can use.

    Initialize the value to the value you want to select:
    <h:selectOneMenu id="model" value="#{SearchVehicle.modelField}">
    <f:selectItems value="#{SearchVehicle.models}"></f:selectItems>
    </h:selectOneMenu>public class SearchVehicle{
    private String modelField = "XYZ";
    }

  • SSRS Cascading Parameter Setting Default Value of Parameter by Expression

    Hi All,
    I need some help on an issue I am running into in SQL server 2008 report parameters. I have the following Report Parameters defined:
    1) @PredefinedDateSelection - Boolean (User Selectable True/False, Default Value - 'False')
    2) @StartDate - Text (User input text box)
    If @PredefinedDateSelection = TRUE, then I would like to provide a particular default value to the StartDate textbox (i.e. @StartDate Default Value), If @PredefinedDateSelection = FALSE, then I would like to provide a different default value.
    I have the following code for the Expression for the Default value of @StartDate: =code.GetStartDate(Parameters!PreDefinedTimeSelection.Value)
    where GetStartDate is a very simple VB function defined as :
    Public Function GetStartDate(x as boolean ) As String
    Dim a as string
    Dim b as string
    a = "Report Uses Predefined Values"
    b = "Please Input Value"
    If (x) then
    Return a
    else
    Return b
    end if
    end function.
    Now the default value of @StartDate stays set as "Please Input Value", and does not change when I toggle @PredefinedDateSelection from False to True and vice versa. I was expecting to see the Default value to change between the two messages depending on my selection in the report preview.
    Another parameter which is a dropdown and uses a dataset to display two different set of selectable items depending on the value of @PredefinedDateSelection is working just fine. I am not sure if I am missing something or I am doing something wrong.
    Instead of using the VB code I also tried : =iif(Parameters!PreDefinedTimeSelection.Value = True,"Report Uses Predefined Values","Please Input Value")
    I also tried changing the default value using a dataset with SQL query and the available value set to NONE, so that the user could input. But the Default value does not refresh or change values.
     I hope I have explained my question clearly. I would really appreciate any thoughts and comments.
    Thanks,
    Arunesh

    Thank you much for your response.
    I tried that and it did work. But my requirement is to have a user input the date. The basic idea is if the user decides on a predefined time range like Day Shift Today or Yesterday and so on... then the report would automatically calculate the values based on predefined date time values. On the other hand, if the intent is to run the report for an arbitrary period then the user supplies the date and time limits.
    What I am trying to achieve is have the same parameter available for user input , but when the User decides he wants Predefined then the "textbox" populates with date and time as per his choice of predefind range.
    I understand that by this the user can still overwrite the date and time on the text box, but the report will run the predefined values as long as he has the @PredefinedDateSelection Set to true.
    Is there a way I can impement this?
    Once again I thank you and appreciate  your input.

  • Default selected product in product list

    I have a list of products in a region from a dataset. I have
    a detailregion that shows the data from the selected item in that
    region.
    In the product list, I have the spry:select set to a CSS
    rule. When the region and detailregion are first displayed, the
    first item is selected and displayed by default. But, it's not
    using the spry:selected CSS rule until I actually make a selection.
    How can I make the default selected item initially show using
    the spry:selected rule?

    Ok, I'm using a spry:repeat to fill in table rows as a list
    of products. So, I used a spry:choose in the table, then in the
    <tr> tag used a spry:when ds_row == 0
    spry:selected="selected". Then a second <tr> with
    spry:default="default, without the selected part.

  • JTree default selection?

    I've tried searching for this here and there but nothing turned up...
    I was wondering if it is possible to set a default selected item on a JTree.
    So that if no nodes are selected - the first item is selected by default.
    Any hints would be greatly appreciated, thanks.

    If for "nested element" you mean "a node", you can use setSelectionPath(TreePath path) and      setSelectionPaths(TreePath[] paths).
    Message was edited by: java_knight

Maybe you are looking for