But how to substitute the value=?? by the book id?

Geert

-----Original Message-----
From: Geert Van Landeghem 
Sent: vrijdag 14 november 2003 14:48
To: Struts Users Mailing List
Subject: RE: Checkbox values: how to substitute the value attribute by
the book id?


Sumit, 

I found a solution to this problem as following:

<!-- presenting the selected checkbox values -->
<logic:present name="bookListForm" property="selectedBook">
        <logic:iterate id="sel" name="bookListForm" property="selectedBook">
                <br>index = <bean:write name="sel"/>
        </logic:iterate>
</logic:present>

<!-- the form with the checkbox for each row of the html table -->
<!-- refers to this page being executed again -->
<html:form action="/booklist">
<table width="95%" border="1">
<tr>
<th bgcolor="#330066"><font color="#FFFFFF">&nbsp;</font></th>
<th bgcolor="#330066"><font color="#FFFFFF">AuthorL</font></th>
<th bgcolor="#330066"><font color="#FFFFFF">AuthorF</font></th>
<th bgcolor="#330066"><font color="#FFFFFF">Title</font></th>
</tr>
<logic:iterate id="book" name="BookListKey" scope="request"> 
<tr> 
        <td><html:checkbox property="selectedBook" value="??"><bean:write name="book" 
property="id"/></html:checkbox></td>
        <td><bean:write name="book" property="authorLastName"/>&nbsp;</td>
        <td><bean:write name="book" property="authorFirstName"/>&nbsp;</td>     
        <td><bean:write name="book" property="title"/>&nbsp;</td>       
</tr>
</logic:iterate>
</table>
<html:submit>Process</html:submit>
</html:form>
-----Original Message-----
From: Sumit S. [mailto:[EMAIL PROTECTED]
Sent: vrijdag 14 november 2003 12:51
To: Struts Users Mailing List
Subject: RE: Checkbox values


Geert,
     this would create BookListKey[i].selectedBook = 1 for "Checked" Books....

When you have to render this info try

<logic:present name="BookListKey">
        <logic:iterate id="book" name="BookListKey">
            <logic:equal name="book" property="selectedBook" value="1"> 
                    <br>selected index = <bean:write name="book" property="id"/>
                </logic:equal>
        </logic:iterate>
</logic:present>


hope this helps

Regards
Sumit


-----Original Message-----
From: Geert Van Landeghem [mailto:[EMAIL PROTECTED]
Sent: Friday, November 14, 2003 4:56 PM
To: Struts Users Mailing List
Subject: Checkbox values


Hello all,
 
I'm trying to show the selected rows in a html table by using check
boxes. I'm using the same jsp to show the selected row indexes of the table.

What am I'm doing wrong because I'm not able to see the selected indexes:

<logic:present name="selectedBook">
        <logic:iterate id="sel" name="selectedBook">
                <br>selected index = <bean:write name="sel"/>
        </logic:iterate>
</logic:present>

<logic:iterate id="book" name="BookListKey" scope="request"> 
<tr> 
        <td><html:checkbox property="selectedBook"><bean:write name="book" 
property="id"/></html:checkbox></td>
        <td><bean:write name="book" property="authorLastName"/>&nbsp;</td>
        <td><bean:write name="book" property="authorFirstName"/>&nbsp;</td>     
        <td><bean:write name="book" property="title"/>&nbsp;</td>       
</tr>
</logic:iterate>

tia,

met vriendelijke groeten,
salutations sincères,
kind regards,

Geert Van Landeghem
Reynders Etiketten NV
tel: +32 3 460.32.81
gsm: +32 477.75.95.33
<mailto:[EMAIL PROTECTED]>

Give me 
the power to accept the things i cannot change,
the strength to change the things i can change,
and the insight to tell the difference


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to