In 10.1.3.2, when you drop an "ADF Form..." from the Data Control Palette, we automatically drop an EL expression for the value of the columns property to have it evaluate to the bound-attribute's Display Width hint. The source of an example af:inputText component would look like this:
<af:inputText value="#{bindings.Dname.inputValue}" label="#{bindings.Dname.label}" required="#{bindings.Dname.mandatory}" columns="#{bindings.Dname.displayWidth}"> <af:validator binding="#{bindings.Dname.validator}"/> </af:inputText>
Note that if you haven't supplied a custom value of the Display Width, then it defaults to the maximum length of the attribute.
Now, what happens if you have consciously shortened the attribute's display width by providing a custom Display Width hint that is less than the attribute's maximum allowed length? In this case, you would like to reference the attribute's maximum length in an EL expression for the UI component's maximumLength property.
You can do this by referencing the precision property of the attribute definition, as shown below:
<af:inputText value="#{bindings.Dname.inputValue}" label="#{bindings.Dname.label}" required="#{bindings.Dname.mandatory}" columns="#{bindings.Dname.displayWidth}" maximumLength="#{bindings.Dname.attributeDef.precision}"> <af:validator binding="#{bindings.Dname.validator}"/> </af:inputText>
2:48:38 PM
|