Solved

Pop-up windows and struts

Posted on 2003-10-31
5
1,458 Views
Last Modified: 2013-11-28
This one is hard - for me! ;-)

In a struts-jsp application, is it possible to work with pop-up windows in this way (just an example):

In a calendar-userinterface you click on a date. A small "date-schedule-window" pops up, and you can change your schedule for that day in that window. On the same time, you can continue to navigate around in the original window. - So you can actually wait as long as you like before you alter the date-schedule, save it and then exit. Is this possible?? Yes?!? How??

This f...s up my mind completely, - normally with struts you navigate around between jsp's and Actionclasses, - but suddenly here the session gets "divided".

Any suggesitions?

Regards,

Nic
0
Comment
Question by:JNic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 14

Expert Comment

by:kennethxu
ID: 9660364
>> Is this possible??
Yes!

>> How??
Just use another action class and another set of jsp page for popup winodw.

>> but suddenly here the session gets "divided".
session never gets divided, but rather the control flow is divided and that's OK.

Let me know if you have more specific question on this.
0
 
LVL 1

Author Comment

by:JNic
ID: 9660912
OH, this is interesting!

>>Let me know if you have more specific question on this.

OK:

Imagine this jsp (example!!):

<A HREF=date.do;jsessionid=<%=request.getSession().getId()%>?date=03041975>04/03/1975></A>

<FORM ACTION=scroll.do;jsessionid=<%=request.getSessoin().getId()%>
<input type="submit" value="scroll">
</FORM>

The link should bring you to the mentioned date-page, and the submit-button just illustrates "something else" you want to to do on the calendar page.
My question is then: How should the link look to make it a (small) pop-up sharing the same session?

Thanks,

Nic

P.S. The reason why I dont use tags to create the link is, that very often in my applications links have to be constructed from Java-generated HTML.
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 150 total points
ID: 9664767
first of all, you should never be encoding you own session url, it might work on one type of server, but not the other. the right approach is to use response.encodeURL().

there is a number of ways to popup a new windows, for example you can use target attribute of html <a> tag. If you want to control the size and style of the popup windows, you can use javascript.

Here is an simple raw example of how this should be done:
<A TARGET=calendar HREF='<%=response.encodeURL( "date.do?date=03041975" )%>' >04/03/1975></A>

A struts specific example:
<html:link target="calendar" action="actionName" paramId="date" paramName="yourbean", paramProperty="property">xxxx</html:link>
detail: http://jakarta.apache.org/struts/userGuide/struts-html.html#link

A JSTL example:
<c:url="date.do" var="myUrl">
      <c:param name="date" value="03041975"/>
</c:url>
<a target='calendar' href='<c:out value="${myUrl}"/>'>xxx</a>

0
 
LVL 1

Author Comment

by:JNic
ID: 9665551
I will quote myself from another thread: Kenneth, "it is SO nice to have you back!"

THANK YOU for your always very detailed and good answers!

Kindest regards,

Nicolai  
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9665855
It's my pleasure and glad to know your problem is solved :-)
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maven project jars 7 62
Best background services 5 185
where can I go to view websites set up with ebook affiliate links? 4 101
mysql jsp example issue 32 96
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
Read about the 3 stages of the buyer's journey: awareness, consideration, and decision.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question