6 Replies Latest reply: Nov 15, 2012 12:04 PM by 802190 RSS

    Table row detailStamp disclosure to select a row

    802190
      I have a ADF table with a detailStamp facet that puts a delete button in each row.
      Is there any way to make the disclosure arrow for each row select the row at the same time? The disclosure arrow seems to work independently of the row selection. So when a user clicks the disclosure arrow to open up a different row than the one that is currently selected, then clicks on the delete button, it messes things up for them.
        • 1. Re: Table row detailStamp disclosure to select a row
          Arunkumar Ramamoorthy-Oracle
          Hi,

          Always mention your JDev version.

          Have you tried adding a rowDisclosureListener for the table and then set the current row (selectedRowKeys) to the disclosed row?

          -Arun
          • 2. Re: Table row detailStamp disclosure to select a row
            Frank Nimphius-Oracle
            Hi,

            here's what you do using the row disclosure event

            1. access table instance calling (RichTable) rowDisclosureEvent.getSoutrce();
            2. get the added row --> RowKeySet addedSet = rowDisclosureEvent.getAddedSet();
            3. table.setSelectedRowKeys(addedSet)
            4. PPR the table

            Frank
            • 3. Re: Table row detailStamp disclosure to select a row
              802190
              Hi Frank,

              Thanks for replying. Your suggestion didn't seem to work for me, nothing happens still when I click on the disclosure arrow. Here is what my source code looks like:
                  public void inhibitorDisclosureListener(RowDisclosureEvent rowDisclosureEvent) {
                      RichTable table = (RichTable)(rowDisclosureEvent.getSource());
                      RowKeySet addedSet = rowDisclosureEvent.getAddedSet();
                      table.setSelectedRowKeys(addedSet); 
              
                      AdfFacesContext.getCurrentInstance().addPartialTarget(table);
                  }
              And my table tag looks loke this:
              <af:table value="#{bindings.ChInhibitorView3.collectionModel}"
                var="row"
                rows="#{bindings.ChInhibitorView3.rangeSize}"
                emptyText="#{bindings.ChInhibitorView3.viewable ? 'No data to display.' : 'Access Denied.'}"
                fetchSize="#{bindings.ChInhibitorView3.rangeSize}"
                rowBandingInterval="0"
                selectedRowKeys="#{bindings.ChInhibitorView3.collectionModel.selectedRow}"
                selectionListener="#{viewScope.PatientClinicalBean.inhibitorSelectRow}"
                rowSelection="single" id="t3" width="100%"
                columnStretching="last" inlineStyle="height:160px;" autoHeightRows="5"
                binding="#{viewScope.PatientClinicalBean.inhibitorTable}"
                partialTriggers="::cb1 ::cb2 ::cb10"
                displayRow="selected" editingMode="clickToEdit"
                rowDisclosureListener="#{viewScope.PatientClinicalBean.inhibitorDisclosureListener}">
              
              .....
              Oh, and my jDev version is: Build JDEVADF_11.1.2.3.0_GENERIC_120914.0223.6276.1
              • 4. Re: Table row detailStamp disclosure to select a row
                802190
                Hi Arunkumar,
                My jDev version is: Build JDEVADF_11.1.2.3.0_GENERIC_120914.0223.6276.1

                The current row doesn't seem to change when I click on my row disclosure, which is the root of my problems. How can I find the row that was opened by the disclosure arrow? If I can find that out somehow, then I'll be able to set the row to that.

                Thanks.
                • 5. Re: Table row detailStamp disclosure to select a row
                  Arunkumar Ramamoorthy-Oracle
                  Hi,

                  Try having a commandButton (just to submit) inside your detailStamp facet. Click on the button after disclosing the row and see if the selected row is getting changed to the disclosed one.

                  Since you said, you would be using a delete button, now after adding the code, you could safely use it to delete the disclosed row.

                  -Arun
                  • 6. Re: Table row detailStamp disclosure to select a row
                    802190
                    I tried your idea of just putting a new command button in my detail stamp to see if clicking the button will select the row, the answer is no. The selected row doesn't change if I open a detail stamp of different rows and click on a command button.
                    This is really concerning for me because the user is deleting rows that they think they have selected by opening the disclosure arrow, but are actually deleting other selected rows instead.