myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R. Müller" <r.muel...@unicomp-berlin.de>
Subject Re: init backing bean on page request [solved]
Date Thu, 08 Dec 2005 09:33:12 GMT
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
> 


Mime
View raw message