wh0*_*wh0 2 struts2 struts-tags
我试图在Struts2标签中使用HTML的自定义数据属性,这是我的示例代码
<s:select list="myList" listKey="myListVal" listValue="myListDesc" data-inputs="myListInput" ></s:select>
Run Code Online (Sandbox Code Playgroud)
我期待这样的事情
<select >
<option value="myListVal1" data-inputs="myListInput1">myListDesc1</option>
<option value="myListVal2" data-inputs="myListInput2">myListDesc2</option>
<option value="myListVal3" data-inputs="myListInput3">myListDesc3</option>
</select>
Run Code Online (Sandbox Code Playgroud)
相反,我得到了这个
<select data-inputs="myListInput" >
<option value="myListVal1" >myListDesc1</option>
<option value="myListVal2" >myListDesc2</option>
<option value="myListVal3" >myListDesc3</option>
</select>
Run Code Online (Sandbox Code Playgroud)
是否可以在其中的选项的struts select标签中描述data-attribute.
覆盖<s:select>标记模板.或者只使用HTML标签<s:iterator>
<select name="list">
<s:iterator value="myList" status="stat">
<option value="<s:property value="myListVal"/>" data-inputs="myListInput<s:property value="#stat.index"/>"><s:property value="myListDesc"/></option>
</s:iterator>
</select>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8048 次 |
| 最近记录: |