cancel
Showing results for 
Search instead for 
Did you mean: 

selectOneRadio selected

indsev
Champ in-the-making
Champ in-the-making
How can we select a selectItem in a selectOneRadio by default?
If we write selected="true" there's a mistake that says :
"javax.faces.FacesException: /jsp/dialog/advanced-search.jsp(169,0) El atributo selected no es válido según el TLD especificado".
Do we have to define the TLD somewhere?
Thanks. It's very important
3 REPLIES 3

rivarola
Champ on-the-rise
Champ on-the-rise
Hello,

You have to set the value of the selectOneRadio.

indsev
Champ in-the-making
Champ in-the-making
Thanks for your anwer Smiley Wink
We have tried that, but it doesn't work. Our original code is:

<h:selectOneRadio value="#{AdvancedSearchBeanDef.mode}" layout="pageDirection" id="radioMode" >
<f:selectItem itemValue="all" itemLabel="#{msg.all_items}" id="selectAll" />
<f:selectItem itemValue="files_text" itemLabel="#{msg.file_names_contents}" id="selectFilesText" />
<f:selectItem itemValue="files" itemLabel="#{msg.file_names}" id="selectFiles"  />
<f:selectItem itemValue="folders" itemLabel="#{msg.space_names}" id="selectFolders" />
</h:selectOneRadio>

If we write value="files", the search ignores that and continue looking for all items (although in the radio "files" is selected).
How could we solve this?
Thank you!

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

Has someone found the solution to select a radiobutton by default?

I would do like this one :

Exemple from actions/simple-workflow.jsp (http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/web-client/source/web...)
<h:selectOneRadio value="#{WizardManager.bean.actionProperties.approveAction}">
  <f:selectItem itemValue="move" itemLabel="#{msg.move}" />
  <f:selectItem itemValue="copy" itemLabel="#{msg.copy}" />
</h:selectOneRadio>

We can not use "<h:selectOneRadio value=…" because the value is use to get the value in the action handler.
There is also the parameter "require=…" but it makes problems in some situations. I know it is possible to select one by default (it is done in the actions/simple-workflow.jsp). Perhaps set the value of WizardManager.bean.actionProperties.approveAction before this code above. I don't know how to do that….   :?:

Thanks