Filling some filed of a form selecting a row from a grid

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Filling some filed of a form selecting a row from a grid

larzeni
Hi,
I'm using tapestry 5.3.7 unde jboss6 (java6).

I'm developing an invoice form.

I already have a customer list, built with a grid.

While filling the invoice form, I need to show the customer grid, select one of the customers, and retrieve his data (first and last name, addreess, city, zip code phone numbers and so on...), to fill some fields of the invoice form.

I would not like to use a select on the invoice data, since I have a large list of customers.

What is the best practise to face this issue?

Thanks larzeni





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

Kalle Korhonen-2
On Mon, Aug 3, 2015 at 7:58 AM, Luca Arzeni <[hidden email]> wrote:

> Hi,
> I'm using tapestry 5.3.7 unde jboss6 (java6).
> I'm developing an invoice form.
> I already have a customer list, built with a grid.
> While filling the invoice form, I need to show the customer grid, select
> one of the customers, and retrieve his data (first and last name, addreess,
> city, zip code phone numbers and so on...), to fill some fields of the
> invoice form.
> I would not like to use a select on the invoice data, since I have a large
> list of customers.
> What is the best practise to face this issue?
>
>
The typical solution is to use some type of autocomplete field, where the
user can start typing on a field and the system makes a lookup on the
background and provides a list of matches based on the input. There's an
autocomplete mixins available for a regular input field, see
http://tapestry.apache.org/component-mixins.html. It may or may not work
out-of-the-box but at least it'll give you ideas on how to build yours.

Kalle
Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

larzeni
Thanks Kalle,
I appreciate your hint and I already used a solution like this for a shorter list of items.

