Skip to main content

Empty id attribute is not allowed

2 replies [Last post]
angelcervera
Offline
Joined: 2003-12-03
Points: 0




I'm assigning id value dynamically to a inputText tag.

I'm sure that dynamic value is not null and has a value.

JSF throw this error: "Empty id attribute is not allowed"

Is it a bug?

I'm using Glassfish 3.0.1 with Mojarra 2.0.2 (FCS b10) and this is part of my code:

<h:inputText id="#{properyValue.modelProperty.name}" label="#{properyValue.modelProperty.label}" value="#{ properyValue.valueDecimal }" required="#{properyValue.modelProperty.required}" >

</h:inputText>

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jyeary
Offline
Joined: 2004-07-20
Points: 0

This is not a bug. It is normal. If you want to dynamically create
components and render them. Please take a look at my blog entry on it. Also
note, that you can assign ids dynamically this way.

http://javaevangelist.blogspot.com/2010/11/dynamic-jsf-20-page.html

On Wed, Jul 6, 2011 at 1:54 PM, wrote:

>
> I'm assigning id value dynamically to a inputText tag.
>
> I'm sure that dynamic value is not null.
>
> JSF throw this error: “Empty id attribute is not allowed”
>
> It's a bug?
>
>
>
> I'm using Glassfish 3.0.1 with Mojarra 2.0.2 (FCS b10) and this is part of
> my
> code:
>
>
>
>
> }"
> label="#{properyValue.**modelProperty.label}" value="#{
> properyValue.valueDecimal }"
> required="#{properyValue.**modelProperty.required}" >
>

angelcervera
Offline
Joined: 2003-12-03
Points: 0

Thanks jyeary for your response.

I'm conscience that a could use bind feature and manager controls in java code, but my components are complex and i preffered use jsf templates, faceletes and components.

My question is about why a can not use an EL expression in ID attribute.

In this thread, there are similar discussion: http://forums.oracle.com/forums/thread.jspa?messageID=9599213

Anyways, thanks for your example.