Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Aligning popup with selected table row

David.Harvison-OracleDec 13 2011 — edited Dec 14 2011
My goal is that on a row being selected a popup is shown directly below the most recently selected row.

I have set up a table selectionListener and am able to have a popup show aligned to the table on selection. I have been unable to detect which row was selected because the selectionEvent source is the table. My thought was to try and map between the selected RowKey and selected row but I have not come up with a mapping.

Here is the relevant jspx:
<af:table var="row" rowBandingInterval="0" id="t1"
            width="100%"
            value="#{backingBeanScope.managedBean1.tableData}"
            rowSelection="single"
            displayRow="selected"
            columnStretching="column:c1"
            selectionListener="#{backingBeanScope.managedBean1.selectionListener}"
            binding="#{backingBeanScope.managedBean1.myTable}">
  <af:column sortable="false" headerText="col1" id="c1">
    <af:outputText value="#{row}" id="ot2"/>
  </af:column>
</af:table>
<af:popup id="p1" contentDelivery="immediate"
         binding="#{backingBeanScope.managedBean1.myPopup}">
    <af:panelGroupLayout id="pgl2">
       <af:outputText value="outputText2" id="ot3"/>
    </af:panelGroupLayout>
</af:popup>
Here is what I have for the selectionListener:
    public void selectionListener(SelectionEvent selectionEvent) {
        UIComponent source = (UIComponent) selectionEvent.getSource();

        RichPopup.PopupHints ph = new RichPopup.PopupHints();
        ph.add(RichPopup.PopupHints.HintTypes.HINT_ALIGN_ID, source);
        ph.add(RichPopup.PopupHints.HintTypes.HINT_ALIGN, RichPopup.PopupHints.AlignTypes.ALIGN_START_BEFORE);
        myPopup.show(ph);
    }
I am using 11.1.1.5.0

Any insight is appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 11 2012
Added on Dec 13 2011
3 comments
292 views