Where would AJAX help? A few ways, but principly by cleaning up the flow
when you submit/close the popup; instead of the browser submitting the
form, sending a request, reading the response, pulling the required data
from it, and firing the Javascript to update the opening window, you'd
make an out-of-band XmlHttpRequest to submit the form and read the
response data directly (and it could be returned in a more easily
digested format then, e.g. using JSON). In other words, the benefit
would be small compared to your main problem ;-)
As to the problem, one word: abstract. Or encapsulate, pick which you
like ;-) Some suggestions:
- when you open the popup, set a callback function on its window object
which it can call with the form data, so each opening page can supply
its own logic for pushing the data into any forms and the popup only
need know how to call a function it expects to be available.
- the other way around: make it a requirement that any page opening this
popup have a handler function defined which the popup can rely on being
able to call as opener.someFunc(data).
- either way, provided the popup knows how to pull the data that needs
to be pushed back into the parent and the parent knows how to deal with
it, all you need is a calling convention between the two.
L.
Preston CRAWFORD wrote:
What part of this would AJAX solve? Not questioning because I know to be
smart, but honestly asking. Right now what we're doing is having the
popup submit itself to a traditional action, then refreshing to another
JSP that handles that the updating of the parent page. I'd love it if
AJAX were the solution, but I'm not sure I see how it solves where we're
stuck, which is that we need the component to reusable to update 1 to N
fields and N form names. Thus it needs to be more flexible than the
hard-coded example provided somehow. Without having us create a half
dozen almost identical (save form names and fields to update) JSP pages
and actions.
Preston
[EMAIL PROTECTED] 11/18/2005 1:05:54 AM >>>
hi,
you can try some technique similar to AJAX. Open the popup and do the
necessary search either directly doing a http request..with submit or
using HttpXMLRequest if your server support such request. And then use
javascript window.open.href etc to point to the form in the page and
do
the necessary updations.you can both change the form values or add
components to the html page.
try it..do inform the result.
Regards,
R.Raghavan
[EMAIL PROTECTED] 11/18/05 1:23 pm >>>
On 11/17/05, Preston CRAWFORD <[EMAIL PROTECTED]> wrote:
the UI requirement is that the user perform the
search and then (as transparent as possible to them) have the page
refresh the portions of the display that say what medical provider
is
currently selected.
Ajax?
Basically we want a popup that performs a search, updates some data
on
the page and in the form on the page, without actually doing the
final
submit and save.
You can submit HTML form to server, store temporary data in the
session (for example, as a nested property of session- scoped
ActionForm) and then commit session data to the database only if
needed. If not needed, session data is discarded and database knows
nothing about it.
Hopefully someone gets the question and can help.
I guess I did not :)
Michael.
---------------------------------------------------------------------
To unsubscribe, e- mail: user- [EMAIL PROTECTED]
For additional commands, e- mail: user- [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]