获取值时出现问题,JSF-数据表
我正在使用 JSF 2.0 并尝试使用数据表显示数据列表。获取数据后,每行都有一个按钮,在此按钮上,它必须将一些字段作为输入参数,然后保存它。
<h:dataTable id="dt1" value="#{vendorApp.editQtnList}" var="qList" >
<h:column>
<f:facet name="header">
<h:outputText style=""value="RFQ Number" />
</f:facet>
<h:column>
<f:facet name="header">
<h:outputText value="Vendor Number"/>
</f:facet>
<h:outputText value="#{qList.vendorNumber}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="RFQ Date"/>
</f:facet>
<h:outputText value="#{qList.rfqDate}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value=""/>
</f:facet>
<h:inputText id="adComment" value="#{qList.adminComment}"></h:inputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value=""/>
</f:facet>
<h:form>
<h:commandButton id="rejectBtn" value="Reject" action="#{vendorApp.rejectEditQuotation}">
<f:param name="vendorNum" value="#{qList.vendorNumber}" />
<f:param name="rfqNum" value="#{qList.rfqNumber}" />
<f:param name="adComment" value="#{qList.adminComment}" />
</h:commandButton></h:form> </h:column> </h:dataTable>
在我上面的代码中,editQtnList是列表的getter方法,它提供从数据库获取的列表。现在用户可以通过在提供的文本框中提供注释来单击拒绝,我已经尝试了如图所示的操作,但注释的值不是feteched..需要对此的建议....
I'm using JSF 2.0 and trying to display a list of data using a datatable. After my data is fetched I have button in each row, on this button it has to take some of the fields as input parameters and then save it.
<h:dataTable id="dt1" value="#{vendorApp.editQtnList}" var="qList" >
<h:column>
<f:facet name="header">
<h:outputText style=""value="RFQ Number" />
</f:facet>
<h:column>
<f:facet name="header">
<h:outputText value="Vendor Number"/>
</f:facet>
<h:outputText value="#{qList.vendorNumber}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="RFQ Date"/>
</f:facet>
<h:outputText value="#{qList.rfqDate}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value=""/>
</f:facet>
<h:inputText id="adComment" value="#{qList.adminComment}"></h:inputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value=""/>
</f:facet>
<h:form>
<h:commandButton id="rejectBtn" value="Reject" action="#{vendorApp.rejectEditQuotation}">
<f:param name="vendorNum" value="#{qList.vendorNumber}" />
<f:param name="rfqNum" value="#{qList.rfqNumber}" />
<f:param name="adComment" value="#{qList.adminComment}" />
</h:commandButton></h:form> </h:column> </h:dataTable>
In my above code, editQtnList is the getter method for list which gives a list fetched from database.Now user can click on reject by proving a comment in the text box provided, I have tried this as shown but the value of the comment is not feteched..Need suggestions on this....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所有感兴趣的输入字段必须放置在与提交按钮相同的表单内。
:
重写您的视图如下
All input fields of interest must be placed inside the same form as the submit button.
Rewrite your view as follows:
with