Link to home
Start Free TrialLog in
Avatar of bganoush
bganoush

asked on

Adding a custom attribute to an existing tag

Hi,

I have a jsp file with an inputText tag that looks like this:

 <h:inputText styleClass="inputText" id="objectname" required="true" value="#{msg.objectname}" maxlength="50" onblur="validateRequired(this, event);">

I have a handler that looks at the class and if a specific word is found there, then it does some action.  I would like to add to the action by looking for an attribute say "myAttr" and then do something else if that is set. For instance, I want to be able to do this:

 <h:inputText styleClass="inputText" myAttr="showdetails" id="objectname" required="true" value="#{msg.objectname}" maxlength="50" onblur="validateRequired(this, event);">

When I do this however, I get an exception:

Error Message:JSPG0227E: Exception caught while translating /jsp/view/MySpecialForm.jsp:  /jsp/view/MySpecialForm.jsp(311,19) --> JSPG0123E: Unable to locate tag attribute info for tag attribute myAttr.

How can I add my attribute without causing an exception? Is this possible?
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bganoush
bganoush

ASKER


Thanks I'll try that.
Thanks