Link to home
Start Free TrialLog in
Avatar of cofactor
cofactor

asked on

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 ?


ASKER CERTIFIED SOLUTION
Avatar of suprapto45
suprapto45
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cofactor
cofactor

ASKER

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 ?
Avatar of bloodredsun
>>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.


>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 ?

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


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

Regards
Dave