You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ray Madigan <ra...@madigans.org> on 2003/03/04 18:10:38 UTC

RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data

yes!

if you are usine javascript you can do something like the following.

in the parent create a hidden field

<html:hidden name="foo"/>

when the user submits the form have the onclick javacsript function
run that sets the document.forms[0].foo.value = xxx;

where xxx is the path to the value in the child window.


-----Original Message-----
From: ROSSEL Olivier [mailto:olivier.rossel@airbus.com]
Sent: Tuesday, March 04, 2003 9:11 AM
To: 'Struts Users Mailing List'
Subject: RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically
Set Data


> > I have a web page (the "parent") that opens a child
> > window using javascript. The parent window sets a
> > field on the child window. The child window needs to
> > use that data, as it is opening, to perform a DB query
> > and display information on itself.
> > 
> > The problem is that, even though the parent
> > successfully sets the data on the child, I have no
> > access to it in my ActionForm or in the request
> > object.
> > 
> > Is there a way to make that happen?

Your parent JSP has a form with one field. 
When you submit this form, the child *action* gets it, makes
the connection, formats results and returns the forward that will display
them.

The details (the parent form is hidden and completely managed via
Javascript,
the child JSP appears in a new window) is pure Javascript tricks.

This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

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


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


RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data

Posted by Art Vandalay <av...@yahoo.com>.
Sorry for the late reply... I got called into a
meeting.

Yes, it does.


--- Ray Madigan <ra...@madigans.org> wrote:
> Does the child window create the correct <html:form
> action="xxx"
> 
> -----Original Message-----
> From: Art Vandalay [mailto:avexus_struts@yahoo.com]
> Sent: Tuesday, March 04, 2003 9:23 AM
> To: Struts Users Mailing List
> Subject: RE: [OT] JavaScript: ActionForm Does Not
> Contain Dynamically
> Set Data
> 
> 
> Ray,
> 
> I am doing that part. The problem is that I want
> that
> value to be available to the child's Action class **
> as the child window is opening **. I am expecting it
> to be on the form, but the value in the form is null
> even though the value is successfully set on the
> child.
> 
> How can I get Struts to set the value of this field
> on
> the form?
> 
> There has to be a way because I've noticed in Struts
> that if you have a field defined on your JSP with no
> corresponding get/set methods on the Form, an
> exception is thrown when the window is opening. So
> Struts has to be doing some sort of validation
> between
> the JSP's form and the form class at window open
> time,
> but it doesn't seem to be setting the data. 
> 
> --- Ray Madigan <ra...@madigans.org> wrote:
> > yes!
> > 
> > if you are usine javascript you can do something
> > like the following.
> > 
> > in the parent create a hidden field
> > 
> > <html:hidden name="foo"/>
> > 
> > when the user submits the form have the onclick
> > javacsript function
> > run that sets the document.forms[0].foo.value =
> xxx;
> > 
> > where xxx is the path to the value in the child
> > window.
> > 
> > 
> > -----Original Message-----
> > From: ROSSEL Olivier
> > [mailto:olivier.rossel@airbus.com]
> > Sent: Tuesday, March 04, 2003 9:11 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: [OT] JavaScript: ActionForm Does Not
> > Contain Dynamically
> > Set Data
> > 
> > 
> > > > I have a web page (the "parent") that opens a
> > child
> > > > window using javascript. The parent window
> sets
> > a
> > > > field on the child window. The child window
> > needs to
> > > > use that data, as it is opening, to perform a
> DB
> > query
> > > > and display information on itself.
> > > > 
> > > > The problem is that, even though the parent
> > > > successfully sets the data on the child, I
> have
> > no
> > > > access to it in my ActionForm or in the
> request
> > > > object.
> > > > 
> > > > Is there a way to make that happen?
> > 
> > Your parent JSP has a form with one field. 
> > When you submit this form, the child *action* gets
> > it, makes
> > the connection, formats results and returns the
> > forward that will display
> > them.
> > 
> > The details (the parent form is hidden and
> > completely managed via
> > Javascript,
> > the child JSP appears in a new window) is pure
> > Javascript tricks.
> > 
> > This e-mail is intended only for the above
> > addressee. It may contain
> > privileged information. If you are not the
> addressee
> > you must not copy,
> > distribute, disclose or use any of the information
> > in it. If you have
> > received it in error please delete it and
> > immediately notify the sender.
> > Security Notice: all e-mail, sent to or from this
> > address, may be
> > accessed by someone other than the recipient, for
> > system management and
> > security reasons. This access is controlled under
> > Regulation of
> > Investigatory Powers Act 2000, Lawful Business
> > Practises.
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > struts-user-help@jakarta.apache.org
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > struts-user-help@jakarta.apache.org
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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


RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data

Posted by Ray Madigan <ra...@madigans.org>.
Does the child window create the correct <html:form action="xxx"

-----Original Message-----
From: Art Vandalay [mailto:avexus_struts@yahoo.com]
Sent: Tuesday, March 04, 2003 9:23 AM
To: Struts Users Mailing List
Subject: RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically
Set Data


Ray,

