Solved

Pop-up windows and struts

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
Every business owner understands the significance of online customer reviews and the impact it can have on sales and revenues. With technology advancing at such a rapid pace, getting online reviews has never been easier, especially when many regions…
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…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

679 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