This content has been marked as final.
Show 4 replies
-
1. Re: Component Binding to conversation does not work
jameswoodward Mar 22, 2006 10:12 AM (in response to scraatz)I've found a way around this.
In my CONVERSATION scoped component I inject an EVENT scoped component, which handles the binding.
So my conversation component looks something like:@Stateful @Name("cart") @Interceptors(SeamInterceptor.class) public class ShoppingCartBean implements ShoppingCart, Serializable { ... @In(value="cartTable", create=true) private transient TableBinding table; ... }
And my event component looks something like:@Name("cartTable") @Scope(ScopeType.EVENT) public class ShoppingCartTableBinding extends TableBinding { }
Just for completeness, my TableBinding class is used to bind to a ADF Faces Table component:public abstract class TableBinding { private UIXTable table; public UIXTable getBinding() { return table; } public void setBinding(UIXTable table) { this.table = table; } public List getSelectedRows() { List selectedRows = new ArrayList(); Object oldKey = table.getRowKey(); Set<String> selectedKeys = table.getSelectionState().getKeySet(); for (String rowKey : selectedKeys) { table.setRowKey(rowKey); selectedRows.add(table.getRowData()); } table.setRowKey(oldKey); return selectedRows; } public void clearSelection() { table.getSelectionState().clear(); } }
And my JSF page looks something like:... <af:table binding="#{cartTable.binding}" ...> ...
-
2. Re: Component Binding to conversation does not work
gavin.king Mar 22, 2006 4:36 PM (in response to scraatz)The Conversation context is not available during the restore view phase. Hence the problem ;)
-
3. Re: Component Binding to conversation does not work
scraatz Mar 23, 2006 8:53 AM (in response to scraatz)Gavin,
is this by design or will it be fixed in later versions? -
4. Re: Component Binding to conversation does not work
gavin.king Mar 23, 2006 5:37 PM (in response to scraatz)it is unavoidable