Have you tried to use a Decorator?
It's very simple, eg:
1) You must to use the atribute decorator in a column, whit the class that
do the decoration: in my example is ExpedienteDecorator. In this class
you've differents methods, and you use them like a property in the colum,
eg, property="radioButton"
<display:table name="table" class="displaytag"
decorator="es.dap.ecsi.displaytag.decorator.ExpedienteDecorator">
<display:column style="width=4%;" media="html"
property="radioButton" title="SELECCIONAR PARA VER
CONTROL"></display:column>
2) In the Decorator class I've the method radioButton, that returns and
String whit code html generate dinamycally with a radio button that has a
javascript method with differents parameters for each row.
public String getRadioButton() {
//ExpedienteView is the actual table type, and you can
access to each row with getCurrentRowObject and after accest to their fields
with the accessors methods.
ExpedienteView row= (ExpedienteView)getCurrentRowObject();
int campagna = row.getCampagna();
int expediente = row.getExpediente();
String control = row.getControl();
String result = "<input type=\"radio\" name=\"radio\"
id=\""+expediente+"\" onclick=\"actualizaDetalle("+expediente+");
parametrosExpedientes("+campagna+","+expediente+");\" />";
return result;
}
I hope that you had understood my explanation, sorry for my english.
In the next link you can find more information:
http://displaytag.sourceforge.net/11/tut_decorators.html
Good luck!!
>From: "jill juneja" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: [displaytag-user] Dynamic Column Creation
>Date: Mon, 23 Apr 2007 16:51:56 -0400
>
>I need to create dynamic columns in display tag. My need is i have 4 static
>columns and rest are dynamic columns. I have tried many options but
>nothing is working. Is this doable using display tag.
>Currently I have desgined bean as
>
>Bean1
>
>col1
>col2
>col3
>col4
>Arraylist of bean2
>
>Bean2
>colname
>colvalue
>
>Thanks and Regards,
>Jill
>-------------------------------------------------------------------------
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>_______________________________________________
>displaytag-user mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/displaytag-user
_________________________________________________________________
Dale rienda suelta a tu tiempo libre. Mil ideas para exprimir tu ocio con
MSN Entretenimiento. http://entretenimiento.msn.es/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user