You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Lipscombe <ad...@expensys.com> on 2005/03/03 18:06:46 UTC

RE: Is it possible to harvest the form values and populate an

Frank, 

Your understanding of my problem is spot on.
The first approach you suggest sounds good and appropriate -  I will give it
a go. 

Many thanks...


Adam


-----Original Message-----
From: Frank W. Zammetti [mailto:fzlists@omnytex.com] 
Sent: 03 March 2005 16:56
To: Struts Users Mailing List
Subject: Re: Is it possible to harvest the form values and populate an


I think some scripting would be in order...

If I understand correctly... when the button on your parent form is clicked,
a modal dialog is opened and the URL you tell that dialog to display is
actually an Action that does some initialization.  Is that correct?

Assuming it is... what I would do is instead of putting your initialization
URL in there, instead put a, shall we say, "pre-initialization" URL.  This
would return a page with nothing but a Javascript function and a form with
all hidden fields.  The function would be called in response to the onLoad
even.  The function would grab the form elements you need from the parent
form (via window.opener syntax), populate the form on that page, and then
submit the form to your real initialization Actino.  You would then have the
elements from the parent you need to do your initialization, and THEN
display the first page of the wizard to the user.

Another option (maybe) to save the first trip to the server... I don't
remember off the top of my head if you can write the document in a modal
dialog like you can a typical popup window (I'm thinking not, but I'm not
sure).  If you CAN do that, than instead of calling on the server to do the
pre-initialization, you can dynamically write out the document via
Javascript.  If that isn't possible though, then the first approach would
still work.

Does that sound like something that might work in your scenario?

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, March 3, 2005 11:09 am, Adam Lipscombe said:
> Folks,
>
>
> I have a tricky little problem with Struts 1.1:
>
> I have a form, on which there is a button that starts a wizard in a 
> popup modal dialog box. The wizard behaviour depends on some of the 
> values that have already been entered in the parent form, and when it 
> finishes the parent form is further
> populated.
>
>
> Rather than pass the form values as HTTP params to the wizard, I 
> elected to perform the backend processing prior to starting the 
> wizard. This ensures that all the necessary values are computed 
> correctly and would normally be done by submitting the parent page 
> form.
>
> But, the backend processing is invoked by the wizard calling a URL as 
> part of its initialisation. The parent form is not submitted, hence 
> the values from the parent form are not transferred to the actionform 
> prior to the backend processing being invoked.
>
>
> Is there anyway round this? Is it possible to harvest the parent form 
> values explicitly to ensure that the actionform is populated?
>
>
> TIA - Adam Lipscombe
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org