0

I have two radiobuttons in a form in my jsf xhtml file but I don't know which values I should give them and which value to give to my submit button. The two radiobuttons decide whether the user wants to deposit or withdraw something form his account (it's a simmulation of an online atm for a class I'm in) I have a Bean in which both methods to deposit or to withdraw are in but I can't figure this out. (I'm new, sorry)

<h:outputLabel class="form-check-label">
                <h:selectOneRadio value="#{}">
                    <f:selectItem itemValue="#{}" 
                         itemLabel="Deposit" />
                    <f:selectItem itemValue="#{}" 
                         itemLabel="Withdraw" />
                </h:selectOneRadio>
</h:outputLabel>
<button type="submit" class="btn btn-primary">Submit</button>
Ashish Mathew
  • 783
  • 5
  • 20
johndonnon
  • 13
  • 4

1 Answers1

0
 <h:selectOneRadio value="#{}">
                <f:selectItem itemValue="#{}" 
                     itemLabel="Deposit" />
                <f:selectItem itemValue="#{}" 
                     itemLabel="Withdraw" />
 </h:selectOneRadio>

<h:selectOneRadio value="#{}"> put the variable where you want to put the selected value

<f:selectItem itemValue="#{}" itemLabel="Deposit" /> put the value of the radio button

see examples here h:radiobutton mkyoung and h:radiobutton tutorialspoint

M.A.Bell
  • 398
  • 1
  • 16