autozoom wrote:
> Do you mean to put the whole page bean in session scope?
>
Yes, I'm suggesting to mark the managed bean as session scoped.
> I will try this, but I don't like it very much...this is actually a quite
> complex page with also a large tree and a heavy table, so putting it into
> session would be a great overhead
>
> Really there isn't a better solution?
>
Unfortunately, your button must be added to the JSF component tree
before it can be decoded. You can always create the button with your
tree and table, but choose set the visible property to false. If you
choose to set the render property to false, that will also prevent the
button from being decoded.
Dan
>
> Dan Labrecque wrote:
>
>> Have you tried using a session scoped bean? Once you add the button to
>> the JSF component tree, via your link action listener, it should be able
>> to handle actions regardless if Ajax is used. However, if the bean is
>> request scoped, the button will not be decoded because it was never
>> found in the JSF component tree.
>>
>> Dan
>>
>> autozoom wrote:
>>
>>> hello,
>>> I have this scenario:
>>> my page contains a number of links, each of which is used to dynamically
>>> add
>>> components to the page, with a code snippet like this:
>>>
>>> Button button = new Button();
>>> JSFActionManager.setValueExpression(button, "text", "#{Page1.txt}");
>>> button.setStyle("left: 115px; top: 448px; position: absolute;");
>>> form1.getChildren().add(button);
>>>
>>> I call this code from the links' action listener.
>>>
>>> Now I found out that these dynamically created components don't react to
>>> Ajax functions like refresh() because, I think, the listener is called
>>> after
>>> the page's init().
>>>
>>> (if you try and add the code snippet to the init() method, the component
>>> correctly reacts to a client side resfresh() call)
>>>
>>> Then, how can I achieve this result? The action listener is *always*
>>> called
>>> after init(), when it's already too late to add components to the page.
>>> Does
>>> this mean that I cannot use Ajax function on these dynamically added
>>> components?
>>>
>>> Please let me know if my guess is right, I hope not.
>>>
>>> Thanks
>>> Mauro
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
>> For additional commands, e-mail: users-help_at_woodstock.dev.java.net
>>
>>
>>
>>
>
>