The point here is that the list needs to be shown in a grid since it has more than 100.000 items, and I need to allow the user to filter it according to few criteria (that I've already implemented in the page that contains the grid).

If you have used a ERP application you will recognize here a recurrent pattern: user needs to fill some fields, hit a lookup button, the button open a new page containing a list of items. The user select one of these item and fills the fields of the originating form.

By the way: the user needs to see a list of customers since many users have similar values (same name, same city...) so he needs to examinate more than one field to choose the right one (which is the reason why a show a list of customers in a grid).

Thanks again for your help, but I need a different solution here!
larzeni





> Sent: Monday, August 03, 2015 at 6:37 PM
> From: "Kalle Korhonen" <[hidden email]>
> To: "Tapestry users" <[hidden email]>
> Subject: Re: Filling some filed of a form selecting a row from a grid
>
> On Mon, Aug 3, 2015 at 7:58 AM, Luca Arzeni <[hidden email]> wrote:
>
> > Hi,
> > I'm using tapestry 5.3.7 unde jboss6 (java6).
> > I'm developing an invoice form.
> > I already have a customer list, built with a grid.
> > While filling the invoice form, I need to show the customer grid, select
> > one of the customers, and retrieve his data (first and last name, addreess,
> > city, zip code phone numbers and so on...), to fill some fields of the
> > invoice form.
> > I would not like to use a select on the invoice data, since I have a large
> > list of customers.
> > What is the best practise to face this issue?
> >
> >
> The typical solution is to use some type of autocomplete field, where the
> user can start typing on a field and the system makes a lookup on the
> background and provides a list of matches based on the input. There's an
> autocomplete mixins available for a regular input field, see
> http://tapestry.apache.org/component-mixins.html. It may or may not work
> out-of-the-box but at least it'll give you ideas on how to build yours.
>
> Kalle
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

Jens Breitenstein
Maybe you have a look at jquery tables + ajax?

https://www.datatables.net/examples/data_sources/server_side.html

Jens


Von meinem iPhone gesendet

> Am 03.08.2015 um 17:55 schrieb Luca Arzeni <[hidden email]>:
>
> Thanks Kalle,
> I appreciate your hint and I already used a solution like this for a shorter list of items.
>
> The point here is that the list needs to be shown in a grid since it has more than 100.000 items, and I need to allow the user to filter it according to few criteria (that I've already implemented in the page that contains the grid).
>
> If you have used a ERP application you will recognize here a recurrent pattern: user needs to fill some fields, hit a lookup button, the button open a new page containing a list of items. The user select one of these item and fills the fields of the originating form.
>
> By the way: the user needs to see a list of customers since many users have similar values (same name, same city...) so he needs to examinate more than one field to choose the right one (which is the reason why a show a list of customers in a grid).
>
> Thanks again for your help, but I need a different solution here!
> larzeni
>
>
>
>
>
>> Sent: Monday, August 03, 2015 at 6:37 PM
>> From: "Kalle Korhonen" <[hidden email]>
>> To: "Tapestry users" <[hidden email]>
>> Subject: Re: Filling some filed of a form selecting a row from a grid
>>
>>> On Mon, Aug 3, 2015 at 7:58 AM, Luca Arzeni <[hidden email]> wrote:
>>>
>>> Hi,
>>> I'm using tapestry 5.3.7 unde jboss6 (java6).
>>> I'm developing an invoice form.
>>> I already have a customer list, built with a grid.
>>> While filling the invoice form, I need to show the customer grid, select
>>> one of the customers, and retrieve his data (first and last name, addreess,
>>> city, zip code phone numbers and so on...), to fill some fields of the
>>> invoice form.
>>> I would not like to use a select on the invoice data, since I have a large
>>> list of customers.
>>> What is the best practise to face this issue?
>>>
>>>
>> The typical solution is to use some type of autocomplete field, where the
>> user can start typing on a field and the system makes a lookup on the
>> background and provides a list of matches based on the input. There's an
>> autocomplete mixins available for a regular input field, see
>> http://tapestry.apache.org/component-mixins.html. It may or may not work
>> out-of-the-box but at least it'll give you ideas on how to build yours.
>>
>> Kalle
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

larzeni
Thanks Jens,
I will take a look.

I was hoping that there was already a "tapestry-zed" solution since to me it seems a common need...

Do you know if tapestry 5.4 has some native support for jquery tables?

Thanks,
larzeni



> Sent: Monday, August 03, 2015 at 7:03 PM
> From: "[hidden email]" <[hidden email]>
> To: "Tapestry users" <[hidden email]>
> Subject: Re: Filling some filed of a form selecting a row from a grid
>
> Maybe you have a look at jquery tables + ajax?
>
> https://www.datatables.net/examples/data_sources/server_side.html
>
> Jens
>
>
> Von meinem iPhone gesendet
>
> > Am 03.08.2015 um 17:55 schrieb Luca Arzeni <[hidden email]>:
> >
> > Thanks Kalle,
> > I appreciate your hint and I already used a solution like this for a shorter list of items.
> >
> > The point here is that the list needs to be shown in a grid since it has more than 100.000 items, and I need to allow the user to filter it according to few criteria (that I've already implemented in the page that contains the grid).
> >
> > If you have used a ERP application you will recognize here a recurrent pattern: user needs to fill some fields, hit a lookup button, the button open a new page containing a list of items. The user select one of these item and fills the fields of the originating form.
> >
> > By the way: the user needs to see a list of customers since many users have similar values (same name, same city...) so he needs to examinate more than one field to choose the right one (which is the reason why a show a list of customers in a grid).
> >
> > Thanks again for your help, but I need a different solution here!
> > larzeni
> >
> >
> >
> >
> >
> >> Sent: Monday, August 03, 2015 at 6:37 PM
> >> From: "Kalle Korhonen" <[hidden email]>
> >> To: "Tapestry users" <[hidden email]>
> >> Subject: Re: Filling some filed of a form selecting a row from a grid
> >>
> >>> On Mon, Aug 3, 2015 at 7:58 AM, Luca Arzeni <[hidden email]> wrote:
> >>>
> >>> Hi,
> >>> I'm using tapestry 5.3.7 unde jboss6 (java6).
> >>> I'm developing an invoice form.
> >>> I already have a customer list, built with a grid.
> >>> While filling the invoice form, I need to show the customer grid, select
> >>> one of the customers, and retrieve his data (first and last name, addreess,
> >>> city, zip code phone numbers and so on...), to fill some fields of the
> >>> invoice form.
> >>> I would not like to use a select on the invoice data, since I have a large
> >>> list of customers.
> >>> What is the best practise to face this issue?
> >>>
> >>>
> >> The typical solution is to use some type of autocomplete field, where the
> >> user can start typing on a field and the system makes a lookup on the
> >> background and provides a list of matches based on the input. There's an
> >> autocomplete mixins available for a regular input field, see
> >> http://tapestry.apache.org/component-mixins.html. It may or may not work
> >> out-of-the-box but at least it'll give you ideas on how to build yours.
> >>
> >> Kalle
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

Thiago H de Paula Figueiredo
In reply to this post by larzeni
On Mon, 03 Aug 2015 13:55:54 -0300, Luca Arzeni <[hidden email]> wrote:

> The point here is that the list needs to be shown in a grid since it has  
> more than 100.000 items, and I need to allow the user to filter it  
> according to few criteria (that I've already implemented in the page  
> that contains the grid).

Remember the source parameter of Grid receives a GridDataSource object,  
not a List, so just implement it to do the search you need to do with  
paging (i.e. retrieve just the objects you'll show right now).  
tapestry-hibernate already has HibernateGridDataSource, which already  
implements a part of it (pagination) and you just need to provide the  
query criteria.

> By the way: the user needs to see a list of customers since many users  
> have similar values (same name, same city...) so he needs to examinate  
> more than one field to choose the right one (which is the reason why a  
> show a list of customers in a grid).

This looks more of an user interface question than a Tapestry one, to be  
honest . . .

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

Jens Breitenstein
In reply to this post by larzeni
Hi Luca,

we are using T5.3.8 right now but  there are no plans on our side to upgrade to T5.4 yet, so unfortunately I can not answer this question.

For Datatables I can tell you integration is easy, filtering works per column or multiple columns ("and" condition) or regex. Ok, regex ist not considerably end user compatible but you can set regex expression by JS internally. Just check it out, for our requirements it simply works without any issues. Our Dataset is small (less than 1000 entries) so we do not use Ajax, but we tested up to 50k entries without problems. 50k+ slows down, 80k creates serious issues depending on browser used. I guess you have to start with Ajax / Paging right from the start.

Jens

Von meinem iPhone gesendet

> Am 03.08.2015 um 18:23 schrieb Luca Arzeni <[hidden email]>:
>
> Thanks Jens,
> I will take a look.
>
> I was hoping that there was already a "tapestry-zed" solution since to me it seems a common need...
>
> Do you know if tapestry 5.4 has some native support for jquery tables?
>
> Thanks,
> larzeni
>
>
>
>> Sent: Monday, August 03, 2015 at 7:03 PM
>> From: "[hidden email]" <[hidden email]>
>> To: "Tapestry users" <[hidden email]>
>> Subject: Re: Filling some filed of a form selecting a row from a grid
>>
>> Maybe you have a look at jquery tables + ajax?
>>
>> https://www.datatables.net/examples/data_sources/server_side.html
>>
>> Jens
>>
>>
>> Von meinem iPhone gesendet
>>
>>> Am 03.08.2015 um 17:55 schrieb Luca Arzeni <[hidden email]>:
>>>
>>> Thanks Kalle,
>>> I appreciate your hint and I already used a solution like this for a shorter list of items.
>>>
>>> The point here is that the list needs to be shown in a grid since it has more than 100.000 items, and I need to allow the user to filter it according to few criteria (that I've already implemented in the page that contains the grid).
>>>
>>> If you have used a ERP application you will recognize here a recurrent pattern: user needs to fill some fields, hit a lookup button, the button open a new page containing a list of items. The user select one of these item and fills the fields of the originating form.
>>>
>>> By the way: the user needs to see a list of customers since many users have similar values (same name, same city...) so he needs to examinate more than one field to choose the right one (which is the reason why a show a list of customers in a grid).
>>>
>>> Thanks again for your help, but I need a different solution here!
>>> larzeni
>>>
>>>
>>>
>>>
>>>
>>>> Sent: Monday, August 03, 2015 at 6:37 PM
>>>> From: "Kalle Korhonen" <[hidden email]>
>>>> To: "Tapestry users" <[hidden email]>
>>>> Subject: Re: Filling some filed of a form selecting a row from a grid
>>>>
>>>>> On Mon, Aug 3, 2015 at 7:58 AM, Luca Arzeni <[hidden email]> wrote:
>>>>>
>>>>> Hi,
>>>>> I'm using tapestry 5.3.7 unde jboss6 (java6).
>>>>> I'm developing an invoice form.
>>>>> I already have a customer list, built with a grid.
>>>>> While filling the invoice form, I need to show the customer grid, select
>>>>> one of the customers, and retrieve his data (first and last name, addreess,
>>>>> city, zip code phone numbers and so on...), to fill some fields of the
>>>>> invoice form.
>>>>> I would not like to use a select on the invoice data, since I have a large
>>>>> list of customers.
>>>>> What is the best practise to face this issue?
>>>> The typical solution is to use some type of autocomplete field, where the
>>>> user can start typing on a field and the system makes a lookup on the
>>>> background and provides a list of matches based on the input. There's an
>>>> autocomplete mixins available for a regular input field, see
>>>> http://tapestry.apache.org/component-mixins.html. It may or may not work
>>>> out-of-the-box but at least it'll give you ideas on how to build yours.
>>>>
>>>> Kalle
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

larzeni
In reply to this post by Thiago H de Paula Figueiredo
Thanks Thiago,

I have built a JPA datasource provider that is similar to the hibernate one, and it manages filtering, sorting and paging so the size of a grid is not an issue; I was declaring that the dataset is verylarge only to explain the reason why I cannot use an autocomplete/drop down field.

Regarding the "user interface question", well, ehrrr... ehm... I was using tapestry exactly to build the user interface, so I was appreciating the grid that allows me to show many columns to the user. I was simply hoping to find a "standard" way to solve this issue, if I'm the first one to have this need may be I choose the wrong tool for this task :-)

Thanks again,
Luca



> Sent: Monday, August 03, 2015 at 7:42 PM
> From: "Thiago H de Paula Figueiredo" <[hidden email]>
> To: "Tapestry users" <[hidden email]>
> Subject: Re: Filling some filed of a form selecting a row from a grid
>
> On Mon, 03 Aug 2015 13:55:54 -0300, Luca Arzeni <[hidden email]> wrote:
>
> > The point here is that the list needs to be shown in a grid since it has  
> > more than 100.000 items, and I need to allow the user to filter it  
> > according to few criteria (that I've already implemented in the page  
> > that contains the grid).
>
> Remember the source parameter of Grid receives a GridDataSource object,  
> not a List, so just implement it to do the search you need to do with  
> paging (i.e. retrieve just the objects you'll show right now).  
> tapestry-hibernate already has HibernateGridDataSource, which already  
> implements a part of it (pagination) and you just need to provide the  
> query criteria.
>
> > By the way: the user needs to see a list of customers since many users  
> > have similar values (same name, same city...) so he needs to examinate  
> > more than one field to choose the right one (which is the reason why a  
> > show a list of customers in a grid).
>
> This looks more of an user interface question than a Tapestry one, to be  
> honest . . .
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

Thiago H de Paula Figueiredo
On Mon, 03 Aug 2015 15:32:06 -0300, Luca Arzeni <[hidden email]> wrote:

> I have built a JPA datasource provider that is similar to the hibernate  
> one, and it manages filtering, sorting and paging so the size of a grid  
> is not an issue; I was declaring that the dataset is verylarge only to  
> explain the reason why I cannot use an autocomplete/drop down field.

You don't need to show all the options . . .

> Regarding the "user interface question", well, ehrrr... ehm... I was  
> using tapestry exactly to build the user interface,

I wasn't talking about the coding part, but how to present a good user  
interface so the user can do their tasks on it easily and intuitively.

> so I was appreciating the grid that allows me to show many columns to  
> the user. I was simply hoping to find a "standard" way to solve this  
> issue, if I'm the first one to have this need may be I choose the wrong  
> tool for this task :-)

Grid is awesome for showing tabular data, if that's your question. You've  
mentioned 100 thousands rows, so I thought that was your concern, but not  
it seems to me it isn't.

To be honest, I still think your question is vague and not very well  
phrased, so it's hard to give a good answer. You may try to use zones so  
you don't need to write any JavaScript to make your selection be applied  
to the first form.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

larzeni
Hi Thiago,
I really appreciate your help!

May be that my problems came from the fact that I've always seen this job solved with a button that shows a picklist.

I'm used to see something like the behaviour of OpenXava, take a look at this:

http://www.openxava.org/InvoiceDemo/m/Invoice

When you press the new button, the system allows you to create a new invoice.

At this point you need to select a customer: you can insert a customer number, but, if you don't know it, you can press the search button at the right of the customer number and the system will open a popup showing you a list of customers.

You can choose one of them, and, after the selection, the popup will close, and the data of the selected customer will fill in you form.
I was trying to mimic this behavior.

What would be your way to do this? May be there is a simpler way, that I didn't spot, for solving this problem in tapestry?

Also, I understand that the fields in the invoice form could be wrapped in a zone and updated after the selection, but I don't understand how can I show a popup to the user, allow him to choose the customer, and get the data back to my form.

I know that I can do this using a select/dropdown/autocomplete to select the customer directly from the invoice form, but since there are many of them, I cannot show all of them in a drop down, so I need the user to filter/find the one that he needs.

Thanks,
larzeni


> Sent: Monday, August 03, 2015 at 10:08 PM
> From: "Thiago H de Paula Figueiredo" <[hidden email]>
> To: "Tapestry users" <[hidden email]>
> Subject: Re: Filling some filed of a form selecting a row from a grid
>
> On Mon, 03 Aug 2015 15:32:06 -0300, Luca Arzeni <[hidden email]> wrote:
>
> > I have built a JPA datasource provider that is similar to the hibernate  
> > one, and it manages filtering, sorting and paging so the size of a grid  
> > is not an issue; I was declaring that the dataset is verylarge only to  
> > explain the reason why I cannot use an autocomplete/drop down field.
>
> You don't need to show all the options . . .
>
> > Regarding the "user interface question", well, ehrrr... ehm... I was  
> > using tapestry exactly to build the user interface,
>
> I wasn't talking about the coding part, but how to present a good user  
> interface so the user can do their tasks on it easily and intuitively.
>
> > so I was appreciating the grid that allows me to show many columns to  
> > the user. I was simply hoping to find a "standard" way to solve this  
> > issue, if I'm the first one to have this need may be I choose the wrong  
> > tool for this task :-)
>
> Grid is awesome for showing tabular data, if that's your question. You've  
> mentioned 100 thousands rows, so I thought that was your concern, but not  
> it seems to me it isn't.
>
> To be honest, I still think your question is vague and not very well  
> phrased, so it's hard to give a good answer. You may try to use zones so  
> you don't need to write any JavaScript to make your selection be applied  
> to the first form.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

Thiago H de Paula Figueiredo
On Mon, 03 Aug 2015 18:24:45 -0300, Luca Arzeni <[hidden email]> wrote:

> Hi Thiago,

Hi!

> invoice.
>
> At this point you need to select a customer: you can insert a customer  
> number, but, if you don't know it, you can press the search button at  
> the right of the customer number and the system will open a popup  
> showing you a list of customers.
>
> You can choose one of them, and, after the selection, the popup will  
> close, and the data of the selected customer will fill in you form.
> I was trying to mimic this behavior.

Ok, now I think it's better explained.

> What would be your way to do this? May be there is a simpler way, that I  
> didn't spot, for solving this problem in tapestry?

I'd do what I proposed above.

Tapestry or not, there's basically two ways of doing what you want: 1)  
doing an AJAX request that, after the option is selected, rerenders the  
form with the corresponding fields filled and 2) use some JavaScript to  
copy the values from the listing to the form. 1) can be easily done in  
Tapestry using two zones: one around the form, one for showing the options  
(list of customers). In the options, you'd have an EventLink which would  
have the customer id as its context and its handler would use it to  
pre-fill the properties which are bound to the form's search fields. 2) is  
very easy if you know *basic* JavaScript. Like this (not tested, not  
dynamic, but can be very easily made dynamic):  
document.getElementById('address').value =  
document.getElementById('address-from-grid').value.

> Also, I understand that the fields in the invoice form could be wrapped  
> in a zone and updated after the selection, but I don't understand how  
> can I show a popup to the user, allow him to choose the customer, and  
> get the data back to my form.

Unless you're talking about the much rated browser popups, popups are  
merely CSS things. With CSS and a little bit of JavaScript you can make  
parts of your page resize, appear or disappear. Anyway, that's outside the  
scope of this mailing list.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

larzeni
Thank you Thiago, I got it!
Bye,
larzen


> Sent: Monday, August 03, 2015 at 11:56 PM
> From: "Thiago H de Paula Figueiredo" <[hidden email]>
> To: "Tapestry users" <[hidden email]>
> Subject: Re: Filling some filed of a form selecting a row from a grid
>
> On Mon, 03 Aug 2015 18:24:45 -0300, Luca Arzeni <[hidden email]> wrote:
>
> > Hi Thiago,
>
> Hi!
>
> > invoice.
> >
> > At this point you need to select a customer: you can insert a customer  
> > number, but, if you don't know it, you can press the search button at  
> > the right of the customer number and the system will open a popup  
> > showing you a list of customers.
> >
> > You can choose one of them, and, after the selection, the popup will  
> > close, and the data of the selected customer will fill in you form.
> > I was trying to mimic this behavior.
>
> Ok, now I think it's better explained.
>
> > What would be your way to do this? May be there is a simpler way, that I  
> > didn't spot, for solving this problem in tapestry?
>
> I'd do what I proposed above.
>
> Tapestry or not, there's basically two ways of doing what you want: 1)  
> doing an AJAX request that, after the option is selected, rerenders the  
> form with the corresponding fields filled and 2) use some JavaScript to  
> copy the values from the listing to the form. 1) can be easily done in  
> Tapestry using two zones: one around the form, one for showing the options  
> (list of customers). In the options, you'd have an EventLink which would  
> have the customer id as its context and its handler would use it to  
> pre-fill the properties which are bound to the form's search fields. 2) is  
> very easy if you know *basic* JavaScript. Like this (not tested, not  
> dynamic, but can be very easily made dynamic):  
> document.getElementById('address').value =  
> document.getElementById('address-from-grid').value.
>
> > Also, I understand that the fields in the invoice form could be wrapped  
> > in a zone and updated after the selection, but I don't understand how  
> > can I show a popup to the user, allow him to choose the customer, and  
> > get the data back to my form.
>
> Unless you're talking about the much rated browser popups, popups are  
> merely CSS things. With CSS and a little bit of JavaScript you can make  
> parts of your page resize, appear or disappear. Anyway, that's outside the  
> scope of this mailing list.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Filling some filed of a form selecting a row from a grid

