Select first item in table

I have a spry:region that feeds data to another spry:region
and spry:detailregion. The setup works fine, but the first
dsJobCategories TD doesn't appear selected via CSS. It pipes in the
data to the subsequent spry:region and :detailregion without
showing up as selected. The code is below. Can anyone tell me what
I'm doing wrong?
<div id="Jobs_DIV">
<span spry:region="dsJobCategories">
<h2>2: Choose a Subcategory</h2>
<table width="200">
<tr spry:repeat="dsJobCategories">
<td spry:if="{jobcount} == 0" class="disabled"
spry:setrow="dsJobCategories">{name}</td>
<td spry:if="{jobcount} &gt; 0" spry:select="select"
spry:hover="hover" spry:selectgroup="jobs"
spry:setrow="dsJobCategories">{name}</td>
</tr>
</table>
</span>
</div>
<div id="Job_List_DIV">
<span spry:region="dsJobList">
<h2 spry:if="{ds_RowCount} == 0"> </h2>
<p spry:if="{ds_RowCount} == 0">Please choose a
category at the left. Categories with no jobs are greyed
out.</p>
<span spry:if="{ds_RowCount} != 0">
<h2>Job List:</h2>
<table width="200">
<tr spry:repeat="dsJobList">
<td spry:select="select" spry:hover="hover"
spry:selectgroup="jobs"
spry:setrow="dsJobList">{title}</td>
</tr>
</table>
</span>
</span>
</div>
<div id="Jobs_Detail_DIV" spry:detailregion="dsJobList"
spry:if="{ds_RowCount} &gt; 0">
<h2>Job Detail:</h2>
<p><b>title:</b> {title}<br />
<b>description:</b> {description}<br />
<b>facility:</b> {facility}<br />
<b>referencenumber:</b> {referencenumber}
</div>

Originally posted by: daniel.rohe.stud.tu-ilmenau.de
ven schrieb:
> Hi,
>
> I am using a multipage editor with a master details block. The master
> block has a table viewer. I am trying to select the first item in the
> table programmatically and fire the event associated with the selection.
> TEven though i select the item in the table using setSelection() on the
> table viewer, the details block doesn't show up. It shows up when
> explicitly clicked upon. Does anybody know any solution to this problem.
> I want the details black to be shown as soon as the editor is loaded and
> the user swtiches to this page.
> thanks,
> ven
>
In your master part use managedForm.selectionChanged(this,
viewer.getSelection()) to notify other parts in the managed form that
the selection has changed.
Kind regards,
Daniel

