Tuesday, May 3, 2011

Setting default value for the af:selectOneradio component

Hi,
You can set the default value for the selectOneRadio button values,
In ADF by default no values is selected for this component,
There is a attribute called "value" using that you can set the default value, that is give the value of the selectItem for whic you want to set default choice,

<af:selectOneRadio label="Select" id="sor1" value="2">
<af:selectItem label="One" value="1" id="si2"/>
<af:selectItem label="Two" value="2" id="si1"/>
</af:selectOneRadio>





Regards,
Gopinath J

10 comments:

  1. it's k But Radio buttons need to select dynamically based on value change.
    how can i achieve this?

    ReplyDelete
  2. Hi Venkat,

    you have set the value in the valuechange event in backingbean.

    use component binding say radioBtn,
    radioBtn.setValue(2); - this will select the One
    radioBtn.setValue(1); - this will select the Two

    is this ok ? or brief about your usecase.

    Gopi

    ReplyDelete
  3. Hi Gopinath, can u pls provide the solution for the question as soon as possible which i have asked?

    ***venkat*****

    ReplyDelete
    Replies
    1. Hi gopinath Thanx fro u r valuable Information........
      i have one query....
      Based on output text value the corresponding Radio buttons need to select.
      The output text returning three values,it's coming from Binding
      eg: <af:outputText value="#{bindings.Status.inputValue}"
      based on these value Radio buttons need selected.

      Delete
    2. add ppr of the outputtext to selectone radio.

      in the value of selectone radio use the outputtext value binding like below,

      af:selectOneRadio label="Select" id="sor1" value="#{bindings.Status.inputValue eq 'true' ? '1' : '2'}"

      check the condition with your actual value

      Delete
  4. Hi Gopinath,
    I have one doubt in adf I have created one Tree in jsf from view object(Data Control)
    it is not refreshing ,this tree is depends on another tree in same jsf.
    even i have given PPR also.Could u pls provide solution for this issue.


    *******Venkat*******

    ReplyDelete
    Replies
    1. Surround the tree component with some layout component and refresh the layout component,

      If not works, kindly brief about your use case..

      Delete
  5. Hi gopinath,
    I need u r help in adf.
    Iam displaying adf tree in jspx page while dragging it from data control.
    i need to give condition for the childs of tree,on click on childs need to display a popup.(Iam using <af:commandLink
    text="#{node}" for dispalying tree.
    How can i achieve this?
    Can u pls help on this?

    ReplyDelete
    Replies
    1. Here is blog which maches ur requirement,

      http://oracleadf-java.blogspot.in/2013/08/tree-table-component-with-declarative.html

      Delete
  6. Your blog contains very valuable information which is very helpful one and the points that were presented in this article are very wonderful and for further information visit
    Oracle Fusion Financials Training

    ReplyDelete