You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by kiuma <ki...@usa.net> on 2002/10/19 17:57:59 UTC

Re: multibox, checkbox PROBLEM FOUND, SOLUTION NOT!!!

Ok suppose to have a Form with a checkbox named "isOn" and a submit 
button name "Save"

a NOT checked value will produce:
http://localhost:8080/webappointments/openChk.do?action=Save

a checked value will produce:
http://localhost:8080/webappointments/openChk.do?isOn=on&action=Save

The problem is that if I have a checked value that I want to turn off 
I'll send
http://localhost:8080/webappointments/openChk.do?action=Save
the form function
    public void setIsOn( boolean isOn )
    {       
        this.isOn = isOn;
    }  
is not called and the value will not be changed.

Where am I wrong ??



kiuma wrote:

> Hello agaaain,
> My checkboxes both multi and normal don't suppo all empty values.
> I.e. I can transmit a checked empty value, but I can't all empty values:
> I REALLY don't know what to do ... ppppleease!
>
> --useredit_center.jsp--
>
> <%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> <%@taglib uri="/WEB-INF/c.tld" prefix="c" %>
>
>              <c:set var='jspPrincipalId' 
> value='${sessionScope.userEditForm.principalId}'/>              <c:set 
> var="jspAllGroups" value="${sessionScope.userEditForm.allGroups}"/>     
>        <html:form action="/userPostChanges">                       
>            <table class='edit' cellpadding="0" cellspacing='0'>
>                <tbody>
>                    <tr>
>                        <c:if test="${jspPrincipalId != null}">       
>                            <td><bean:message key="label.login"/></td>
>                            <td>
>                                <c:out value="${jspPrincipalId}"/>
>                                <html:hidden property="principalId"/>
>                            </td>
>                        </c:if>
>                        <c:if test="${jspPrincipalId == null}">       
>                            <td><bean:message key="label.login"/></td>
>                            <td width='100%'>
>                                <html:text property="principalId" 
> size="50" maxlength="255"/>
>                            </td>
>                        </c:if>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.passwd1"/></td>
>                        <td width='100%'>
>                            <html:password property="passwd1" size="50" 
> maxlength="255"/>
>                        </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.passwd2"/></td>
>                        <td width='100%'>
>                            <html:password property="passwd2" size="50" 
> maxlength="255"/>
>                        </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.surname"/></td>
>                        <td width='100%'>
>                            <html:text property="name1" size="50" 
> maxlength="255"/>
>                        </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.name"/></td>
>
>                        <td width='100%'>
>                            <html:text property="name2" size="50" 
> maxlength="255"/>                                     </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.cf"/></td>
>                        <td width='100%'>
>                            <html:text property="cf" size="50" 
> maxlength="16"/>                                      </td>
>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.piva"/></td>
>                        <td width='100%'>
>                            <html:text property="piva" size="50" 
> maxlength="13"/>                                   </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.address"/></td>
>                        <td width='100%'>
>                            <html:text property="address" size="50" 
> maxlength="255"/>                                      </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.zip"/></td>
>                        <td width='100%'>
>                            <html:text property="zip" size="50" 
> maxlength="10"/>                                      </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.city"/></td>
>                        <td width='100%'>       
>                            <html:text property="city" size="50" 
> maxlength="255"/>                                  </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.state"/></td>
>                        <td width='100%'>
>                            <html:text property="state" size="50" 
> maxlength="255"/>                                  </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.country"/></td>
>                        <td width='100%'>
>                            <html:text property="country" size="50" 
> maxlength="255"/>                                      </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.phone"/></td>
>                        <td width='100%'>
>                            <html:text property="tel" size="50" 
> maxlength="255"/>                                      </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.mailaddress"/></td>
>                        <td width='100%'>
>                            <html:text property="mail"  size="50" 
> maxlength="255"/>                                      </td>
>                    </tr>
>                    <tr>
>                        <td><bean:message key="label.website"/></td>
>                        <td width='100%'>
>                            <html:text property="web" size="50" 
> maxlength="255"/>                                      </td>
>                    </tr>                     <tr>
>                        <td/>
>                        <td>&nbsp;</td>
>                    </tr>
>                    <tr>                           
>                        <td colspan='2'>
>                            <table class='bordered' bgcolor='#ccaaff'>
>                                <tbody>
>                                    <c:if test="${jspAllGroups != 
> null}">                                          <c:forEach 
> items="${jspAllGroups}" 
> var="permission">                                       
>                                            <tr>
>                                                <td align='left'>
>                                                    <html:multibox 
> property="principalPermissions">
>                                                        <c:out 
> value='${permission}'/>
>                                                    </html:multibox>
>                                                    <c:out 
> value='${permission}'/>
>                                                </td>
>                                            
> </tr>                                       
>                                        </c:forEach>
>                                    </c:if>
>                                    <tr><td>
>                                        &nbsp;
>                                    </td></tr>
>                                    <tr><td align='left'>
>                                        <html:checkbox 
> property="userEnabled"/><bean:message 
> key="label.user.enabled"/>                                       
>                                    </td></tr>
>                                </tbody>
>                            </table>                       
>                        </td>
>                    </tr>
>                    <tr>
>                        <td colspan='2'>
>                            <br/>
>                            <html:submit>
>                                <bean:message key="button.confirm"/>
>                            </html:submit>       
>                            <html:reset>
>                                <bean:message key="button.reset"/>
>                            </html:reset>
>                        </td>
>                    </tr>                                     
>                </tbody>
>            </table>                  </html:form>
>
>
> For example if I deselect all principalPermissions no changes appear!!
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
> .
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>