You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ali Abdel-Aziz Ali <ro...@gmail.com> on 2007/12/05 23:43:26 UTC

How can I Use Expression Language in the DataTable id

Hi All,

I need to be able to dynamically increment the id of the datatable. however
the datatable *id* doesn't accept EL.

the situation I'm facing is that I have dynamic number of tables so I
construct its data and iterate on the list of tables inside datalist and
generate the table code for each table.
But I still have another issue which is I wanna generate also for each table
its own data scroller and the scroller take the *id* of the table in the *
for* property so I wanna make the *id* of the table is incremently
increasing for exmaple  data_1, data_2, ... etc and give this *id* to the
data scroller *for* property.

Is there a way or a work around to achieve this ?

Thanks for your time.

-- 
Ali Abdel-Aziz
http://www.aliabdelaziz.com

Re: How can I Use Expression Language in the DataTable id

Posted by Ali Abdel-Aziz Ali <ro...@gmail.com>.
Hi Gerhard,

Thanks for your fast reply I will try your solution.

*if you wanna know more details about my situation here are some details:*
*the situation I have is that I have screens that allow the user to define
new fields (name, type(dropDowen, number, date, ..), maxRecords, isRequired,
groupID, fieldLength, ... etc)
and using this info you know what are the groups you have (tables) and using
this info also you will know which fields will be in which group (table) and
using this info you will know what are the table row size (maxRecords).*

Thanks for your time.

On Dec 6, 2007 3:44 AM, Gerhard Petracek <ge...@gmail.com> wrote:

> hello,
>
> if they are really dynamic ("without limited rules") + your mentioned id
> requirement:
> in such cases you have to generate/build your tables via source code.
> (there are "several" possibilities to do that - most of them aren't
> nice/handy...)
> however, e.g. you can combine this approach with component binding. i
> think it's the shortest and most acceptable solution for such a requirement.
> -> you can call setId(...)
> (i know - there are some drawbacks...)
>
> just an additional hint:
> you don't bind the tables themselves. you have to choose an adequate
> parent component
> e.g. you can use:
> <h:panelGrid binding="..."/>
> -> within your source code:
> grid.getChildren().add( currentTable );
> or something equivalent...
> i think you know, what i mean!?
>
> all other solutions depend on your requirements.
> these solutions might be more elegant. however, i don't describe them in
> detail, because i don't know your detailed requirements.
> (it really depends on some details of your specific requirements)
>
> regards,
> gerhard
>
>
>
> 2007/12/5, Ali Abdel-Aziz Ali <robinhoo.2006@gmail.com >:
>
> > Hi All,
> >
> > I need to be able to dynamically increment the id of the datatable.
> > however the datatable *id* doesn't accept EL.
> >
> > the situation I'm facing is that I have dynamic number of tables so I
> > construct its data and iterate on the list of tables inside datalist and
> > generate the table code for each table.
> > But I still have another issue which is I wanna generate also for each
> > table its own data scroller and the scroller take the *id* of the table
> > in the *for* property so I wanna make the *id* of the table is
> > incremently increasing for exmaple  data_1, data_2, ... etc and give this
> > *id* to the data scroller *for* property.
> >
> > Is there a way or a work around to achieve this ?
> >
> > Thanks for your time.
> >
> > --
> > Ali Abdel-Aziz
> > http://www.aliabdelaziz.com
>
>
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces




-- 
Ali Abdel-Aziz
http://www.aliabdelaziz.com

Re: How can I Use Expression Language in the DataTable id

Posted by Gerhard Petracek <ge...@gmail.com>.
hello,

if they are really dynamic ("without limited rules") + your mentioned id
requirement:
in such cases you have to generate/build your tables via source code.
(there are "several" possibilities to do that - most of them aren't
nice/handy...)
however, e.g. you can combine this approach with component binding. i think
it's the shortest and most acceptable solution for such a requirement.
-> you can call setId(...)
(i know - there are some drawbacks...)

just an additional hint:
you don't bind the tables themselves. you have to choose an adequate parent
component
e.g. you can use:
<h:panelGrid binding="..."/>
-> within your source code:
grid.getChildren().add( currentTable );
or something equivalent...
i think you know, what i mean!?

all other solutions depend on your requirements.
these solutions might be more elegant. however, i don't describe them in
detail, because i don't know your detailed requirements.
(it really depends on some details of your specific requirements)

regards,
gerhard



2007/12/5, Ali Abdel-Aziz Ali <ro...@gmail.com>:
>
> Hi All,
>
> I need to be able to dynamically increment the id of the datatable.
> however the datatable *id* doesn't accept EL.
>
> the situation I'm facing is that I have dynamic number of tables so I
> construct its data and iterate on the list of tables inside datalist and
> generate the table code for each table.
> But I still have another issue which is I wanna generate also for each
> table its own data scroller and the scroller take the *id* of the table in
> the *for* property so I wanna make the *id* of the table is incremently
> increasing for exmaple  data_1, data_2, ... etc and give this *id* to the
> data scroller *for* property.
>
> Is there a way or a work around to achieve this ?
>
> Thanks for your time.
>
> --
> Ali Abdel-Aziz
> http://www.aliabdelaziz.com




-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces