Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Navigation problem in struts

 
Srilakshmi Vara
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I have a input form with an action .do, i donno why the .do is opening another window, i want to close the window onsubmit and refresh the parent window.

can i control anything from struts-config or do i need to control from javascript, if javascript i donno on which event i should write the function because the framework is calling the .do

Help Me please...

Thanks in Advance,
Srilakshmi
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps in your Action class code you are forwarding the request to some other form rather than parent form.

Can you post your struts-config file and Action class code.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The target is specified in the html/javascript and should have nothing to do with Struts specifically.
 
Srilakshmi Vara
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kaur,

Thanks for your reply.

Corresponding actions are..

<action path="/SubmitContact"
type="org.fdny.cts.actions.SubmitContact"
name="contactForm"
scope="request"
validate="true"
input="/jsp/AddCall.jsp">
<forward name="success" path="/DisplayCallStatus"/>
</action>

<action path="/DisplayCallStatus"
type="org.fdny.cts.actions.CallStatus"
name="contactForm"
scope="request" validate="false">
<forward name="success" path="/jsp/CallStatus.jsp"/>
</action>

Action class is pretty much plain one
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, are you using target attribute in html:form tag.

<action path="/SubmitContact"
type="org.fdny.cts.actions.SubmitContact"
name="contactForm"
scope="request"
validate="true"
input="/jsp/AddCall.jsp">
<forward name="success" path="/DisplayCallStatus"/>
</action>

<action path="/DisplayCallStatus"
type="org.fdny.cts.actions.CallStatus"
name="contactForm"
scope="request" validate="false">
<forward name="success" path="/jsp/CallStatus.jsp"/>
</action>


From the struts-config file I can't make out much about the real flow of actions except that first you have some window for SubmitContact and onsubmit of this page, if error then you have AddCall.jsp page otherwise in your action class you might be forwarding to DisplayCallStatus action(another jsp form). On this form submit, your action class is forwarding the request to another page CallStatus.jsp

I don't know if the above analysis will help you much.
 
Srilakshmi Vara
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!!!

Let me explain my problem!!

I have a page1, which displays set of values, page2 is an input form this is called in a popup window from page1. when page2 submit is hit, submit action is opening in another popup window.
instead i want submit action of page1 should come in the same window and after it should refresh the page1

i.e., on submit of page2 i want to refresh page1
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic