• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Update Value from a child window

 
Bhaskar Reddy
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic