0

We have recently upgraded from JSF 1.x to JSF 2.x

We have a up and running application since 2 years. The issue we are facing is:

we have below code in JSF

 <h:inputText id="DescriptionText" required="true" value="#{scenarioDesc}"> 

<f:converter converterId="RequiredConvertor"/> 
<f:attribute name="label" value="#{giamsBundle['lbl.request.summary.desc.validation']}"/>
</h:inputText>

We Use required converter to get the label value as below

String componentLabel = (String) component.getAttributes().get("label");

But componentLabel returns null. It is not able to get value when we define a resource bundle name but works fine when we add any string to the value for f:attribute tag

Please help.

1 Answers1

0

This works just fine for me in Mojarra 2.1.27. However, since you're setting the attribute of an existing component attribute, other implementations might not handle the naming in the same order.

To fix, I'd use either the existing label attribute:

<h:inputText id="DescriptionText" required="true" value="#{scenarioDesc}"
  label="${giamsBundle['lbl.request.summary.desc.validation']}"
  converter="RequiredConvertor" />

Or, use a different attribute name than 'label'.

codeturner
  • 993
  • 1
  • 8
  • 20