Solved

Pop-up windows and struts

Posted on 2003-10-31
5
1,449 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Design of SEO workshop 4 115
excpetion with multiple catch 11 104
maven project jars 7 46
withoutString  challenge 40 146
With a software solution, you always get to control email signatures and have the final say on the design - not an unrelated department or the uninterested end user.
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 …
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…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now