You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Rea, Ron" <re...@coramhc.com> on 2002/10/08 01:45:50 UTC

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>