Hello Rob,
to be able to help you,
where do you create the HtmlSelectOneMenu ? in the bean constructor ?
Is your bean in session or request scope ?
Could you show us some code snippet ?

Regards,
Richard Capraro

2006/7/4, Rob99 <[EMAIL PROTECTED]>:

I'm adding an HtmlSelectOneMenu component programmatically like this

    HtmlSelectOneMenu menu = new HtmlSelectOneMenu();
    menu.setId("123");
    menu.setValueBinding("value", app.createValueBinding("#{MyBacking.x}"));
    menu.setConverter(new IntegerConverter());

Backing bean MyBacking has a member called "x" of type String and a
corresponding getter/setter.

        String x;

        public String getX()
        {
                logger.info("called getX");
                return x;
        }

        public void setX(String x)
        {
                logger.info("called setX");
                this.x = x;
        }

The getter gets called 1 time initially and JSF properly uses its value to
select the corresponding element of the dropdown (say "second").  So far so
good.  However the getter and setter never subsequently get called - even
when the page is submitted.

If I select another value in the dropdown (say "third") and click on some
other widgets which causes the page to redisplay, the new dropdown value
stays selected (still "third").  So JSF must be setting the dropdown
component's value.  But since the backing bean's getter/setter is never
subsequently called, when I ask the bean for the value of "x", it returns
the value initially set (which is "second").

What's going on?  There must be something basic going on here that I don't
understand.  Of course it makes sense for the getter to be called initailly
but why doesn't the getter or setter get called after that?  Any help would
be greatly appreciated.
--
View this message in context: 
http://www.nabble.com/Setter-not-called-for-value-binding-tf1887301.html#a5159953
Sent from the MyFaces - Users forum at Nabble.com.


Reply via email to