Reply To: Two cdi beans with the same rewrite @Join

Splash Forums Rewrite Users Two cdi beans with the same rewrite @Join Reply To: Two cdi beans with the same rewrite @Join


Tsobis G

Yes you are correct, I made a mistake.
Basically what I want is too initialize multiple cdi beans from one url.
records-list.jsf is a jsf page with two lists.
A categories list and a records list. Which is simple, however, we want the categories list from a separate cdi bean since it will be used with another jsf file as well.
Categories list + category creation view
Categories list + category update view
Categories list + records list
Categories list + record creation view
I do not want to repeat the code in all cdi beans for these jsf files, since it is not only load of a list but actions as well.
The older version of the app was based on seam 2.2. The solution was simple, we only had to call the action tag multiple times.

<page view-id="/page/products/product-category/products-list.xhtml">
        <rewrite pattern="/products/component/list/category={catid}/sortby={orderby}/page={page}"/>
        <rewrite pattern="/products/component/list"/>
        <param name="orderby" value="#{productsListPaging.orderBy}" required="true"/>
        <param name="page" value="#{productsListPaging.currentPage}" converterId="javax.faces.Integer" required="true"/>
        <param name="catid" value="#{productsListPaging.categoryId}" converterId="javax.faces.Long" required="true"/>
        <action execute="#{productsListPaging.init}"/>
        <param name="catid" value="#{categoriesPaging.categoryId}" converterId="javax.faces.Long" required="true"/>
        <action execute="#{categoriesPaging.init}"/>