Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Pop-up windows and struts

Posted on 2003-10-31
5
Medium Priority
?
1,461 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 600 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

[Video] Create a Disruption-Free Workspace

Open offices have their challenges. And Sometimes, it's even hard to work at work. It's time to reclaim your office and create a disruption-free workspace. With the MB 660, you can:

-Increase Concentration
-Improve well-being
-Boost Productivity

Question has a verified solution.

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

Online promotion is consistently becoming more important for all types of businesses. From Facebook ads to search engines to YouTube videos, there are all sorts of channels that can effectively be used to promote a business or product. But how shoul…
There are many other benefits to creating an inbound marketing strategy. Let’s take a look at five of the biggest and how they'll affect your business.
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:
An overview of how to create reports in Adobe Analytics (formerly Omniture Site Catalyst) using pageNames, events, eVars and props. This video will show you how to install the Omniture Debugger tool so can see (and test) what is being passed int…

722 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