Check the archives i answered this question already. The only javascript that i use is
Where "opener" is the keyword <script langauge="javascript"> window.opener.document.forms[0].updateFromNames.value="true"; window.opener.document.forms[0].submit(); window.close(); </script> ----- Original Message ----- From: "Samip Ladhawala" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 16, 2002 3:12 AM Subject: RE: child window problem, URGENT!!!!!! > Hi Guys, > > Thanks for replying. we are trying to acheive this > problem by avoiding javascript and scriplets as much > as possible. Let me explian our scenario: > > We have a JSP page lets call it page 'A' in which we > have 3 fields LastName, FirstName and MiddleName. We > also have a link for search on this page. We have > option that user can enter first few letters of the > last name and search for the person using search link. > We wanted to open a new window lets call it 'B' and > display the names found on the basis of user input. > Now when user double clicks on one name in child > window 'B', that name will be displayed back on to the > parent window i.e. 'A' in the appropriate fields. > > We are using following approach for the above > scenario: > > we have 2 JSP's and 2 formbeans associated to that > JSPs. Now when user enters first few letters of the > LastName on parent form 'A' and clicks search link, we > submit itself i.e. parent Form. We also have one flag > in parent form ,apart from other attributes, whose > value is "false" by default. In action (We use > DispatchAction) we create instance of child form 'B' > and set the attributes for query into it and put that > into session. We make the flag in parent form equal to > "true" and forward the mapping to itself. Now in > parent JSP we use logic tag to check the value of that > flag, if it is true then we call a javascript function > to open a child window 'B'. > Now in child 'B' JSP onload we submit itself i.e. > Child Form with action equal to 'search'. In search > method in action class of child form we talk to the > business delegate and call the method to get the > results for the user input, which is present in the > child form bean, since we set that from parent and put > it in session. Now after we get the possible matches > on the basis of user input from business we forward > the mapping to same page i.e child jsp. Now when user > double clicks the one value from the list, we submit > child form itself with action equal to selectPerson. > In this method we get the parent form from the session > and set the appropriate values in LastName, FirstName > and MiddleName from the selected value and set the > flag in parentform equal to "false". Then thru > javascript in child JSP we are reloading the parent > and closing the child window. This doesn't reload the > parent window with new values in the formbean, which > is being set in child action. We checked the session > using debugger and we found that values in the parent > form are being updated by child action correctly. > > Questions: > 1) Does location.realod()[in javascript] flush the new > values set in the session ? > 2) What is the best way to refresh or submit the > parent from child? > 3) Is there any better way to solve this (By avoiding > use of javascript and scriplets as much as possible)? > > Sorry for long Email. Any help will be appreciated. > > Thanks, > Samip > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Autos - Get free new car price quotes > http://autos.yahoo.com > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>