从另一列的验证器中的ice:dataTable获取列值
我的ice:dataTable如下所示:-
<ice:dataTable id="someTbl" var="someVar" value="#{someBean.someList}" >
<ice:column>
<f:facet name="header"> <ice:outputText value="#{msgs.tblCol1}"> </f:facet>
<ice:outputText value="#{someVar.name}"/>
</ice:column>
<ice:column>
<f:facet name="header"> <ice:outputText value="#{msgs.tblCol2}"> </f:facet>
<ice:selectInputDate id="startCal" value="#{someVar.startTime}"
renderAsPopup="true" renderYearAsDropdown="true"
renderMonthAsDropdown="true" partialSubmit="true" >
<f:convertDateTime pattern="MM/dd/yyyy HH:mm" type="date" timeZone="EST"/>
</ice:selectInputDate>
</ice:column>
<ice:column>
<f:facet name="header"> <ice:outputText value="#{msgs.tblCol3}"> </f:facet>
<ice:selectInputDate id="endCal" value="#{someVar.endTime}"
renderAsPopup="true" renderYearAsDropdown="true"
renderMonthAsDropdown="true" partialSubmit="true" validator="#{someBean.validateEndtime}">
<f:convertDateTime pattern="MM/dd/yyyy HH:mm" type="date" timeZone="EST"/>
</ice:selectInputDate>
</ice:column>
</ice:dataTable>
当调用该行上的第二个日历(id“endCal”)上的验证器时,我想获取我的支持中该行上的第一个日历(id“startCal”)的值豆。有办法实现吗?我想知道ice:rowSelector,但我注意到我只能获取所选内容的rowId,这意味着我必须遍历验证器方法中的“someBean.someList”才能找到该条目的值。
My ice:dataTable looks like below:-
<ice:dataTable id="someTbl" var="someVar" value="#{someBean.someList}" >
<ice:column>
<f:facet name="header"> <ice:outputText value="#{msgs.tblCol1}"> </f:facet>
<ice:outputText value="#{someVar.name}"/>
</ice:column>
<ice:column>
<f:facet name="header"> <ice:outputText value="#{msgs.tblCol2}"> </f:facet>
<ice:selectInputDate id="startCal" value="#{someVar.startTime}"
renderAsPopup="true" renderYearAsDropdown="true"
renderMonthAsDropdown="true" partialSubmit="true" >
<f:convertDateTime pattern="MM/dd/yyyy HH:mm" type="date" timeZone="EST"/>
</ice:selectInputDate>
</ice:column>
<ice:column>
<f:facet name="header"> <ice:outputText value="#{msgs.tblCol3}"> </f:facet>
<ice:selectInputDate id="endCal" value="#{someVar.endTime}"
renderAsPopup="true" renderYearAsDropdown="true"
renderMonthAsDropdown="true" partialSubmit="true" validator="#{someBean.validateEndtime}">
<f:convertDateTime pattern="MM/dd/yyyy HH:mm" type="date" timeZone="EST"/>
</ice:selectInputDate>
</ice:column>
</ice:dataTable>
When the validator on the second calendar (id "endCal") on the row is invoked, I want to get the value of the first calendar (id "startCal") on that row in my backing bean. Is there a way to accomplish that? I was wondering about ice:rowSelector but I noticed I can only get the rowId of the selected which means I will have to traverse through the "someBean.someList" in the validator method to find the values for that entry.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先将第一个输入绑定到 bean:
使用此属性:
然后,在您的
SomeBean#validateEndtime()
方法中执行以下操作:First bind the first input to bean:
with this property:
Then, in your
SomeBean#validateEndtime()
method do: