-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Webb, Ed
Gesendet: Montag, 29. M�rz 2004 13:14
An: '[EMAIL PROTECTED]'
Betreff: RE: [displaytag-user] adding custom static rows into a table / accessing 
table data directly per row without automatically generated table tags





-----Original Message----- 
From: Sprang, Henning (Firma CS) [mailto:[EMAIL PROTECTED] 
Sent: 29 March 2004 11:31 
To: [EMAIL PROTECTED] 
Subject: [displaytag-user] adding custom static rows into a table / 
accessing table data directly per row without automatically generated 
table tags 
[snip] 
> 1.) I want to add a custom, non-data table row in a displaytag table 
> between the 
> header row and the first real data row. In my special case, i have a table with 
> search results from 
> a database, and the row between the header an the first data row should show 
> text input 
> fields to enter the user's search request with search criteria for each data 
> column. 
>I believe you can do this with a TableDecorator. If you override the startRow() 
>method and use a class variable you can >check if this is the first row in the table:>
>public MyDecorator extends TableDecorator { 
>        
>        boolean doneFirst = false; 
>        public String startRow() { 
>                if (!doneFirst) { 
>                        doneFirst = true; 
>                        return "<tr>[type the rest of your inserted row here]</tr>"; 
>                } 
>        } 
>} 


This think works so far, but it's a bit ugly - I did not already find a nice solution 
how i can prevent me
from hardcoding the full table row into a java class, plus i must find a way how to 
get default values
or the values from the last search into the input field of the table row.

One solution would be maybe to put a list of those values into the first row of my 
table list, 
but that would get resorted when the user wishes to change order on the table. 
Is there a nice way to get data other than the table list into the TableDecorator from 
the 
jsp / request context?



> 2.) In the table's data rows i want to add special contents in the data fields, 
>     not just simple td tags with css-classes and some text content, but i want 
>     to add things like select boxes, for example, because i want the user to 
> select 
>     some or more of the table entries to do something with the data. 
> 
>     This might be best realized if i could access the table data directly with 
>     something like a "fieldata" tag which inserts only the data into the jsp 
> while layout 
>     and everything would be to be implemented in the jsp. 
>You can add any text or html tags to the <td> cells by placing it inside the 
><display:column> tag's body: 
><display:table name="result"> 
>        <display:column title="Last Name"> 
>                <input type="checkbox" value="${result.rowId}" />${result.lastName} 
>        </display:column> 
></display:table> 


This doesn't work at all for me - a colleague said, it's using EL, which is only 
available for
JSP 2.0 which I don't have in Tomcat 4 - is that correct?


The last hint plus the link must wait until tomorrow, i am too tired now...

Thanks for the help so far,
Henning


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to