You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Julien Martin <ba...@gmail.com> on 2007/03/22 17:35:28 UTC

Loading data into a form from h:datatable line

Hello,
Say I have the following form in a web page:

FirstName: ---------
LastName : ---------
Age      : ---(selectOneMenu)

Below comes data from a jsf h:datatable component as follows:

FirstName    LastName    Age
Bob                 Smith        42    LoadButton
John                Fritz          26    LoadButton

I want for the user to load any line he/she wants into the form.

The problem I have is that the loadAction attached to the LoadButton is
invoked during invokeApplication phase and therefore too late. I use
component binding. I only have jsf 1.1 available and therefore cannot alter
the lifecycle. Note that the "Age" field is populated from a database. What
strategy can I use?


Julien.

Re: Loading data into a form from h:datatable line

Posted by Jeff Bischoff <jb...@klkurz.com>.
Note to future readers: This information is maintained on the wiki. See [1].

[1] http://wiki.apache.org/myfaces/ClearInputComponents

Julien Martin wrote:
> Thank you Mike!!!
> You saved my life.
> Julien.
> 
> 2007/3/22, Mike Kienenberger <mk...@gmail.com>:
>>
>> If you update your model values, and then call
>>
>>    firstNameComponent.setSubmittedValue(null);
>>    firstNameComponent.setLocalValueSet(false);
>>
>>    lastNameComponent.setSubmittedValue(null);
>>    lastNameComponent.setLocalValueSet(false);
>>
>>    ageComponent.setSubmittedValue(null);
>>    ageComponent.setLocalValueSet(false);
>>
>> then your loaded values should be updated when the page is rendered.
>>
>>
>> On 3/22/07, Julien Martin <ba...@gmail.com> wrote:
>> > Hello,
>> > Say I have the following form in a web page:
>> >
>> > FirstName: ---------
>> > LastName : ---------
>> > Age      : ---(selectOneMenu)
>> >
>> > Below comes data from a jsf h:datatable component as follows:
>> >
>> > FirstName    LastName    Age
>> > Bob                 Smith        42    LoadButton
>> > John                Fritz          26    LoadButton
>> >
>> > I want for the user to load any line he/she wants into the form.
>> >
>> > The problem I have is that the loadAction attached to the LoadButton is
>> > invoked during invokeApplication phase and therefore too late. I use
>> > component binding. I only have jsf 1.1 available and therefore cannot
>> alter
>> > the lifecycle. Note that the "Age" field is populated from a database.
>> What
>> > strategy can I use?
>> >
>> >
>> > Julien.
>>
> 




Re: Loading data into a form from h:datatable line

Posted by Jeff Bischoff <jb...@klkurz.com>.
[2] http://tinyurl.com/38uf39

Mike Kienenberger wrote:
> No problem.
> 
> If you decide you want to do this client-side (javascript) instead of
> server-side, take a look at this posting:
> 
> Message-ID: <8f...@mail.gmail.com>
> Date: Wed, 14 Mar 2007 14:24:45 -0400
> From: "Mike Kienenberger" <mk...@gmail.com>
> To: "MyFaces User mailing list" <us...@myfaces.apache.org>
> Subject: Experiences with t:dataTable row clicking, selecting, and 
> highlighting




Re: Loading data into a form from h:datatable line

Posted by Mike Kienenberger <mk...@gmail.com>.
No problem.

If you decide you want to do this client-side (javascript) instead of
server-side, take a look at this posting:

Message-ID: <8f...@mail.gmail.com>
Date: Wed, 14 Mar 2007 14:24:45 -0400
From: "Mike Kienenberger" <mk...@gmail.com>
To: "MyFaces User mailing list" <us...@myfaces.apache.org>
Subject: Experiences with t:dataTable row clicking, selecting, and highlighting


