从rich:datatable绑定表获取行 [英] get row from rich:datatable binding table

查看:134
本文介绍了从rich:datatable绑定表获取行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用java 6 jsf 1.2和richfaces 3.3.3
当我在Binded UIDataTable上调用函数getRowData

  public void priorityChanged(ValueChangeEvent event){
任务currentTask =(Task)table.getRowData();

 < h:selectOneMenu id =id182 _#{rkv}value =#{dataItem.priority}
valueChangeListener =#{customerAdminHandler.priorityChanged}
onchange =submit ()>
< f:selectItems value =#{customerAdminHandler.priorityTypes}/>
< / h:selectOneMenu>

我在table.getRowData()上收到异常。

  java.lang.IllegalArgumentException 
在javax.faces.model.ListDataModel.getRowData(ListDataModel.java:150)
在org.ajax4jsf.model.SequenceDataModel.getRowData(SequenceDataModel.java:147)
在org.ajax4jsf.component.UIDataAdaptorBase.getRowData(UIDataAdaptorBase.java:257)


解决方案

我绕过了这个问题,使用

 < f:setPropertyActionListener value =#{dataItem}
target =#{customerProductsHandler.currentApp}/>

而不是绑定表。
相同的代码在干净的环境中为我工作,所以我想有一些jar问题。



无论如何,为了将来参考我发现以下信息有用的使用绑定表

  Richfaces 3.3使用:
org.richfaces.component.html.HtmlDataTable

Richfaces 4使用:
org.richfaces.component.UIDataTable

jsf1.2使用:
javax.faces.component.html.HtmlDataTable;

jsf 2使用:
import javax.faces.model.DataModel;


I am using java 6 jsf 1.2 and richfaces 3.3.3 When I call the function getRowData on the Binded UIDataTable

public void priorityChanged(ValueChangeEvent event) {
        Task currentTask = (Task) table.getRowData();

with

<h:selectOneMenu id="id182_#{rkv}" value="#{dataItem.priority}"
    valueChangeListener="#{customerAdminHandler.priorityChanged}"
    onchange="submit()">
    <f:selectItems value="#{customerAdminHandler.priorityTypes}" />
</h:selectOneMenu>

i get an exception on the table.getRowData();

java.lang.IllegalArgumentException
    at javax.faces.model.ListDataModel.getRowData(ListDataModel.java:150)
    at org.ajax4jsf.model.SequenceDataModel.getRowData(SequenceDataModel.java:147)
    at org.ajax4jsf.component.UIDataAdaptorBase.getRowData(UIDataAdaptorBase.java:257)

解决方案

I bypassed the problem by using

<f:setPropertyActionListener value="#{dataItem}"
                            target="#{customerProductsHandler.currentApp}" />

instead of a binding table. the same code worked for me on a clean environment so i guess there is some sort of jar problem.

anyway , for future reference I found the following information usefull for using a binding table

Richfaces 3.3 uses:
org.richfaces.component.html.HtmlDataTable

Richfaces 4  uses:
org.richfaces.component.UIDataTable

jsf1.2  uses:
javax.faces.component.html.HtmlDataTable;

jsf 2  uses:
import javax.faces.model.DataModel;

这篇关于从rich:datatable绑定表获取行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