フレームワークStrutsをいじくり倒す人の為のスレ
■ このスレッドは過去ログ倉庫に格納されています
0854nobodyさん
2005/04/06(水) 22:39:30ID:???> ActionFormは以下のようになっています。
> public class TestForm extends ActionForm {
> private String[] checkList = new String[128]
> public String getCheckList(int index) {return this.checkList[index];}
↑public boolean getCheckList(int index) {return this.checkList[index].equals("true");}
> public void setCheckList(int index, String str){this.checkListGroup[index] = str;}
↑public void setCheckList(int index, boolean bool) { this.checkList[index] = bool ? "true":"false";}
> public void reset(ActionMapping map, HttpServletRequest req){
> for (int i = 0; i < this.checkList.length; i++){
> setCheckList(i,null);
↑は、setCheckList(i, "false");
> }
> }
> }
>
> checkbox部分JSPは以下のようになっています。
> <logic:iterate id="id" name="ArrayListObject" scope="session" indexId="idx">
> <%-- id(ArrayListObjectの要素)はString型の値です --%>
> <html:checkbox property='<%="checkList[" + idx + "]"%>' value="<%=id%>"/>
> </logic:iterate>
>
とすれば、value="true" or value="false"になっていいんでね?
■ このスレッドは過去ログ倉庫に格納されています