You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "R. Müller" <r....@unicomp-berlin.de> on 2005/12/08 10:33:12 UTC

Re: init backing bean on page request [solved]

I found a feasible (but not nice) solution for this using <t:aliasBean> 
and  <t:aliasBeanScope>. i think it is quite similiar to wiki-examples:

faces-config.xml

<managed-bean>
	<managed-bean-name>list00</managed-bean-name>
	<managed-bean-class>ItemList</managed-bean-class>
	<managed-bean-scope>request</managed-bean-scope>
	<managed-property>
     		<property-name>msgPerPage</property-name>
	    	<value>10</value>
	</managed-property>
</managed-bean>

<managed-bean>
	<managed-bean-name>list01</managed-bean-name>
	<managed-bean-class>ItemList</managed-bean-class>
	<managed-bean-scope>request</managed-bean-scope>
	<managed-property>
     		<property-name>msgPerPage</property-name>
		<value>20</value>
	</managed-property>
</managed-bean>

page1.jsp

<t:aliasBeansScope>
<t:aliasBean alias="#{list}" value="#{list00}"/>
	<jsp:include page="/list.jsp" />
</t:aliasBeansScope>


page2.jsp

<t:aliasBeansScope>
<t:aliasBean alias="#{list}" value="#{list01}"/>
	<jsp:include page="/list.jsp" />
</t:aliasBeansScope>


list.jsp

[...]

<t:datatable value="#{list.itemList}" .... >
	[...]
</t:datatable>




R. Müller wrote:
> hi group,
> 
> i have backing bean, which provides data for datatable.
> i want display this table on two different pages with different 
> properties; in my case just different count of rows.
> how can i initialize the backing bean depending on the requested page 
> i.e. just setting some values.
> is something possible like JSTLs <c:set ... /> ?
> 
> regards
> 
> ronald
>