webtier@glassfish.java.net

Re: Setting the class attribute of a h:inputHidden component

From: <webtier_at_javadesktop.org>
Date: Tue, 03 Nov 2009 09:50:46 PST

You are right h:inputHidden does not support the styleClass attribute, while it normally does not make sense, as a input type="hidden" will usually not have any style, it seems the HTML speccs allow for the class attribute on any input tag. Maybe this should be added to future JSF specifications.

So to work around your problem with the current implementations:

1) You could add a custom renderer (and if you need your template to be valid a custom tag, that allows for styleClass)


2) give classes to parent elements, so you can still write your selector
ex:
[code]
<div id="container" class="clearhidden">
    <h:inputHidden value="......

$(".clearhidden input[type='hidden']").val("");
[/code]
Hope this helps.
[Message sent by forum member 'ioss' (ioss_at_mx.jevelopers.com)]

http://forums.java.net/jive/thread.jspa?messageID=370360