On 3/22/07, Julien Martin <ba...@gmail.com> wrote:
> Thank you Mike!!!
> You saved my life.
> Julien.
>
> 2007/3/22, Mike Kienenberger <mk...@gmail.com>:
> > If you update your model values, and then call
> >
> >    firstNameComponent.setSubmittedValue(null);
> >    firstNameComponent.setLocalValueSet(false);
> >
> >    lastNameComponent.setSubmittedValue(null);
> >    lastNameComponent.setLocalValueSet (false);
> >
> >    ageComponent.setSubmittedValue(null);
> >    ageComponent.setLocalValueSet(false);
> >
> > then your loaded values should be updated when the page is rendered.
> >
> >
> > On 3/22/07, Julien Martin < balteo@gmail.com> wrote:
> > > Hello,
> > > Say I have the following form in a web page:
> > >
> > > FirstName: ---------
> > > LastName : ---------
> > > Age      : ---(selectOneMenu)
> > >
> > > Below comes data from a jsf h:datatable component as follows:
> > >
> > > FirstName    LastName    Age
> > > Bob                 Smith        42    LoadButton
> > > John                Fritz          26    LoadButton
> > >
> > > I want for the user to load any line he/she wants into the form.
> > >
> > > The problem I have is that the loadAction attached to the LoadButton is
> > > invoked during invokeApplication phase and therefore too late. I use
> > > component binding. I only have jsf 1.1 available and therefore cannot
> alter
> > > the lifecycle. Note that the "Age" field is populated from a database.
> What
> > > strategy can I use?
> > >
> > >
> > > Julien.
> >
>
>

Re: Loading data into a form from h:datatable line

Posted by Julien Martin <ba...@gmail.com>.
Thank you Mike!!!
You saved my life.
Julien.

2007/3/22, Mike Kienenberger <mk...@gmail.com>:
>
> If you update your model values, and then call
>
>    firstNameComponent.setSubmittedValue(null);
>    firstNameComponent.setLocalValueSet(false);
>
>    lastNameComponent.setSubmittedValue(null);
>    lastNameComponent.setLocalValueSet(false);
>
>    ageComponent.setSubmittedValue(null);
>    ageComponent.setLocalValueSet(false);
>
> then your loaded values should be updated when the page is rendered.
>
>
> On 3/22/07, Julien Martin <ba...@gmail.com> wrote:
> > Hello,
> > Say I have the following form in a web page:
> >
> > FirstName: ---------
> > LastName : ---------
> > Age      : ---(selectOneMenu)
> >
> > Below comes data from a jsf h:datatable component as follows:
> >
> > FirstName    LastName    Age
> > Bob                 Smith        42    LoadButton
> > John                Fritz          26    LoadButton
> >
> > I want for the user to load any line he/she wants into the form.
> >
> > The problem I have is that the loadAction attached to the LoadButton is
> > invoked during invokeApplication phase and therefore too late. I use
> > component binding. I only have jsf 1.1 available and therefore cannot
> alter
> > the lifecycle. Note that the "Age" field is populated from a database.
> What
> > strategy can I use?
> >
> >
> > Julien.
>

Re: Loading data into a form from h:datatable line

Posted by Mike Kienenberger <mk...@gmail.com>.
If you update your model values, and then call

   firstNameComponent.setSubmittedValue(null);
   firstNameComponent.setLocalValueSet(false);

   lastNameComponent.setSubmittedValue(null);
   lastNameComponent.setLocalValueSet(false);

   ageComponent.setSubmittedValue(null);
   ageComponent.setLocalValueSet(false);

then your loaded values should be updated when the page is rendered.


On 3/22/07, Julien Martin <ba...@gmail.com> wrote:
> Hello,
> Say I have the following form in a web page:
>
> FirstName: ---------
> LastName : ---------
> Age      : ---(selectOneMenu)
>
> Below comes data from a jsf h:datatable component as follows:
>
> FirstName    LastName    Age
> Bob                 Smith        42    LoadButton
> John                Fritz          26    LoadButton
>
> I want for the user to load any line he/she wants into the form.
>
> The problem I have is that the loadAction attached to the LoadButton is
> invoked during invokeApplication phase and therefore too late. I use
> component binding. I only have jsf 1.1 available and therefore cannot alter
> the lifecycle. Note that the "Age" field is populated from a database. What
> strategy can I use?
>
>
> Julien.