Similar Messages

  • Error after using a servlet in ADF  - unable to select another row in table

    Hello,
    I have a go button and when I select a row in a table it call a download servlet. After I open or save the document I'm unable to make other selection in the table or make another action.
    The table has single row selection active.
    The servlet make part from a task-flow.
    Here is the code for the sevlet and my jdev version is 11.1.1.2.0
    public class DownloadServlet extends HttpServlet {
    @Override
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException,
    IOException {
    String id= null;
    String den= null;
    InitialContext ic;
    try {
    ic = new InitialContext();
    } catch (NamingException e) {
    DataSource ds = null;
    Connection conn = null;
    PreparedStatement cStmt = null;
    ResultSet rset= null;
    byte[] bdata = null;
    String rezult_null = "";
    id_fisier_lcl = request.getParameter("id");
    den_fisier_lcl = request.getParameter("fileName");
    rezult_null = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
    "<Body>Fisierul a fost arhivat</Body>";
    try {
    ic = new InitialContext();
    ds = (DataSource)ic.lookup("jdbc/ConnDS");
    conn = ds.getConnection();
    cStmt = conn.prepareStatement("commit");
    cStmt.execute();
    conn.commit();
    cStmt= conn.prepareStatement("SELECT a.item FROM table a WHERE a.id = " + id);
    rset = cStmt.executeQuery();
    if (rset.next()) {
    weblogic.jdbc.wrapper.Clob clob =
    (weblogic.jdbc.wrapper.Clob)rset.getClob("content");
    oracle.sql.CLOB oclob = (oracle.sql.CLOB)clob.getVendorObj();
    bdata = new byte[(int)oclob.length()];
    InputStream is = oclob.getAsciiStream();
    is.read(bdata);
    rset.close();
    cStmt.close();
    } else {
    bdata = new byte[(int)rezult_null.length()];
    bdata = rezult_null.getBytes();
    rset.close();
    cStmt.close();
    } catch (NamingException e) {
    } catch (SQLException e) {
    String username_lcl = null;
    username_lcl =
    ADFContext.getCurrent().getSecurityContext().getUserName();
    OutputStream outputStream =response.getOutputStream();
    String mimetype = "";
    FacesContext facesContext =FacesContext.getCurrentInstance();
    response.setContentType( (mimetype != null) ? mimetype : "application/x-download" );
    response.setHeader( "Content-Disposition", "attachment; filename=\"" + den_fisier_lcl + ".xml\"" );
    try {
    outputStream.write(bdata);
    outputStream.flush();
    outputStream.close();
    catch (Exception e) {
    e.printStackTrace();
    FacesMessage msg =
    new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(),
    facesContext.addMessage(null, msg);
    How can I fix it?
    Thank you.

    Hi,
    have you seen this ?
    http://download.oracle.com/docs/cd/E21764_01/apirefs.1111/e12419/tagdoc/af_fileDownloadActionListener.html
    If you want to continue with your approach, then a way out of your problem could be to add an af:clientListener onto the command button. The JavaScript function would be
    function onDownload(evt){
      evt.noResponseExpected();
    }Frank

  • How to write select statement between two tables

    hi,
    i need to do comparision between two table for each records.ex:
    table1:
    regid            regno         ind
    1                 1001
    1                 1002
    1                 1003
    1                  1004
    and table2:
    regid           regno
    1               1002
    1                1005
    i need to select first row from table and loop for values in second table, if the values found first record , the record must update 'yes' to ind, if not 'No'.
    please help with this.
    thanks in advance
    raja

    Hi Raja,
      Do it like this.  loop  the first table and read the second table.
    Use where condition to satisfy the conditions.
    Or
    In your select query use joins. Like this.
    SELECT mara~matnr
           marc~werks
    INTO   TABLE t_material
    FROM   mara AS mara INNER JOIN marc AS marc
    ON     maramatnr = marcmatnr
    WHERE  mara~mtart = p_mtart.
    Instead of MARA and MARC here use your tables.
    Much Regards,
    Amuktha.

  • Databound Combobox - First item changes to previous selection when clicked again

    Hi All,
    I have just written my first vb.net app using VS2014 and everything is working perfectly except the same weird issue is happening on 2 comboboxs I have...
    Basically I have a Vehicles combobox and a Departments combobox (both created by dragging the field from Data Sources after setting it to combobox onto the form creating a databinding). When the user has made their selection they hit a show operations button
    which then does things depending on the selections made. 
    The tables come from a SQL Server.
    The sql statement for my Departments TableAdapter is:
    SELECT        Code, Department
    FROM            Departments
    ORDER BY DisplayOrder
    Setup of combobox:
    Use Data Bound Items is ticked
    Data Source = DepartmentsBindingSource
    Display Member = Department
    Value Member = Code
    Selected Value = (none)
    This image show a correct list for the department CB (bored of typing combobox) when it is first clicked.
    I select Finishing, then.
    This image shows what I get on the second click (which can literally be straight after as though the wrong selection was made the first time - I say this as clicking my Show Operations button has no effect on the behaviour).
    Basically the top item changes to be whatever the previous selection was. If I had chosen Construction it would have read Construction, Construction, Finishing.
    The same thing is happening on the Vehicles CB - I wont explain that as it is the same as above.
    I have been googling this for several hours but cannot find any other example of this issue. I may have done something stupid but hopefully not.
    If you could please shed some light on why these combobox's are behaving this way I would be VERY grateful.
    I am trying to learn as much as I can so if someone could actually explain why this is doing this rather than just a one line fix (which would be better than no fix at all) it would be appreciated.
    Note: I have no code associated with event / index changes on either box in any way. I reference their current values once I have click my Show Operations button.
    Anyway I hope the above is nice and clear for you.
    Thanks again,
    Paul.

    Thank you for shairng your experience here.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to select an item in sap.ui.table.Table without using index?

    Hi there,
    I want to select an item of a sap.ui.table.Table by finding the right item and selecting it.
    Take the example at this SDK page:
    SAPUI5 SDK - Demo Kit
    You have first name and last name. I want to select "Mo Lester". While there is a function called setSelectedIndex, there is no function for setSelectedItem.
    I have to search the items of the table for a required entry and select it (like clicking on it).
    Is there a way to do this (programatically)?
    I'm using aggregation binding with a JSON model.
    Regards
    Tobias

    Hi Tobias,
    What you could do is first find the JSON object (i.e., the table row) in your table model, and use its index in the model to set the selected index:
    var matches = $.grep(array, function() {
        return(this.firstName === "John" && this.lastName === "Doe");
    if (matches.length) {
        var index = yourTable.getModel().getData().indexOf(matches[0]); //first match
        yourTable.setSelectedIndex(index);

  • Spry:selected?  First choice in table selected

    Hi all:
    I want the first item in my table to be highlighted when
    enters the page. I understand that spry:selected may be able to do
    this, but when I include in my code, it always highlights the last
    item in the table list, not the first.
    Here is my code for the table as it currently stands.
    <div spry:region="ds1">
    <table>
    <tr spry:repeat="ds1" spry:setrow="ds1"
    spry:hover="hover" spry:select="select" spry:selected = "">
    <td>{select}</td>
    </tr>
    </table>
    </div>
    Thanks,
    oldmanscully

    Hi oldmanscully,
    I had the same problem and found the following solution. Hope
    it helps.
    <div spry:region="ds1">
    <table>
    <tr spry:repeat="ds1" spry:choose="">
    <td spry:when="{ds_CurrentRowID} == {ds_RowID}"
    spry:setrow="ds1" spry:hover="hover" spry:select="select"
    spry:selected="">{select}</td>
    <td spry:default="" spry:setrow="ds1"
    spry:hover="hover_row" spry:select="select"
    class="grid_row">{select}</td>
    </tr>
    </table>
    </div>
    Kind regards,
    Ben

  • How to populate table rows with selected listbox items?

    Hello,
    I am trying to populate a table with selected listbox items. Each item should be a new row in the table. The picture below is the listbox and table I am using. I need to get the selected name to populate the Attendee column of the table when the user clicks the Add button. How do you do this with mutltiple attendees selected?
    Thank you,
    Angie

    So you're considering the fact the if the user clicks the button twice, the name will appear twice and you don't want this, right?
    Then you must check if any value is the same than the one you are about to add in the row..
    for (var i = 0 ; i < ListBox1.length; i++){
         if (ListBox1.getItemState(i) == true){
              for (var x = 0 ; x < Table1._Row1.count; x++){
                   var boNewAttendee = true;
                   var strAttendee = Table1.resolveNode("Row1[" + x.toString() + "]").txtAttendee;
                   var newAttendee = ListBox1.getDisplayItem(i);
                   if (strAttendee.rawValue == newAttendee){
                        boNewAttendee = false;
                        break;
              if (boNewAttendee){
                   txtAttendee.rawValue = ListBox1.getDisplayItem(i);

  • I have a table with info and would like to select an item from that table

    Hi
    I have a table with info (course info that I searched for) and would like to select an item from that table to use for further use in my application.
    It must work more or less like the tree structure where I can use an On Action select.
    In other words; let say I am looking for all courses with "Advisor" it its descriptin / name, I want to click on one of the names and use it lets say to book people on.
    Could some please assist me with this.
    Regards
    Debbie

    Hi
    The datasource for my table is the node searchcatalog.  Under this node there is an attribute calles description where the items found are displayed.
    I changed my code as follow:
    data: ls_table type wd_This->Elements_searchcatalog,
          lr_element type ref to if_wd_context_element.
      DATA lo_nd_searchcatalog TYPE REF TO if_wd_context_node.
      DATA lo_el_searchcatalog TYPE REF TO if_wd_context_element.
      DATA ls_searchcatalog TYPE wd_this->element_searchcatalog.
    navigate from <CONTEXT> to <SEARCHCATALOG> via lead selection
      lo_nd_searchcatalog = wd_context->get_child_node( name = wd_this->wdctx_searchcatalog ).
    @TODO handle not set lead selection
      IF lo_nd_searchcatalog IS INITIAL.
      ENDIF.
    get element via lead selection
      lo_el_searchcatalog = lo_nd_searchcatalog->get_element(  ).
    @TODO handle not set lead selection
      IF lo_el_searchcatalog IS INITIAL.
      ENDIF.
    get all declared attributes
      lo_el_searchcatalog->get_static_attributes(
        IMPORTING
          static_attributes = ls_searchcatalog ).
    lo_nd_searchcatalog->get_lead_selection->( exporting index = wdevent->index importing
    element = lr_element ).
    lr_element->get_static_attributes->( importing static_attributes = ls_table ).
    wd_context->set_attribute( exporting name = 'SELECTED' value = ls_table-description ).
    When I try to activate it errors with: List elements that take up more than one line is not allowed.  This error at the sentence: lo_el_searchcatalog->get_static_attributes(
    If you cannot assist me further I will understand.  Thank you.

  • How can I select the next item in table view?

    Hey,
    I'd like to select the next item ,but I have no idea about this ?do you have any suggestion?
    eg:
    the second item is being selected now,I need to select the third one in my code ,how can I implement this function?

    private IntegerProperty index = new SimpleIntegerProperty();
        public final double getIndex() {
            return index.get();
        public final void setIndex(Integer value) {
            index.set(value);
        public IntegerProperty indexProperty() {
            return index;
        }Get the selected item:
    table.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
                @Override
                public void changed(ObservableValue observable, Object oldvalue, Object newValue) {
                    Person selectedPerson = (Person) newValue;
                    setIndex(data.indexOf(newValue));
            });Select the next index:
    table.getSelectionModel().select(index.get() +1  );

  • ADF Faces: How to autoselect the first item in a af:table ?

    Hi
    I want <af:table> to autoselect the first item in the set (if there is at least one item). I'm looking for a programatic way to do it, but haven't found a solution.
    Any suggestions?
    TIA,
    Brian

    There is no declarative way of doing this.
    The java apis to do this are...
    call...
    table.getSelectionState().clear()
    table.setRowIndex(myIndex);
    table.getSelectionState().add();

  • First row of table is displayed as selected always when application loads.

    Hi..
    I have a table with few rows in it.When the application loads the first row of table is displayed as selected always.I don't want any of the rows to be displayed as selected.
    How can I prevent this ?
    My jdev version 11.1.1.5.0
    Edited by: Lovin_JV_941794 on Mar 12, 2013 2:13 AM

    Hi,
    can you remove the attribute
    selectedRowKeys="#{bindings.XXXX.collectionModel.selectedRow}"This would ensure that there are no selected rows persisted. you can also paste the jspx code also for better answer.
    ~Abhijit

  • How can i show the first item in the list as selected item

    Aslam o Alikum (Hi)
    Dear All
    How can i show the first item in the list as selected item when user click on the list. Right now when user click the list the list shows the last item in the list as selected or highlighted. Furthermore if the list item have large no of value and a scroll bar along with it then the list scroll to last item when user click it with mouse. I want that when user click the list item with mouse list should show the first item as highlighted.
    Take Care
    Allah Hafiz

    Hi!
    You can set list "initial value" using When-Create-Record trigger.
    I.g.
    :<Block_name>.<list_item_name> := Get_List_Element_Value('<Block_name>.<list_item_name>', 1);

  • Windows Explorer - How to select the first item once we open the explorer?

    Hi,
    In Windows Explorer - How to select the first item once we open the explorer using keyboard shortcut. I typically use downward arrow, it goes to the 2nd item in the list, then I again have to use upward arrow to go up.
    Is there a shortcut to select the first item in the list using keyboard? This is not specific to Windows 7, it has been the behavior even in previous Windows OS versions.
    Thanks,
    Mallik

    Opening a Microsoft Ticket is probably your best option. Unfortunately the change will not happen immediately and it will require multiple users to send in a ticket. I hope this ends up being resolved though.
    Good luck Mallik
    Also, don't forget to mark the post as answered so that it does not show up as unanswered to help others who search the forums.
    Agreed, MS wont change it easily. :)
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • Windows Phone 8.1 xaml, c# ComboBox does not display selection when first item is selected from full page list.

    I have 3 comboboxes on a xaml page and most of the time when I select the first item on the full page list displayed when the number of items are > 5, the screen returns to the combobox and the box is blank. The combobox.SelectedItem is valued but it
    does not display.  This does not happen every time and I have seen this using the emulator and my windows 8.1 phone.  If I select any other item in the list they always display but when I go back and select the first item the box is blank. 
    Does anyone know what I could be doing that is causing this?

    Thanks for your help.  When I run the code below and the page is displayed, I select an item from the page list and it displays fine and then I select the first item from the page list and I do not see that selected item in the box. 
    If I remove the SelectedIndex=0 it all works fine except I do not have an item selected for the initial display.  Below should show problem and should work copy/paste in universal blank app.
    ScrollViewer x:Name="scrollViewer1">
            <StackPanel x:Name="stackPanel1" Background="Transparent">
                <ComboBox x:Name="comboBoxTestTypes" Margin="20,117.75,0,465.25" SelectedValuePath="ItemDescription" Width="310" Height="Auto" FontSize="17"
           ItemsSource="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Center">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding ItemDescription}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
     </StackPanel>
        </ScrollViewer>
    public sealed partial class MainPage : Page
            public ObservableCollection<ItemDetail> itemDetail;
            public MainPage()
                this.InitializeComponent();
                this.NavigationCacheMode = NavigationCacheMode.Required;
                this.itemDetail = new ObservableCollection<ItemDetail>();
            protected override void OnNavigatedTo(NavigationEventArgs e)
                PageLoad();
            public class ItemDetail
                public string ItemDescription { get; set; }
                public string ItemName { get; set; }
            private async void PageLoad()
                await initializeTypes();
                var comboBoxTestTypesItemsSource = await GetTestTypes();
                comboBoxTestTypes.ItemsSource = comboBoxTestTypesItemsSource;
                comboBoxTestTypes.SelectedIndex = 0;
            private async Task initializeTypes()
                await addTestType("Item1");
                await addTestType("Item2");
                await addTestType("Item3");
                await addTestType("Item4");
                await addTestType("Item5");
                await addTestType("Item6");
            private async Task<ObservableCollection<ItemDetail>> GetTestTypes()
                //ObservableCollection<ItemDetail> list = new ObservableCollection<ItemDetail>();
                //Random rnd = new Random();
                //for (int i = 0; i < 50; i++)
                //    list.Add(new ItemDetail() { ItemDescription = "hello" + rnd.Next(0, 1001), ItemName = rnd.Next(0, 101).ToString() });
                await getSaveDataFileDataAsync("get");
                return itemDetail;
            private async Task addTestType(string description)
                int newIdAdd = 0;
                if (itemDetail != null && itemDetail.Count > 0)
                    newIdAdd = itemDetail.Max(mT => Convert.ToInt32(mT.ItemName)) + 1;
                var addTestType = new ItemDetail();
                addTestType.ItemName = newIdAdd.ToString();
                addTestType.ItemDescription = description;
                itemDetail.Add(addTestType);
                await getSaveDataFileDataAsync("save");
            private async Task getSaveDataFileDataAsync(string getSave)
                try
                    DataContractJsonSerializer jsonSerializer1 = null;
                    string dataFileName1 = "testFileName";
                    jsonSerializer1 = new DataContractJsonSerializer(typeof(ObservableCollection<ItemDetail>));
                    if (jsonSerializer1 != null && getSave == "get")
                        using (var stream1 = await ApplicationData.Current.LocalFolder.OpenStreamForReadAsync(dataFileName1))
                            itemDetail = (ObservableCollection<ItemDetail>)jsonSerializer1.ReadObject(stream1);
                    if (jsonSerializer1 != null && getSave == "save")
                        using (var stream1 = await ApplicationData.Current.LocalFolder.OpenStreamForWriteAsync(dataFileName1, CreationCollisionOption.ReplaceExisting))
                                jsonSerializer1.WriteObject(stream1, itemDetail);
                catch

  • Missing "Select Multiple Items" in Report Filter for Pivot Table in Excel Services

    I have a Pivot Table with a Report Filter in Excel 2013.
    When I click the Report Filter in Excel , I get the check-box option to "Select Multiple Items".
    But , when the same Report.xls is published to SharePoint 2013 Excel Services,
    the check-box-option is missing ! and the default is "Multi-select", and there is no way to disable or toggle Multi-select
    is there any fix ?
    thanks

    Thank you Naveen, I have already read this , and checked ,
    But, it does not fix my issue :(
    All my desktops are set at 100%.
    All my List Items show as Check-boxes, ok.
    The problem is: that check-box option "Select Multiple Items" , just above the OK button, is missing when I run the report in Excel Services.
    So I have no way to toggle Select Single Items only.
    But when I Open this same report in Excel, everything works well.
    Is there any Fix for Excel Service /Sharepoint 2013.
    Paul

Maybe you are looking for