I am doing that part. The problem is that I want that
value to be available to the child's Action class **
as the child window is opening **. I am expecting it
to be on the form, but the value in the form is null
even though the value is successfully set on the
child.

How can I get Struts to set the value of this field on
the form?

There has to be a way because I've noticed in Struts
that if you have a field defined on your JSP with no
corresponding get/set methods on the Form, an
exception is thrown when the window is opening. So
Struts has to be doing some sort of validation between
the JSP's form and the form class at window open time,
but it doesn't seem to be setting the data. 

--- Ray Madigan <ra...@madigans.org> wrote:
> yes!
> 
> if you are usine javascript you can do something
> like the following.
> 
> in the parent create a hidden field
> 
> <html:hidden name="foo"/>
> 
> when the user submits the form have the onclick
> javacsript function
> run that sets the document.forms[0].foo.value = xxx;
> 
> where xxx is the path to the value in the child
> window.
> 
> 
> -----Original Message-----
> From: ROSSEL Olivier
> [mailto:olivier.rossel@airbus.com]
> Sent: Tuesday, March 04, 2003 9:11 AM
> To: 'Struts Users Mailing List'
> Subject: RE: [OT] JavaScript: ActionForm Does Not
> Contain Dynamically
> Set Data
> 
> 
> > > I have a web page (the "parent") that opens a
> child
> > > window using javascript. The parent window sets
> a
> > > field on the child window. The child window
> needs to
> > > use that data, as it is opening, to perform a DB
> query
> > > and display information on itself.
> > > 
> > > The problem is that, even though the parent
> > > successfully sets the data on the child, I have
> no
> > > access to it in my ActionForm or in the request
> > > object.
> > > 
> > > Is there a way to make that happen?
> 
> Your parent JSP has a form with one field. 
> When you submit this form, the child *action* gets
> it, makes
> the connection, formats results and returns the
> forward that will display
> them.
> 
> The details (the parent form is hidden and
> completely managed via
> Javascript,
> the child JSP appears in a new window) is pure
> Javascript tricks.
> 
> This e-mail is intended only for the above
> addressee. It may contain
> privileged information. If you are not the addressee
> you must not copy,
> distribute, disclose or use any of the information
> in it. If you have
> received it in error please delete it and
> immediately notify the sender.
> Security Notice: all e-mail, sent to or from this
> address, may be
> accessed by someone other than the recipient, for
> system management and
> security reasons. This access is controlled under
> Regulation of
> Investigatory Powers Act 2000, Lawful Business
> Practises.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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


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


RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data

Posted by Art Vandalay <av...@yahoo.com>.
Ray,

I am doing that part. The problem is that I want that
value to be available to the child's Action class **
as the child window is opening **. I am expecting it
to be on the form, but the value in the form is null
even though the value is successfully set on the
child.

How can I get Struts to set the value of this field on
the form?

There has to be a way because I've noticed in Struts
that if you have a field defined on your JSP with no
corresponding get/set methods on the Form, an
exception is thrown when the window is opening. So
Struts has to be doing some sort of validation between
the JSP's form and the form class at window open time,
but it doesn't seem to be setting the data. 

--- Ray Madigan <ra...@madigans.org> wrote:
> yes!
> 
> if you are usine javascript you can do something
> like the following.
> 
> in the parent create a hidden field
> 
> <html:hidden name="foo"/>
> 
> when the user submits the form have the onclick
> javacsript function
> run that sets the document.forms[0].foo.value = xxx;
> 
> where xxx is the path to the value in the child
> window.
> 
> 
> -----Original Message-----
> From: ROSSEL Olivier
> [mailto:olivier.rossel@airbus.com]
> Sent: Tuesday, March 04, 2003 9:11 AM
> To: 'Struts Users Mailing List'
> Subject: RE: [OT] JavaScript: ActionForm Does Not
> Contain Dynamically
> Set Data
> 
> 
> > > I have a web page (the "parent") that opens a
> child
> > > window using javascript. The parent window sets
> a
> > > field on the child window. The child window
> needs to
> > > use that data, as it is opening, to perform a DB
> query
> > > and display information on itself.
> > > 
> > > The problem is that, even though the parent
> > > successfully sets the data on the child, I have
> no
> > > access to it in my ActionForm or in the request
> > > object.
> > > 
> > > Is there a way to make that happen?
> 
> Your parent JSP has a form with one field. 
> When you submit this form, the child *action* gets
> it, makes
> the connection, formats results and returns the
> forward that will display
> them.
> 
> The details (the parent form is hidden and
> completely managed via
> Javascript,
> the child JSP appears in a new window) is pure
> Javascript tricks.
> 
> This e-mail is intended only for the above
> addressee. It may contain
> privileged information. If you are not the addressee
> you must not copy,
> distribute, disclose or use any of the information
> in it. If you have
> received it in error please delete it and
> immediately notify the sender.
> Security Notice: all e-mail, sent to or from this
> address, may be
> accessed by someone other than the recipient, for
> system management and
> security reasons. This access is controlled under
> Regulation of
> Investigatory Powers Act 2000, Lawful Business
> Practises.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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