[prev in list] [next in list] [prev in thread] [next in thread]
List: struts-dev
Subject: Re: tabular radio buttons :(
From: dhay () lexmark ! com
Date: 2002-04-30 18:18:37
[Download RAW message or body]
Much better way is to stick everything in an ArrayList of beans which you
iterate through. That way no logic-present tags - radio buttons will pick up
values from underlying values.
for update, you'll need either indexed tags or nested tags.
cheers,
Dave
Chakradhar Tallam <c.tallam%oopl.com.au@interlock.lexmark.com> on 04/29/2002
11:47:35 PM
Please respond to "Struts Developers List"
<struts-dev%jakarta.apache.org@interlock.lexmark.com>
To: "'struts-dev@jakarta.apache.org'"
<struts-dev%jakarta.apache.org@interlock.lexmark.com>
cc: (bcc: David Hay/Lex/Lexmark)
Subject: tabular radio buttons :(
hi guys,
i've a page with radio buttons in 4 rows & 5 columns = 20 radio buttons.
each column's radio button's on/off property comes from a bean = 5 beans.
only one radio button in a row can be selected (one of 4 in each row), that
means the radio buttons each row should have the same name. i got this
working & i can display the on/off info of each radio button properly.
the problem comes while updating, i've created a form bean with 4 boolean
properties, get & set methods. while setting if a radio button in a row is
selected how will i know which bean that belongs to (remember radio buttons
in a row have same name)!
am i going in a worng direction! is there a better way doing this! if so,
please provide me few examples. help is appreciated.
jsp code of one of the rows
<tr>
<td class="bodyText" align="left"><bean:message
key="Diversions.engaged"/></td>
<td> </td>
<td class="dataText" align="center">
<logic:present name="PhoneNoDiversionServiceInfo"
scope="session">
<html:radio name="PhoneNoDiversionServiceInfo"
property="engagedDiverted" value="true"/>
</logic:present>
</td>
<td class="dataText" align="center">
<logic:present name="PhoneCallScreenDiversionServiceInfo"
scope="session">
<html:radio name="PhoneCallScreenDiversionServiceInfo"
property="engagedDiverted" value="true"/>
</logic:present>
</td>
<td class="dataText" align="center">
<logic:present name="PhoneMessengerDiversionServiceInfo"
scope="session">
<logic:equal name="PhoneMessengerDiversionServiceInfo"
property="engagedEnabled" value="true">
<html:radio name="PhoneMessengerDiversionServiceInfo"
property="engagedDiverted" value="true" disabled="false"/>
</logic:equal>
<logic:equal name="PhoneMessengerDiversionServiceInfo"
property="engagedEnabled" value="false">
<html:radio name="PhoneMessengerDiversionServiceInfo"
property="engagedDiverted" value="true" disabled="true"/>
</logic:equal>
</logic:present>
</td>
<td class="dataText" align="center">
<logic:present name="PhoneCallBackDiversionServiceInfo"
scope="session">
<logic:equal name="PhoneCallBackDiversionServiceInfo"
property="engagedEnabled" value="true">
<html:radio name="PhoneCallBackDiversionServiceInfo"
property="engagedDiverted" value="true" disabled="false"/>
</logic:equal>
<logic:equal name="PhoneCallBackDiversionServiceInfo"
property="engagedEnabled" value="false">
<html:radio name="PhoneCallBackDiversionServiceInfo"
property="engagedDiverted" value="true" disabled="true"/>
</logic:equal>
</logic:present>
</td>
<td class="dataText" align="center">
<logic:present name="PhoneCallForwardDiversionServiceInfo"
scope="session">
<html:radio name="PhoneCallForwardDiversionServiceInfo"
property="engagedDiverted" value="true"/> <html:text
name="PhoneCallForwardDiversionServiceInfo" property="engagedDivertedTo"
size="10" maxlength="10"/>
</logic:present>
</td>
<td class="dataText" align="center">
<logic:present name="PhoneCallForwardDiversionServiceInfo"
scope="session">
<bean:write name="PhoneCallForwardDiversionServiceInfo"
property="engagedLastChangeDate"/>
</logic:present>
</td>
<td class="dataText" align="center">
<logic:present name="PhoneCallForwardDiversionServiceInfo"
scope="session">
<bean:write name="PhoneCallForwardDiversionServiceInfo"
property="engagedLastChangeTime"/>
</logic:present>
</td>
<td class="dataText" align="center">
<logic:present name="PhoneCallForwardDiversionServiceInfo"
scope="session">
<bean:write name="PhoneCallForwardDiversionServiceInfo"
property="engagedLastChangeCCR"/>
</logic:present>
</td>
</tr>
a sample out put is attached
<<test1.htm>>
thanks in advance.
Chakradhar Tallam
Consultant Software Engineer
Object Oriented Pty Ltd.,
Level 11 / 75 Miller Street, North Sydney, NSW - 2060
Phone: +61 2 9459 3356 Fax: +61 2 9955 6659
Web: http://www.oopl.com.au/
--
To unsubscribe, e-mail: <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>
--
To unsubscribe, e-mail: <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic