I am having some trouble with using h:selectOneRadio
. I have a list of objects which is being returned which needs to be displayed. I am trying something like this:
<h:selectOneRadio id="selectPlan" layout="pageDirection">
<f:selectItems value="#{detailsHandler.planList}" />
</h:selectOneRadio>
and planList is a List of Plans. Plan is defined as:
public class Plan {
protected String id;
protected String partNumber;
protected String shortName;
protected String price;
protected boolean isService;
protected boolean isOption;
//With all getters/setters
}
The text that must appear for each radio button is actually in a properties file, and I need to insert params in the text to fill out some value in the bean. For example the text in my properties file is:
plan_price=The price of this plan is {0}.
I was hoping to do something like this:
<f:selectItems value="<h:outputFormat value="#{i18n.plan_price}">
<f:param value="#{planHandler.price}">
</h:outputFormat>" />
Usually if it's not a h:selectOneRadio
component, if it's just text I use the h:outputFormat
along with f:param
tags to display the messages in my .property
file called i18n
above, and insert a param which is in the backing bean. here this does not work. Does anyone have any ideas how I can deal with this?
I am being returned a list of Plans each with their own prices and the text to be displayed is held in property file. Any help much appreciated.
Thanks!
I am now able to resolve the above issue following the recommendation below. But now I have another question. Each radio button item must display like this:
Click **here** to see what is included. The cost is XX.
Now the above is what is displayed for each radio button. The "here" needs to be a hyperlink which the user can click and should bring up a dialog box with more info.I can display the sentence above but how do I make the "here" clickable?
Since the above is what is displayed it is the label for SelectItem(Object value, String label) which is returned.
Any ideas much appreciated.