Hi,
i am trying to use an af:table with multiple selection. For this I need access to the underlying table.
When I bind the af:table with binding="#{sampleSelectFlow.organTable}" to my bean via property getter and setter I get an exception if the Scope is not EVENT.
How do I do this correctly? I tried also @In(required=false) @Out(required=false) but then I got an NPE when trying to access the table (seems like they were not injected)
thank you very much for your answers
ido
my bean looks like this:
@Stateful @Name("sampleSelectFlow") @Scope(ScopeType.CONVERSATION) @Interceptors(SeamInterceptor.class) @Conversational(ifNotBegunOutcome="end") public class SampleSelectFlow implements SampleSelect { UIXTable organTable; @DataModel private List<Organ> organList; @DataModelSelection(value="organList") private Organ organ; @PersistenceContext private EntityManager em; @Begin(join=true) @Factory("organList") public void loadOrganList(){ organList = em.... } public void filterOrgan(){ //dosomething: organTable.getSelectionState().getKeySet(); ..... } @Destroy @Remove public void remove() {} public UIXTable getOrganTable() { return organTable; } public void setOrganTable(UIXTable organTable) { this.organTable = organTable; } }
<af:form> <af:table binding="#{sampleSelectFlow.organTable}" emptyText="nothing there" var="organ" value="#{organList}"> <f:facet name="selection"> <af:tableSelectMany text="Filter Sample"> <af:commandButton text="Filter" action="#{sampleSelectFlow.filterOrgan}"> <!--f:param name="conversationId" value="new"/--> </af:commandButton> </af:tableSelectMany> </f:facet> <af:column headerText="Organ" sortProperty="organname" sortable="false"> <af:outputText value="#{organ.organname}" /> </af:column> </af:table> </af:form>