[SEAM] 焦点移失事件的问题
无双Rama
2009-05-21
我想要实现一个功能:
在inputText 里面输入内容后,当光标转移到其它地方后,后面有四个inputText会通过前面输入的值去查询,然后在这四个地方显示出来。 我是这样写的: 1.页面 <h:panelGrid columns="2"> <h:outputLabel value="*薪資年月:" /> <h:inputText value="#{cycleSalaryCalculationBusiness.salaryYearMonth}" id="salaYandM"> <a4j:support event="onblur" reRender="alldate" /> </h:inputText> </h:panelGrid> <a4j:outputPanel id="alldate"> <h:panelGrid columns="4" > <h:outputLabel value="薪資周期:" /> <h:inputText value="#{cycleSalaryCalculationBusiness.salaryAndAttendance.payStartDate}" disabled="true" /> <h:outputText value="~" /> <h:inputText value="#{cycleSalaryCalculationBusiness.salaryAndAttendance.payEndDate}" disabled="true" /> <h:outputLabel value="考勤周期:" /> <h:inputText value="#{cycleSalaryCalculationBusiness.salaryAndAttendance.attendanceStartDate}" disabled="true" /> <h:outputText value="~" /> <h:inputText value="#{cycleSalaryCalculationBusiness.salaryAndAttendance.attendanceEndDate}" disabled="true" /> </h:panelGrid> </a4j:outputPanel> 后台: @Name("cycleSalaryCalculationBusiness") public class CycleSalaryCalculationBusiness { @In(value = "entityManager") EntityManager em; private String salaryYearMonth; // 薪資年月 public String getSalaryYearMonth() { return salaryYearMonth; } public void setSalaryYearMonth(String salaryYearMonth) { this.salaryYearMonth = salaryYearMonth; } private boolean ifcycle = true; public PayCycle salaryCyclyAndAttendance() { System.out.print(salaryYearMonth); if (this.salaryYearMonth != null) { PayCycle datelist = (PayCycle) em.createQuery( "select pa from PayCycle pa where pa.id=:id").setParameter( "id", salaryYearMonth).getSingleResult(); return datelist; } return null; } 可是我运行后,在输入框里面输入值,转移光标没有效果,当我点击某个<h:commandButton />后它才会达到预期效果(此后就不需要再点击按钮) 我该怎么解决这个问题呢? |
|
无双Rama
2009-05-21
自己up up。。。
最近发现上来提问的人好少啊~~~~似乎seam圈子没有以前活跃了,大家加油啊!! |
|
无双Rama
2009-05-22
想不到今天它自己又好了。。。。郁闷啊,浪费我那么多时间
|