You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by stephan opitz <st...@gmail.com> on 2006/07/29 18:36:29 UTC

prepare data for (myfaces) datalist...

eg. in myfaces i tried to adopt the pagedSortTable to clay and shale...
in teh example there the data is prepared in the constructor...

i thought ok: as i learned in registration from mailreader...
while canging sides in my application: call a method and fill the bean
which will be called next...

PagedSortableCarList pagedSort= (PagedSortableCarList) getBean("pagedSort");

the fill it:

for (int i = 100; i < 200; i++)
{
	Object car = new SimpleCar(i, "Car Type " + i, (i % 2 == 0) ? "blue"
: "green");
	pagedSort.getCars().add(car);
}

throws null pointer - cannot add an element to the list :-/

PagedSortableCarList.java
SimpleCar.java
SortableList.java
these three files needed to built up the paged example list...

in clay-config.xml
	<component jsfid="collage:dataTable" extends="t:dataTable">
		<attributes>
			<set name="value" value="#{messages['logon.footer']}" />
			<set name="var" value="car" />
			<set name="value" value="#{pagedSort.cars}" />

the problem is that the list gets it data direct from the
PagedSortableCarList - no direct access to any bean with init()... or
other shale methods needed

any solution how i handle to fill data in a list which will be called
after from a datalist?

is it neccessary that all beans are extrends to baseviewcontroller?

stephan

Re: prepare data for (myfaces) datalist...

Posted by stephan opitz <st...@gmail.com>.
or at generall how to manage:

fill such a list in the init method...
but if changing side, because pagedList ;-), the list data - get mybe
from session...

how handling should be...

2006/7/29, stephan opitz <st...@gmail.com>:
> eg. in myfaces i tried to adopt the pagedSortTable to clay and shale...
> in teh example there the data is prepared in the constructor...
>
> i thought ok: as i learned in registration from mailreader...
> while canging sides in my application: call a method and fill the bean
> which will be called next...
>
> PagedSortableCarList pagedSort= (PagedSortableCarList) getBean("pagedSort");
>
> the fill it:
>
> for (int i = 100; i < 200; i++)
> {
>        Object car = new SimpleCar(i, "Car Type " + i, (i % 2 == 0) ? "blue"
> : "green");
>        pagedSort.getCars().add(car);
> }
>
> throws null pointer - cannot add an element to the list :-/
>
> PagedSortableCarList.java
> SimpleCar.java
> SortableList.java
> these three files needed to built up the paged example list...
>
> in clay-config.xml
>        <component jsfid="collage:dataTable" extends="t:dataTable">
>                <attributes>
>                        <set name="value" value="#{messages['logon.footer']}" />
>                        <set name="var" value="car" />
>                        <set name="value" value="#{pagedSort.cars}" />
>
> the problem is that the list gets it data direct from the
> PagedSortableCarList - no direct access to any bean with init()... or
> other shale methods needed
>
> any solution how i handle to fill data in a list which will be called
> after from a datalist?
>
> is it neccessary that all beans are extrends to baseviewcontroller?
>
> stephan
>