Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Update Value from a child window

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,
I have a peculiar issue with Parent & Child window in struts & tiles.

I have a parent window - that has a dropdown values & a submit button. On click of the button, it must open a popup window which is mostly static (but for a couple of session values) with 2 buttons - 'Continue' and 'Cancel'.

When user clicks on
a. 'Cancel' button, I need to close the popup window w/o doing anything to the parent window.
b. 'Continue' button, I need to close the popup window with the parent window refreshing and deleting the value that was selected in the dropdown before the popup window was shown.
NOTE: The parent window is implemented in struts/tiles whereas the popup is just a jsp page, since the popup is almost static and doesnt have a header/footer like the parent window.

Does any one has any idea on how to go about doing this?
I tried the following ways but without any luck -
1. create a form with a hidden field in the parent and try and set the value from the child javascript function that is called when 'Continue' button is clicked... - This doesnt work since it looses the request value as soon as the child window is closed.
2. Tried with the above in combination with [html:link ../] surronding the [html:img ../] tag - this somewhat works as it opens up a new window from the child window and hence retains the request value...
3. Tried using 2 different actions for 'Continue' and for 'Cancel' button - but this didnt work either... not sure of the exact reason...
 
Bhaskar Reddy
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the code for the above issue -

[CODE]
{struts-config.x ml}
<action path="/account/deleteChoice" type="com.epson.edm.struts.actions.account.DeleteChoiceAction">
<forward name="success" path="deleteSelected"/>
</action>
[/action]

{tiles-defs.xm l }
<definition name="deleteSelected" extends="account.myDef">
<put name="title" value="Account Settings - Delete Selected"/>
<put name="content" value="/WEB-INF/jsp/tiles/account/parent.jsp"/>
</definition>

NOTE: I am not able to add the html/jsp into the forum... in case you wanted the html/jsp code to understand my code issue...
[ August 03, 2007: Message edited by: Bhaskar Reddy ]
 
Bhaskar Reddy
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got this resolved after I created a hidden variable in the parent form which was set using Javascript function calls from both the parent & the popup window button click.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic