On 5/3/06, 王曾wang_zeng <[EMAIL PROTECTED]> wrote:

But the prerender() is called before the tag being processed. when the
prerender()  is called, the reference is still null if this is an initial
request. Tree hasn't been constructed, when  the prerender()  is called.
I guess maybe if I want to set a initial value of a component when the
page
is viewed the first time, the reference to the component must be assigned
using a *new* keyword.


Not quite.

IF you use a "binding" attribute on your component, AND IF the getter method
on your backing bean returns a component instance that has been previously
configured (in the backing bean's prerender() method), THEN the component
tree will include *your* instance instead of creating a new one.  The nitty
gritty details of how this works are found in Section 3.1.5 of the JSF
1.1specification.

Craig

Reply via email to