struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Struts Two <>
Subject [S2] Checkbox problem
Date Wed, 20 Aug 2008 20:02:34 GMT
I have a checkbox as follows in a jsp:
<s:checkbox theme="simple" name="ticket.ccUpdateFlag" id="ticket.ccUpdateFlag" />
Once a user selects the checkbox and submits the form,  ccUpdateFlag is set to true. However,
on the database side the value is stored as 'Y' or 'N' . So my getCcUpdateFlag returns 'Y'
or 'N' depending on the fact ccUpdateFlag is set to true or false.
Now on a different page (say update/vie page), I have the same exact check box. I have been
trying to map 'Y' to "fieldValue=true" unsuccessfully so far. I have tried the followings:
<s:checkbox theme="simple" name="ticket.ccUpdateFlag" id="ticket.ccUpdateFlag" <s:if
test="ticket.ccUpdateFlag='Y'">filedValue="true"</s:if>  />
This breaks the page and the page does not even compile, I get  invalid jsp exception..
I then went to my bean and added the following method:
 public boolean isCCUpate(){
  return "Y".equals(getCcUpdateFlag());
I then tried to use the following:
<s:checkbox theme="simple" name="ticket.ccUpdateFlag" id="ticket.ccUpdateFlag" fieldValue="<s:property
value='ticket.CCUpate'/>" />
This would also fail, looking at generated html, here is what is generated:
<input type="checkbox" name="ticket.ccUpdateFlag" value="&lt;s:property value='ticket.CCUpate'/&gt;"
<input type="hidden" name="__checkbox_ticket.ccUpdateFlag" value="&lt;s:property value='ticket.CCUpate'/&gt;"
Is there a way that I can have checkbox fieldValue="true" if  "ticket.ccUpdateflag == 'Y'.

Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! Canada Messenger

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message