Skip to main content

Component ID+ValueExpression

2 replies [Last post]
gabox01
Offline
Joined: 2007-04-22

Hi,

My question has not been answered, so i give it another try.

Is there a specific reason, why mojarra does not support ValueExpression based ID-s?

Imagine, that i have a datatable, and at every row there is a SelectOne component.
How can i identify them from each other? I want to set to them specific id-s, based on my model.

For example: category_select_1, category_select_2, category_select_3

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Lincoln Baxter, III

You'd have to bind the table to a backing bean, cast it to a
UIDataTable, then call dataTable.getRowData().getRowId() in the backing
bean -- there's currently no way to do it in the view itself.

--Lincoln

On Mon, 2009-08-03 at 05:24 -0700, webtier@javadesktop.org wrote:

> Hi,
>
> My question has not been answered, so i give it another try.
>
> Is there a specific reason, why mojarra does not support ValueExpression based ID-s?
>
> Imagine, that i have a datatable, and at every row there is a SelectOne component.
> How can i identify them from each other? I want to set to them specific id-s, based on my model.
>
> For example: category_select_1, category_select_2, category_select_3
> [Message sent by forum member 'gabox01' (gabox01)]
>
> http://forums.java.net/jive/thread.jspa?messageID=358597
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
[att1.html]

tzwoenn
Offline
Joined: 2005-07-01

Actually I am not sure at all, but I guess this limitation is caused by the facelet compiler, that needs to resolve component IDs without having a request context. Do you know, whether the specs permit ValueExpressions as IDs? I do not think so.

Regarding your datatable problem: In general component IDs are not bound to model attributes, because user interactions are bound to components and not directly to the model. If your datamodel item type contains the appropriate fields for the select one, their should be no need for manually created IDs.