struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lowe <mark.l...@talk21.com>
Subject Re: question about form handling
Date Mon, 29 Dec 2003 17:44:47 GMT
Yeah.. I tend to do things on the server and layer the client-side 
stuff on when i get time. In fact i'm a bit obsessive about not having 
js dependent apps. :o)

On 29 Dec 2003, at 16:53, Cory Wright wrote:

> Hi Dirk:
>
> Sounds like you're talking about client-side issues here.  If you're 
> just trying to populate form-fields with values from a child window 
> (i.e. popup), use javascript to try something like this in the popup:
>
> function updateParent(){
>    popUpValue = 
> document.getElementById("whateverThePopupFormFieldIdIs").value;
>    parentField = 
> opener.document.getElementById("whateverTheParentFormFieldIdIs");
>    parentField.value = popUpValue;
>    close();
>
> Then set the form tag's onSubmit="updateParent()" or set the submit 
> button's onclick="updateParent()" in the popup window.  Make sure you 
> set the required fields' id properties.
>
>
> Now if what you require is some processing of the popup's data by the 
> server, then a subsequent update of the parent...
>
> Submit the popup form to whatever Action you require, then map the 
> successful completion of the Action to a simple html  page or jsp, 
> which need only contain the following script:
>
> function updateParent(){
>   opener.location.reload(true)
>   close();
> }
>
> and set the body tag's onLoad="updateParent()".
>
> If you're talking about all server-side manipulation, Mark Lowe's 
> answer was just fine.  Hope that helps.
>
> Cheers,
>
> Cory
>
>
>> Hello,
>> anybody know how to handle one action, but two forms (one base form +
>> one popup ). When the popup gets closed the base form should be
>> updated with the data from the popup. Anybody has a working example ?
>> Thanks


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


Mime
View raw message