• Post Reply Bookmark Topic Watch Topic
  • New Topic

h:outputLabel disappears after h:inputText validation fail  RSS feed

 
Sergii Olishchuk
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Guys, I have a problem with h:outputLabel component. I have the following code:

<h:outputLabel styleClass="desc" value="" for="component_id" />
<h:inputText styleClass="text medium" id="component_id"
value="#{beanForm.val}" required="true" />
<t:message for="component_id" styleClass="fieldError" />

When I leave field blank and make "submit" I see "This is a required field" message and component label disappears. How could I solve this issue with label?

Many thanks

 
Sergii Olishchuk
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know the answer?
 
Sergii Olishchuk
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still have this problem. Does someone know how to solve this?
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not post "bump" messages. If someone knows, they'll answer. If they don't it won't help.

Your value= attribute on the outputLabel has no value in it. So I would not expect it to display anything.

The "value required" error refers to the inputText control, which is not permitted to be empty, since it has the "required" attribute set to "true".
 
Sergii Olishchuk
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:Please do not post "bump" messages. If someone knows, they'll answer. If they don't it won't help.

Your value= attribute on the outputLabel has no value in it. So I would not expect it to display anything.

The "value required" error refers to the inputText control, which is not permitted to be empty, since it has the "required" attribute set to "true".


Tim, thank you for your reply. My outputLabel has some value let's say value="someValue" (sorry, I missed that one in the code listing above), and I see it untill validation error occurs. But when the message is printed ("this is a required field") label disappears. Could you suggest me something?
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best guess I can make is that the label is still there, but it's being squashed into invisibility because of the extra space that the message consumes. Try your browser's "View Page Source" function and see what the generated HTML looks like.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!