struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Barefoot" <Joe.Baref...@motiva.com>
Subject RE: Is this possible?
Date Tue, 08 Oct 2002 00:36:15 GMT
>From what I see, there's no logic in your popup to populate the form field (the Explanation)
in your opening window.  You need to pass in the id of the explanation field so you can populate
it when the popup is closed:

Your function needs to accept a 'fieldName' argument and then do something like this when
you hit the close button:

onClick=opener.document.getElementById(fieldName).value = this.document.getElementById(overrideExp).value;
window.close


Since you're using the nested tags, you'll have to figure out what names it gives the fields
in the generated HTML so you can pass those in to the JavaScript function.  I'm guessing it
does something like:  gridArray[i].overrideExp


peace,
Joe



> -----Original Message-----
> From: Rea, Ron [mailto:rear@coramhc.com]
> Sent: Monday, October 07, 2002 4:46 PM
> To: 'struts-user@jakarta.apache.org'
> Subject: Is this possible?
> 
> 
> Hello, 
> I'm not sure if this is possible from within a 
> <nested:iterate> tag, any
> help would be greatly appreciated!
>  
> From within my JSP, I am iterating through several rows of data and
> displaying the data for modification.  One specific property is an
> Explanation field.  What I'd like to do is create a "memo" 
> link on each row
> of data, and when that link is hit, a small page is displayed 
> with only that
> rows Explanation data.  The user enters up to 300 bytes of 
> data for their
> Explanation, within the pop-up, and when they close the 
> pop-up, the specific
> rows Explanation property is updated within the 
> <nested:iterate> section.   
>  
> I can create the pop-up, but after I enter the data, the rows 
> Explanation
> property is not updated.  Any ideas?  Is this possible?
>  
> Thanks!
>  
> Example of code:
>  
> JSP:
>     <nested:iterate property="gridArray">
>             <td><nested:write property="msgCode" 
> filter="true"/>&nbsp;</td>
>             <td>
>                         <nested:radio property="overrideInd"
> value="A"/>Approve
>                         <nested:radio property="overrideInd" 
> value="D"/>Deny
>             </td>
>             <td>
>                         <nested:hidden property="overrideExp"/>
> <a href="javascript:getText('Override Explanation',
> 'opener.document.form.overrideExp.value', 'Please enter an Override
> Explanation in the following text area.', '<nested:write
> property="overrideExp" filter="true"/>' ,'<nested:write 
> property="msgCode"
> filter="true"/>');" onMouseOver="window.status='Click to 
> enter an Override
> Explanation...';return true;" onMouseOut="window.status='';return
> true;">memo</a>
>             </td>
>   </tr>
>   </nested:iterate>
>  
> Javascript:
> <SCRIPT LANGUAGE="JavaScript">
> function getText(name, output, msg, dataValue, msgKey) {
> newwin = window.open('','','top=150,left=150,width=325,height=330');
> if (!newwin.opener) newwin.opener = self;
> with (newwin.document)
> {
> open();
> write('<html>');
> write('<body onLoad="document.form.box.focus()"><form 
> name=form>' + msg +
> '<br>');
> write('<p><left>Message Code: <strong>' + msgKey + '</strong>');
> write('<p><center><textarea name=overrideExp rows=10 cols=30 
> onKeyUp=' +
> output + '=this.value>' + dataValue + '</textarea>');
> write('<p><input type=button value="Click to close when finished"
> onClick=window.close()>');
> write('</center></form></body></html>');
> close();
>    }
> }
> </script>
>  
> 

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


Mime
View raw message