开发者

How to read the table variable from a backing bean in JSF?

开发者 https://www.devze.com 2022-12-09 19:34 出处:网络
I am using MyFaces Trinidad, and want to create a single page where selection in one table reloads the content of another table to match the selection.

I am using MyFaces Trinidad, and want to create a single page where selection in one table reloads the content of another table to match the selection.

The update is triggered by an actionListener in a partialSubmit. Then I wanted the listener in the backing bean to remember the row object of the submit, such that the getter for the value of the second table can use this as a filter.

The Trinidad documentation includes this sample, but this syntax is depreca开发者_StackOverflow中文版ted in JSF 1.2:

FacesContext context = FacesContext.getCurrentInstance();
MyClass selection = (MyClass)context.getVariableResolver().
    resolveVariable(context, "rowdata");

Anybody got a good suggestion?


The JSF 1.2 way is using ELResolver. Also see the deprecation notes in the javadoc of VariableResolver. A more common JSF 1.2 alternative is the Application#evaluateExpressionGet(). Code examples can be found here.


You may find this post helpful: http://ocpsoft.com/java/jsf-java/jsfs-hdatatable-vs-uirepeat-how-to-get-the-selected-row/

0

精彩评论

暂无评论...
验证码 换一张
取 消