Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1162
  • Last Modified:

pop up in jsp page

hi,  i want  to use a "more" link in my jsp page. when the user clicks on the "more"  the jsp page will  open a javascript pop up where the user can see all the detailed description of a particular item.  how to do it ?

1) should i  send a sessionid to js pop  up ?
2) should i send the bean where my detailed description is located to the pop up?


i am confused . whats the way to do it ?


0
cofactor
Asked:
cofactor
  • 3
  • 3
1 Solution
 
suprapto45Commented:
Hi,

I think that it is achievable using JSTL.

Well, let say you need to pop up the link as below.

<A HREF="link.html" onClick="popup = window.open('link.jsp', 'PopupPage', 'height=450,width=500,scrollbars=yes,resizable=yes'); return false" target="_blank">

You can actually set the value within the command itself using JSTL. The above codes will look like below.

<A HREF="link.jsp?id=<c:out value="${requestScope.test}" />" onClick="popup = window.open('link.jsp?id=<c:out value="${requestScope.test}" />', 'PopupPage', 'height=450,width=500,scrollbars=yes,resizable=yes'); return false" target="_blank">Links</a>

Then on your jsp or servlet, you can populate the jsp file.

I hope that helps.

Regards
Dave

0
 
cofactorAuthor Commented:
what is  test here ?

suppose i have an item which i want to send to the pop up so that it can show the item image, description, price etc. that means  i need to post a bean to the pop up. how that  can be done ?
0
 
bloodredsunCommented:
>>suppose i have an item which i want to send to the pop up so that it can show the item image, description, price etc. that means  i need to post a bean to the pop up. how that  can be done ?

Having a bean to represent the item is great but I would recommend just passing the itemID in the parameter as suprapto45 recommended --> window.open('link.jsp?id=<c:out value="${requestScope.test}" />' which would become window.open('link.jsp?id=123456" />'.

From this you would do an SQL retrieval of the data and output it into your PopUp template

the other way would be to pass the individual parameters in the popup window, e.g. link.jsp?price=24.99&name=Iron&description=An%20Iron but this may not be practicable.


0
Enhanced Intelligibility Without Cable Clutter

Challenge: The ESA office in Brussels wanted a reliable audio conference system for video conferences. Their requirement - No participant must be left out from the conference and the audio quality must not be compromised.

 
cofactorAuthor Commented:
>Having a bean to represent the item is great but I would recommend just passing the itemID in the parameter as suprapto45 recommended --> window.open('link.jsp?id=<c:out value="${requestScope.test}" />' which would become window.open('link.jsp?id=123456" />'.


hmm ,    i understand the point .  you mean to write an SQL query
in that poped up jsp page with that item id in DB.


is there any necessity of  Session id here ? somewhere i read that u need  u need to send Session id to pop up as well though i am not clear.

do u see any need of it ?

0
 
suprapto45Commented:
Hi,

Thanks bloodredsun for make things cleaner.

"hmm ,    i understand the point .  you mean to write an SQL query
in that poped up jsp page with that item id in DB."

yes, you are right.

"is there any necessity of  Session id here ? somewhere i read that u need  u need to send Session id to pop up as well though i am not clear."

Well, you do not need to have Session id here though (However, I do not see that as necessity). What you can do is that when you populate your first page that contains the pop up link, you should also populate that particular link with the itemID of each specific link.

Does it help you? Please do not hesitate to ask more.

Regards
Dave


0
 
cofactorAuthor Commented:
Hi, thanks .
 great coder. thank you
0
 
suprapto45Commented:
Glad I could help. Credit to bloodredsun too :).

Regards
Dave
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now