Thiago H de Paula Figueiredo
In reply to this post by larzeni
On Mon, 03 Aug 2015 18:24:45 -0300, Luca Arzeni <[hidden email]> wrote:

> Hi Thiago,

Hi!

> invoice.
>
> At this point you need to select a customer: you can insert a customer  
> number, but, if you don't know it, you can press the search button at  
> the right of the customer number and the system will open a popup  
> showing you a list of customers.
>
> You can choose one of them, and, after the selection, the popup will  
> close, and the data of the selected customer will fill in you form.
> I was trying to mimic this behavior.

Ok, now I think it's better explained.

> What would be your way to do this? May be there is a simpler way, that I  
> didn't spot, for solving this problem in tapestry?

I'd do what I proposed above.

Tapestry or not, there are basically two ways of doing what you want: 1)
doing an AJAX request that, after the option is selected, rerenders the
form with the corresponding fields filled and 2) use some JavaScript to
copy the values from the listing to the form. 1) can be easily done in
Tapestry using two zones: one around the form, one for showing the options
(list of customers). In the options, you'd have an EventLink which would
have the customer id as its context and its handler would use it to
pre-fill the properties which are bound to the form's search fields. 2) is
very easy if you know *basic* JavaScript. Like this (not tested, not
dynamic, but can be very easily made dynamic):
document.getElementById('address').value =
document.getElementById('address-from-grid').value.

> Also, I understand that the fields in the invoice form could be wrapped  
> in a zone and updated after the selection, but I don't understand how  
> can I show a popup to the user, allow him to choose the customer, and  
> get the data back to my form.

Unless you're talking about the much hated browser popups, popups are
merely CSS things. With CSS and a little bit of JavaScript you can make
parts of your page resize, appear or disappear. Anyway, that's outside the
scope of this mailing list.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]