Thanks Anirudh,

Do you mean that the form should have no ActionForm associated with it?
(Currently I am using an ActionForm to pass the value of the contextID)

I did not know that one could pass params to an action with the
"action.do?p1=value&p2=value" technique.


Where does one place the call to the Help() function?
In the form onsubmit() method? Or on the button onclick() method? 

Should it be like this:

<html:form action="/help" method="POST" target="HelpWindow"
onsubmit="javascript:Help()" >
  <html:hidden property="contextID" value="homePage" />
  <map name="Map">
    <area shape="rect" coords="2,0,50,13" href=""
onclick="javascript:document.helpActionForm.submit()">
  </map>
</html:form>



TIA -Adam




-----Original Message-----
From: Anirudh Jayanth [mailto:[EMAIL PROTECTED] 
Sent: 29 June 2004 13:19
To: 'Struts Users Mailing List'
Subject: RE: NEWBIE - How to submit form and display results in popup window
with no browser decorations.


You could use a javascript function to achieve this..

function Help(document,val) {
window.open('Action.do&_contextId='+val,'win','toolbar=no,location=no,di
rectories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,
height=210,left=0,top=0')
}

In the action retrieve the context id as request.getParameter("_contextId");
The dispatch logic then resides in the action


Anirudh Jayanth
SysArris Software 
120A, Elephant Rock Road, 
3rd Block, Jayanagar, 
Bangalore - 560011 
Tel: 6655165 / 052 [ ext - 243 ] 
[EMAIL PROTECTED] 


-----Original Message-----
From: Adam Lipscombe [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 29, 2004 5:16 PM
To: 'Struts Users Mailing List'
Subject: NEWBIE - How to submit form and display results in popup window
with no browser decorations.


Folks,


>From browsing the list archive I can see that this sort of questions
>gets
asked frequently. I looked at the solutions but none seem, to fit my
case:


I am trying to implement a popup window context-sensitive help system for a
struts app.

My solution so far is to have a help button in its own form, and the form
has a hidden "contextID" field. This contextID is stored in the ActionForm
and allows the Action to decide which help screen to display.

This is easy enough do if one just wants a new window (using
target="<WindowName>" in the html:form tag). However the new window has all
the normal browser buttons etc.

e.g.:


 <html:form action="/help" method="POST" target="HelpWindow" >
   <html:hidden property="context" value="homePage" />
    <map name="Map">
      <area shape="rect" coords="2,0,50,13" href="" >
    </map>
  </html:form>


Critically, I want to display the help in a popup window that has no browser
decorations (navigation buttons, text labels  etc). I need to specify the
width and height of the popup.



I looked at Ted Husted's solution "Use Struts JSP Tags to create dynamic
JavaScripts" (http://husted.com/struts/tips/010.htm). 
If I understand this solution correctly, it uses html:rewrite's to call
global forwards that pass parameters to a JSP.  In my case this could work,
but seems to imply that some dispatch logic (i.e. which help page to
display, dependent on the context) resides in the receiving JSP. 
I would rather that the dispatch logic resides in an Action.




How can this be done?


TIA - Adam


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to