Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1835
  • Last Modified:

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?
0
bganoush
Asked:
bganoush
  • 2
1 Solution
 
Michel PlungjanIT ExpertCommented:
why not
styleClass="inputText showDetails"
0
 
bganoushAuthor Commented:

Thanks I'll try that.
0
 
bganoushAuthor Commented:
Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now