当前位置:编程学习 > JAVA >>

spring的jsp标签<form:select>如何设置属性出现复选框


<form:select path="synchroDtoObjects" id="synchroDtoObjects" cssClass="selectTo {required:true}"   multiple="multiple" maxlength="3">
<c:forEach items="${syschrodataEntityList}" var="item">
<form:option value="${item.key}">${item.value}</form:option>
</c:forEach>
</form:select>
代码如上:我设置multiple=“multiple”怎么不会出现多选啊 --------------------编程问答-------------------- <form:checkbox --------------------编程问答-------------------- 或者multiple="multiple" 改为multiple="true" --------------------编程问答--------------------
引用 2 楼 fangmingshijie 的回复:
或者multiple="multiple" 改为multiple="true"

按照你说的方法搞不定啊 --------------------编程问答-------------------- <form:select这个是spring的,你导入spring的ltd文件没有 --------------------编程问答-------------------- <%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<div id="iframeContainer">
<form:form id="synchrodataForm" commandName="synchroDataRecord"  class="form-horizontal" >
   <fieldset class="form-label8">
      <legend class='blue'>
          <fmt:message key="synchrodata.update" />
      </legend>
   <input type="hidden" name="method" id="method"  value="${param.method }" />
     <div class="control-group">
        <appfuse:label styleClass="control-label"  key="synchrodata.objects" />
            <div class="controls docs-input-sizes">
               <form:select path="synchroDtoObjects" id="synchroDtoObjects" cssClass="selectTo                  {required:true}"  ismultiple="true" isExactMatch="true"  isAutoComplate="true" >
                   <form:options items="${syschrodataEntityList}"/> </form:select>
             </div>
     </div>
       <div class="l-dialog-buttons" style="font-size: 12px;">
            <div class="l-dialog-Leftbtn-inner">
                <div class="l-dialog-btn isdialogbtn" tabindex="0" onclick="synchroDataClick()">
                     <div class="l-dialog-btn-l"></div>
     <div class="l-dialog-btn-r"></div>
                     <div class="l-dialog-btn-inner">
<fmt:message key="button.sure" />
                                        </div>
</div>
                      <div class="l-clear"></div>
</div>
</div>
    </fieldset>
</form:form>
</div>

<script type="text/javascript">
function synchroDataClick(){
 $.ajax({
            url:'/urc/auth/synchrodatas_iframe_synchroData.html',
            type:"POST",
            data:{
             "synchroDtoObjects":$("#synchroDtoObjects").val()
             },
            contentType:"application/x-www-form-urlencoded;charset=utf-8",
            success:function (data) {
             var ResponseMsg=$.parseJSON(data);
             var returnInfo = $.parseJSON(ResponseMsg.message).returnInfo;
              if (returnInfo && returnInfo.returnCode == "1"){
              $.ligerDialog.error(returnInfo.returnMessage);
             }else{
              $.ligerDialog.success(returnInfo.returnMessage);
             }
            }
}); 
}
</script>

这个是我jsp页面的代码,下列列表只能单选,实现不了复选 --------------------编程问答--------------------

<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<div id="iframeContainer">
<form:form id="synchrodataForm" commandName="synchroDataRecord"  class="form-horizontal" >
<fieldset class="form-label8">
<legend class='blue'>
<fmt:message key="synchrodata.update" />
</legend>
<input type="hidden" name="method" id="method"  value="${param.method }" />
<div class="control-group">
<appfuse:label styleClass="control-label"
key="synchrodata.objects" />
<div class="controls docs-input-sizes">
<form:select path="synchroDtoObjects" id="synchroDtoObjects" cssClass="selectTo {required:true}"  ismultiple="true" isExactMatch="true"  isAutoComplate="true" >
<form:options items="${syschrodataEntityList}"/>
</form:select>
</div>
</div>
 <div class="l-dialog-buttons" style="font-size: 12px;">
<div class="l-dialog-Leftbtn-inner">
<div class="l-dialog-btn isdialogbtn" tabindex="0" onclick="synchroDataClick()">
<div class="l-dialog-btn-l"></div>
<div class="l-dialog-btn-r"></div>
<div class="l-dialog-btn-inner">
<fmt:message key="button.sure" />
</div>
</div>
<div class="l-clear"></div>
</div>
</div>
</fieldset>
</form:form>
</div>

<script type="text/javascript">
function synchroDataClick(){
 $.ajax({
            url:'/urc/auth/synchrodatas_iframe_synchroData.html',
            type:"POST",
            data:{
             "synchroDtoObjects":$("#synchroDtoObjects").val()
             },
            contentType:"application/x-www-form-urlencoded;charset=utf-8",
            success:function (data) {
             var ResponseMsg=$.parseJSON(data);
             var returnInfo = $.parseJSON(ResponseMsg.message).returnInfo;
              if (returnInfo && returnInfo.returnCode == "1"){
              $.ligerDialog.error(returnInfo.returnMessage);
             }else{
              $.ligerDialog.success(returnInfo.returnMessage);
             }
            }
}); 
}
</script> --------------------编程问答-------------------- 不对不对,应该是<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> --------------------编程问答--------------------
引用 7 楼 fangmingshijie 的回复:
不对不对,应该是<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

额 不好意思 点错了(

不过还是没搞定啊 --------------------编程问答-------------------- 清理下缓存再试看 --------------------编程问答--------------------
引用 9 楼 fangmingshijie 的回复:
清理下缓存再试看

已经解决  --------------------编程问答-------------------- 怎么解决的啊  求指点  1016692601 --------------------编程问答-------------------- 你能分享一下你的解决方法吗?
补充:Java ,  Web 开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,