1.input框赋默认选项
var radio_show_1 = $("#set_value_1").val();
$("input[name='radio_show_1'][value="+radio_show_1+"]").attr("checked",true);
form表单中元素的name和实体类的属性名称应该相同,后台直接接收实体类就可以
3.oracle中批量插入数据xml代码
<insert id="insertParameters" parameterType="java.util.List">
INSERT INTO DISPLAYPARA
(DISPLAYPARAID,ORGID, PARAKINDID, PARAMETER)
SELECT seq_displaypara.NEXTVAL DISPLAYPARAID, A.*
FROM(
<foreach collection="list" item="item" index="index" separator="UNION ALL">
SELECT
#{item.orgid,jdbcType=INTEGER} ORGID,
#{item.parakindid,jdbcType=INTEGER} PARAKINDID,
#{item.parameter,jdbcType=VARCHAR} PARAMETER
FROM dual
</foreach>
)A
</insert>
4.oracle中批量更新数据xml代码
<update id="updateSameParameters" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="begin" close="end;" separator=";">
update displaypara
<set>
<if test="item.parameter != null" >
parameter=#{item.parameter,jdbcType=VARCHAR},
</if>
</set>
where orgid = #{item.orgid,jdbcType=INTEGER} and parakindid =#{item.parakindid,jdbcType=INTEGER}
</foreach>
</update>
5.一种提交数据的方法(可以校检某些参数合法性)
<form id="submit" action="${basePath}/other/submitAllPameters.do" method="post">
<input type="button" class="btn btn-primary" οnclick="submitAllInfo();" value="提交">
function submitAllInfo(){
var orgid = ${org.id};
$("#submit").ajaxSubmit({
data: {"orgid": orgid},
success: function () {
alert("设置成功");
parent.zTreeOnDblClick();
},
error: function () {
alert("网络繁忙,请稍后再试");
}
})
}