Java 如何在Struts 1中显示一周中每天有3个约会的表
在Struts1中,我试图显示一周中每天的3个约会 每天的每个约会都有一个“from”和“to”文本框,用户必须在其中输入时间。 每天都有一个复选框,单击该复选框可启用该特定日期的约会即启用3个约会,即6个文本框 问题: 我不知道如何用java编写DTO并在JSP页面上编写循环以显示此结构。我想每个文本框都需要一个不同的名称,这样我就可以单独访问它们并启用或禁用它们 请帮帮我 我正在使用列表来显示此结构。 下表如下:Java 如何在Struts 1中显示一周中每天有3个约会的表,java,jsp,struts-1,Java,Jsp,Struts 1,在Struts1中,我试图显示一周中每天的3个约会 每天的每个约会都有一个“from”和“to”文本框,用户必须在其中输入时间。 每天都有一个复选框,单击该复选框可启用该特定日期的约会即启用3个约会,即6个文本框 问题: 我不知道如何用java编写DTO并在JSP页面上编写循环以显示此结构。我想每个文本框都需要一个不同的名称,这样我就可以单独访问它们并启用或禁用它们 请帮帮我 我正在使用列表来显示此结构。 下表如下: <table border="0" width="50%"> &l
<table border="0" width="50%">
<tr><div class="alt_tab_color" align="center">Hours:</div></tr>
<tr class="alt_tab_color">
<td>Day</td>
<td>APP1(HH:MM)</td>
<td>APP2(HH:MM)</td>
<td>(HH:MM)</td>
</tr>
<tr><td></td>
<td> from To</td>
<td> from To</td>
<td> from To</td></tr>
<logic:notEmpty name="abcForm" property="daysListForm.daysList">
<logic:iterate id="subForm" name="orderSummaryForm" property="daysListForm.daysList">
<tr>
<td>
<table>
<tr>
<td class="normal_txt"><bean:write property="dayName" name="subForm"></bean:write></td>
<td><html:checkbox name="abcForm" property="daysListForm.dayEuFlag" /></td>
</tr>
</table>
</td><logic:iterate id="subForm1" name="abcForm" property="appointmentListForm.appointmentList" ><td>
<table>
<tr>
<td> </td>
<td><html:text property="from" name="subForm1" disabled="true"></html:text></td>
<td><html:text property="to" name="subForm1" disabled="true"></html:text></tr>
</table>
</td></logic:iterate></tr></logic:iterate></logic:notEmpty></table>
我在这里向他们介绍:
public List populateDays(AppointmentListForm ftInfoListForm) {
List<DaysForm> noteLists= new ArrayList();
DaysForm mon = new DaysForm();DaysForm tue = new DaysForm();DaysForm wed = new DaysForm();
DaysForm thu = new DaysForm();DaysForm fri = new DaysForm();DaysForm sat = new DaysForm();
DaysForm sun = new DaysForm();
mon.setDayName("Mon");tue.setDayName("Tue");wed.setDayName("Wed");
thu.setDayName("Thu");fri.setDayName("Fri");sat.setDayName("Sat");
sun.setDayName("Sun");
noteLists.add(mon);noteLists.add(tue);noteLists.add(wed);
noteLists.add(thu);noteLists.add(fri);noteLists.add(sat);
noteLists.add(sun);
mon.setAppointmentListForm(ftInfoListForm);tue.setAppointmentListForm(ftInfoListForm);wed.setAppointmentListForm(ftInfoListForm);
thu.setAppointmentListForm(ftInfoListForm);fri.setAppointmentListForm(ftInfoListForm);sat.setAppointmentListForm(ftInfoListForm);
sun.setAppointmentListForm(ftInfoListForm);
return noteLists;
}
public List populateFromTo(){
List<FromToInfoForm> noteLists= new ArrayList();
FromToInfoForm app1 = new FromToInfoForm(); FromToInfoForm app2 = new FromToInfoForm(); FromToInfoForm app3 = new FromToInfoForm();
noteLists.add(app1);noteLists.add(app2);noteLists.add(app3);
return noteLists;
}
嗨,欢迎来到Stack Overflow。我想。。这不是一个很好的发帖方式。您能告诉我们您尝试了什么,相关代码和您遇到的具体问题吗。请仔细阅读并看看这里的图片。然后回答你的问题,并提供所有必要的细节。或者,如果你想让别人为你做这件事,也有一些自由职业者网站,你可以在那里给别人一个公平的价格。我试图用列表来实现它,但问题是每个约会文本框都有相同的名字,因此,每当我点击一个复选框时,所有“from”文本框都会被启用/禁用。您可以编辑问题并添加相关代码,以及您得到的具体错误。我看不到你的代码、程序、屏幕、错误、输入、输出或其他任何东西。我已经添加了代码。请帮帮我。我不知道如何继续前进,也不知道要对代码做什么更改
public List populateDays(AppointmentListForm ftInfoListForm) {
List<DaysForm> noteLists= new ArrayList();
DaysForm mon = new DaysForm();DaysForm tue = new DaysForm();DaysForm wed = new DaysForm();
DaysForm thu = new DaysForm();DaysForm fri = new DaysForm();DaysForm sat = new DaysForm();
DaysForm sun = new DaysForm();
mon.setDayName("Mon");tue.setDayName("Tue");wed.setDayName("Wed");
thu.setDayName("Thu");fri.setDayName("Fri");sat.setDayName("Sat");
sun.setDayName("Sun");
noteLists.add(mon);noteLists.add(tue);noteLists.add(wed);
noteLists.add(thu);noteLists.add(fri);noteLists.add(sat);
noteLists.add(sun);
mon.setAppointmentListForm(ftInfoListForm);tue.setAppointmentListForm(ftInfoListForm);wed.setAppointmentListForm(ftInfoListForm);
thu.setAppointmentListForm(ftInfoListForm);fri.setAppointmentListForm(ftInfoListForm);sat.setAppointmentListForm(ftInfoListForm);
sun.setAppointmentListForm(ftInfoListForm);
return noteLists;
}
public List populateFromTo(){
List<FromToInfoForm> noteLists= new ArrayList();
FromToInfoForm app1 = new FromToInfoForm(); FromToInfoForm app2 = new FromToInfoForm(); FromToInfoForm app3 = new FromToInfoForm();
noteLists.add(app1);noteLists.add(app2);noteLists.add(app3);
return noteLists;
}