How to preselect a radio button in <af:tableSelectOne>?
We are using Oracle ADF/JSF 1.1 to show search results in a table starting with a radio button. Our requirement is to show search result with one of the <af:tableSelectOne>
radio buttons preselected depending on the database value match. How开发者_StackOverflow社区ever, I am unable to preselect a radio button.
Here is the code snippet:
<f:facet name="selection">
<af:tableSelectOne text="Select" autoSubmit="true" id="radiobtn" />
</f:facet>
How can I preselect it?
I believe that you should change your selection strategy :) As far as know you can't configure selection property of af:tableSelectOne. It is nested in facet of af:table component, component which drives af:tableSelectOne behaviour. So, in order to select certain row, you should check for property "selectionState" on af:table (I suppose you're using ADF 10.x version)
<af:table value="#{bindings.DemoView1.collectionModel}"
var="row" rows="#{DemoView1.DemoView1.rangeSize}"
first="#{bindings.FilterView1.rangeStart}"
emptyText="#{bindings.DemoView1.viewable ? \'No rows yet.\' : \'Access Denied.\'}"
selectionState="#{bindings.DemoView1.collectionModel.selectedRow}"
selectionListener="#{bindings.DemoView1.collectionModel.makeCurrent}"
id="table1"
I'm sure you'll find it. To get an idea, just drag'n'drop some table object to your jsf page from data control (i.e. view object if you are using ADF Business Components based Data Controls ) and choose table as wanted component, and last step , on that table choose selection option (you should get popup window after drag'n'drop).When you configure your af:table component that way, you can control selection by changing your view object's current row . (View object to which af:table is attached)
Regards
精彩评论