You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Peter Rabing <pe...@gmx.de> on 2006/10/10 12:04:14 UTC

Change in GUI components not reflected in HTML page

Hi,

I've created a component with a binding expression in which I created a component tree.
The Tree contains 2 combo boxes with some items. Upon Selection of one item in the combo box
(ValueChangeEvent) I change the entries in the 2nd combo box. But whichever way I do this, the change is 
never reflected on the page, it always shows the same 2 comboxes with the same entries again.

To modify the box I use e.g.
UISelectOne combo; //tried creating new instances as well as re-using them
                   //via a hasmap
combo.getChildren().clear();
UISelectItem[] items = new UISelectItem [ 4];
.. add and fill array ..
combo.getChildren().addAll( items);

How do I tell it to render the complete page again? Is their some kind of cache for HTML code?

I also tried adding value binding expressions for the entries, but the getter is never called ...

Thanks for your help,

Peter
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

Re: Change in GUI components not reflected in HTML page

Posted by Martin Marinschek <ma...@gmail.com>.
If you use component-binding, you need to keep in mind that the
"getter" of your component is only called once, whereas the setter is
called on every request.

If you need to dynamically change the list of selectItems - you need
to do that in the setter.

regards,

Martin

On 10/10/06, Gerald Müllan <bi...@gmail.com> wrote:
> Hi,
>
> can you post your jsp-code here?
>
> Have you added the attribute onchange="this.form.submit();" to the
> select menu in jsp code? You have to do a submit after changing the
> selection, otherwise you will only stay on
> the client.
>
> For this kind of usecase you can also use the ajax enabled combobox
> from sandbox, as it is shown on our examples page:
>
> http://example.irian.at/example-sandbox-20061010/ajaxChildComboBox.jsf
>
> Would be a more fluid flow for the user.
>
> cheers,
>
> Gerald
>
> On 10/10/06, Peter Rabing <pe...@gmx.de> wrote:
> > Hi,
> >
> > I've created a component with a binding expression in which I created a component tree.
> > The Tree contains 2 combo boxes with some items. Upon Selection of one item in the combo box
> > (ValueChangeEvent) I change the entries in the 2nd combo box. But whichever way I do this, the change is
> > never reflected on the page, it always shows the same 2 comboxes with the same entries again.
> >
> > To modify the box I use e.g.
> > UISelectOne combo; //tried creating new instances as well as re-using them
> >                    //via a hasmap
> > combo.getChildren().clear();
> > UISelectItem[] items = new UISelectItem [ 4];
> > .. add and fill array ..
> > combo.getChildren().addAll( items);
> >
> > How do I tell it to render the complete page again? Is their some kind of cache for HTML code?
> >
> > I also tried adding value binding expressions for the entries, but the getter is never called ...
> >
> > Thanks for your help,
> >
> > Peter
> > --
> > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> > Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> >
>
>
> --
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Change in GUI components not reflected in HTML page

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

can you post your jsp-code here?

Have you added the attribute onchange="this.form.submit();" to the
select menu in jsp code? You have to do a submit after changing the
selection, otherwise you will only stay on
the client.

For this kind of usecase you can also use the ajax enabled combobox
from sandbox, as it is shown on our examples page:

http://example.irian.at/example-sandbox-20061010/ajaxChildComboBox.jsf

Would be a more fluid flow for the user.

cheers,

Gerald

On 10/10/06, Peter Rabing <pe...@gmx.de> wrote:
> Hi,
>
> I've created a component with a binding expression in which I created a component tree.
> The Tree contains 2 combo boxes with some items. Upon Selection of one item in the combo box
> (ValueChangeEvent) I change the entries in the 2nd combo box. But whichever way I do this, the change is
> never reflected on the page, it always shows the same 2 comboxes with the same entries again.
>
> To modify the box I use e.g.
> UISelectOne combo; //tried creating new instances as well as re-using them
>                    //via a hasmap
> combo.getChildren().clear();
> UISelectItem[] items = new UISelectItem [ 4];
> .. add and fill array ..
> combo.getChildren().addAll( items);
>
> How do I tell it to render the complete page again? Is their some kind of cache for HTML code?
>
> I also tried adding value binding expressions for the entries, but the getter is never called ...
>
> Thanks for your help,
>
> Peter
> --
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces