myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rafa PĂ©rez" <raja...@gmail.com>
Subject Re: [Trinidad] <tr:selectBooleanCheckbox> does not update Entity
Date Tue, 08 Apr 2008 09:59:31 GMT
Hi Bart,

can you post more code of the jsp, bean and the entity?

Hi Jeroen,

why are you using binding? Depending on the scope of the backing bean, it is
possible that it does not store the correct values. If you make use of
component binding, you should make your backing bean request scoped.



On Tue, Apr 8, 2008 at 10:08 AM, Jeroen Weijers <
Jeroen.Weijers@koopmanint.com> wrote:

> Hi all,
>
> I'm working on the same problem as Bart Kummel. Another problem, but
> similar to the problem of Bart Kummel (it is actually on the same page and
> with the same bean) is the following:
> I bind my booleancheckbox to a
> UIXSelectBoolean object in my bean (it is configured as a backing bean in
> the xml file).
>
> binding
> ="#{myBean.uixSelectBooleanObject}"
>
> In the action listener coupled to the submit button I try to read this
> value but get a Null pointer exception.
>
> public void actionMethod(ActionEvent action){
>
> value  = getU*ixSelectBooleanObject*.isSelected();
>
> }
>
> Regards,
>
> Jeroen Weijers
>
>
> On 4/8/08, Bart.Kummel@koopmanint.com <Bart.Kummel@koopmanint.com> wrote:
> >
> >
> > Hi Richard,
> >
> > I have a Managed Bean with Session scope. The following works as
> > expected:
> >
> > <tr:textInput value=#{myBean.myEntity.fieldName}/>
> >
> > The managed bean has a member "myEntity" and the corresponding
> > "getMyEntity" and "setMyEntity" methods. As expected, the value of "myField"
> > is displayed in the textInput when the page loads and if a make any changes,
> > the value of "myField" gets updated when I press Submit. So I expect the
> > same behaviour if I use
> >
> > <tr:selectBooleanCheckbox value=#{myBean.myEntity.booleanFieldName}/>
> >
> > On page load the boolean value is displayed correctly. But when I press
> > Submit, hte booleanField in my entity is not updated. Do I have to take
> > extra action for a boolean field? Or is something else going wrong?
> >
> > Best regards,
> > Bart Kummel
> >
> >
> >
> >   *"Richard Yee" <richard.k.yee@gmail.com>*
> >
> > 02-04-2008 15:27
> >   Please respond to
> > "MyFaces Discussion" <users@myfaces.apache.org>
> >
> >    To
> > "MyFaces Discussion" <users@myfaces.apache.org>  cc
> >   Subject
> > Re: [Trinidad] <tr:selectBooleanCheckbox> does not update Entity
> >
> >
> >
> >
> > Bart,
> > Is your entity bean configured in faces-config.xml to be a backing bean?
> > Otherwise, you should have your boolean value field in your backing bean and
> > copy its value to your entity bean in your action handler method that is
> > invoked from your command button.
> >
> > -R
> >
> > On Wed, Apr 2, 2008 at 2:01 AM, <*Bart.Kummel@koopmanint.com*<Bart.Kummel@koopmanint.com>>
> > wrote:
> >
> > Hi all,
> >
> > I'm having problems with the <tr:selectBooleanCheckbox> component. I
> > have a page that updates an EJB3 Entity. If I make changes, alle values in
> > the Entity get updated, except for the boolean values that are linked with
> > the <tr:selectBooleanCheckbox> components. (Like this:
> > <tr:selectBooleanCheckbox value=#{entity.booleanValue}/>.) It seems that
> > selecting or deselecting a checkbox is not recognized as a change. If I only
> > change boolean values, the Entity is not touched at all. I don't have a clue
> > what is going wrong. Am I doing something wrong? Or is this a known issue?
> > Any help would be appreciated!
> >
> > Best regards,
> > Bart Kummel
> >
> >
>

Mime
View raw message