This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

retreiving request parameter of second frame in first  RSS feed

 
Sujatha Kalluri
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have two frames in a window and , left frame (left side menu) has jsp page with buttons and select box and right frame will be loaded with different jsps depending on the button clicked on the left frame.

The request parameters like select options of select box and some hidden inputs are retrieved in right frame.. so, when I change the select option the parameter passed to right frame is changing.is there any way I can get the retrieved parameter of the second frame back in the 1st frame, since the 1st frame data is not getting submitted to same frame,(but to the second frame) I am not able to retrieve the request parameter in the same page, so I am trying round about route and getting request parameter from second frame.. is it possible.

thanks,
Sujatha.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. If you better describe what you are trying to accomplish, perhaps a better way to do it can be suggested.
 
Sujatha Kalluri
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The index.html has two frames, sidebar on left and data on right

side bar has one jsp which has a form given like this,

<FORM ID='TARGETFORM' ACTION='welcome.jsp' TARGET='DATA' method='GET' STYLE='margin:0px;'>
<INPUT TYPE='hidden' VALUE='' NAME='hdnFormType' ID='FORMTYPE'>
<INPUT TYPE='hidden' NAME='hdnUser' VALUE='<%=strUser%>'>
<SELECT NAME='sltSalesOrder' onChange='vbscript:document.all("TARGETFORM").submit'.....


on change of select option the data will be submitted to second frame "data" as the TARGET of form is defined as DATA. whenever there is change in select box option, I want to use the 'sltSalesOrder' value in the same jsp page in some java code for passing it a method call like , how do I use the form variable in java code, otherwise after getting request.getParameter("sltSalesOrder) in second jsp of right frame, can I make use of this parameter again in 1st frame jsp.

boolean hasSAPDisjointInspectedParts = (chcec.evm.InspectedPart.getStatusInspectedPartCount(dbconn, status,sltSalesOrder,"", 0))>0;
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can you be doing anything in the 1st frame when it's the second frame that's getting submitted? Do you also submit the 1st frame?

Remember you can do anything in Java or JSP without submitting something back to the server.

What is it that the first frame needs to do?
 
Sujatha Kalluri
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on change of select option, I am submitting the data of the form TARGETFORM to second frame, but I also need the data in the 1st frame where this <form> tag is defined.

I want to use the sltSalesOrder to pass to a java method in the 1st frame , is there any other way to refresh the 1st frame(so that I can get parameter value in 1st frame itself) and also submit the form data to second frame

Sujatha.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use JavaScript in the first frame to refresh the page when the form is submitted to the second (or vice versa).
 
Sujatha Kalluri
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I refresh the 1st frame, can I retrieve the sltSalesOrder value in 1st frame using request.getParameter("sltSalesOrder"), refresh and submit works similarly for retrieving the form parameters?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would need to submit the value to both frames so that it would be available in both.

By the way, frames are really clunky and unwieldily, as you are finding out. I never ever use them. You might want to consider some frameless alternatives for you UI.
 
Sujatha Kalluri
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the frames with jsp pages is desgined already, I cannot change it at this time.. I need to fit my logic into it..

is there way to submit the data to frames simultaneously

Sujatha.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On an onsubmit handler for the form, you can either submit an alternate, hidden form with the data you need, or if a GET is acceptable, redirect.
 
Sujatha Kalluri
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sir... it worked out by submitting another form with hidden variables in the same frame.

Sujatha.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!