On Mon, 03 Aug 2015 18:24:45 -0300, Luca Arzeni <l.arz...@iname.com> 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: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to