You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Manisha Sathe <ma...@yahoo.com> on 2005/02/01 01:06:58 UTC

Re: How to send result into Pop-up window

Thanks a lot, i think i can work this out. Btw, i could not receive the attached file (may be because it is through forum)
 
Would appreciate if can forward attachement again to manisha_msathe@yahoo.com
 
Thanks once again,
 
regards
Manisha
 
 


Keshav Shetty <Ke...@eurodyn.com> wrote:
Hi Manisah,

As I understand this problem is not exactly related to struts but with 
the controlling the flow.
With my knowledge of struts we can't do validation in main page and show 
the report in the
popup screen.

Don't worry I have a alternative solution for this.
Please refer the attached picture in word document which describes the flow.
The explanation is below.
1. Keep the criteria page as it is and let it submit to the Action-1 and 
don't open any popup window.
2. After the validation in Action 1, if the validation fails it will 
goto criteria page with validator message. If everything goes fine then 
forward it to a Dummy JSP.
3. The Dummy JSP will not contain anything but a javascript method to 
load the Action-2 by opening a popup window.
4. Action 2 will load the report page and show on the screen.

Note: Inorder to pass the critirea data between action 1 and 2 you have 
to store the criteria form in the session at execute method of Action 1 
and retrieve at execute method of Action 2.
You can remove this session object when you show the report.

The logic in action 1 will do just validation, store the form in session 
and forward to dummy jsp.
The logic in action 2 will generate the report based on the form by 
retrieving from session.
The dummy jsp may contain just follwoing code.



var winHand = 'someName';
var someWindow = window.open("Action-2",winHand,"menubar=no, 
toolbar=no,scrollbars=no,resizable=no,width=385,height=175,left=300,top=300"); 

document.formName.target= winHand;
document.formName.submit(); 
}


In case if you want to show the criteria page in the main window when 
the report is shown in the popup,
then you can combine criteria and dummyJsp and add some logic tag to 
open the popup window. The logic tag should use the
values which you have to insert in the request object at action 1.

Hope the things are clear.

Please write me if you need any additional info. If any other user knows 
better way please write.

Thanks & regards
Keshav K Shetty





Manisha Sathe wrote:

>Now i get pop-up window but some other problems i am facing
> 
>As u mentioned this will fail if i make use of validator javascript functions on search citeria. 
>I thought i will use serverside validation - but now what's happening is i get validation errors on my new pop-up window and not on my original window- is there any other way do that everything works fine ?
> 
>regards
>Manisha
> 
> 
>
>
>Keshav Shetty wrote:Hi Manisha,
>As I understood your requirement is
>1. In first page you show teh search criteria. User enters all required 
>input and press show report.
>2. The form will be submitted action gets control and retrives required 
>data and forwards to report jsp.
>3. The final report page should come in a separate popup.
>If above requirement is correct then you can use the following mechanism 
>to control the flow.
>
>1. In your criteria page you have a form (I guess) Instead of submitting 
>the form write a javascript function to submit the form and define the 
>target to popup window.
>The javascript function may look like this.
>function submitForm()
>{
>var winHand = 'someName';
>var someWindow = window.open("actionPath",winHand,"menubar=no, 
>toolbar=no,scrollbars=no,resizable=no,width=385,height=175,left=300,top=300"); 
>
>document.formName.target= winHand;
>document.formName.submit(); 
>}
>
>Please replace someName, formName and actionPath with your form values.
>
>But the above technique will fail if the criteria form uses any validation.
>
>Please write me if you need any additional info.
>
>Thanks & regards
>Keshav
>
>Manisha Sathe wrote:
>
> 
>
>>Hi,
>>
>>I am having a serach criteria, depending on that one report will be generated. After Submit it is going to one Action handler and then going to JSP report page. Currently i am displaying it in the same window. But if i want to display result in new window then how can i achieve it ?
>>
>>(I believe this sort of question posted just few days back, but i am not finding it now....Anybody pls can repost it ? )
>>
>>Thanks in advance,
>>
>>Regards
>>Manisha
>>
>>
>>
>>
>>---------------------------------
>>Do you Yahoo!?
>>Yahoo! Search presents - Jib Jab's 'Second Term'
>>
>>
>> 
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
> 
>---------------------------------
>Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> 
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
		
---------------------------------
Do you Yahoo!?
 Yahoo! Search presents - Jib Jab's 'Second Term'