-
1. Re: using EL for variable ID's within columns
gavin.king Jun 6, 2007 3:48 PM (in response to koenhandekyn)huh? JSF already generates unique element ids, like modelPanelID:0, modelPanelID:1, etc.
-
2. Re: using EL for variable ID's within columns
koenhandekyn Jun 6, 2007 4:44 PM (in response to koenhandekyn)sorry, it seems that that solves my question at the generation side.
but what is the best way to "regenerate" that ID within the loop to be able to point to it from within javascript as below?
<a href="javascript:Richfaces.showModalPanel('modelPanelID:????',{width:450, top:200})">
i checked and it seems indeed that JSF is creating something like a fully qualified ID when i look in the generated HTML:
new ModalPanel('InvoiceApproveTaskInstanceListForm:_id59:1:modelPanelID' ...
but this doesn't help me very much is it seems now even more complex to regenate the full id ?
probably i'm missing something simple here ;) -
3. Re: using EL for variable ID's within columns
dustismo Jun 6, 2007 5:00 PM (in response to koenhandekyn)What you want to do is not possible in jsf, sorry..
-
4. Re: using EL for variable ID's within columns
dinaddan Jun 19, 2007 6:53 PM (in response to koenhandekyn)It is possible now with RichFaces 3.0.1 (just downloaded it and seems to work)
You need to use rich:dataTable instead of h:dataTable (may require some CSS tuning, because rich:dataTable forces inheritance of rich-table style sheets) and specify rowKeyVar attribute to get variable holding current row number.
For example if you use:<h:form id="myForm"> <rich:dataTable id="myTable" rowVarKey="rowIdx"> ... <rich:modalPanel id="myPanel"> </rich:modalPanel> ... </rich:dataTable> </h:form>
Then you can reference your panel ID in each row as:Richfaces.showModalPanel('myForm:myTable:#{rowIdx}:myPanel')
Note that those panels don't require #{task.id} anymore. Their Id will be generated in the context of their container.