Parameter problem.
L.S.
I have got a master page with an idCompany property. When I click an agenda hyperlink the following onClick Javascript code has to be executed:
window.open(?Fitwise/faces/ODAgenda.jsp?idCompany=#{idCompany}? 揰blank? 揾eight=600, resizable=yes, scrollbars=yes, toolbar=yes, width=576?; return false;
and open ODAgenda in a new window displaying the agenda of the company which id was set in the idCompany property in the master page.
In the details page I have also an idCompany property which I try to set with the following code in the prerender() method:
javax.servlet.http.HttpServletRequest req = (javax.servlet.http.HttpServletRequest) getExternalContext().getRequest();
this.idCompany = req.getParameter("idCompany");
For some reason this does not work. Could anyone of you tell me what I am doing wrong?
Thanks Annet.
[883 byte] By [
JagXa] at [2007-11-26 16:55:50]

# 1
Well, this might not be the answer you were looking for, but you might be better off just setting the property in a session bean instead of in a request bean. I had so many problems with losing values in the request bean that I eventually gave up on it, in my current application. But, YMMV, of course.
# 2
Thanks for your reply,
I considered setting the idCompany in the session bean, however, I am afraid of losing control over the idCompany.
The problem is, I present company names as hyperlinks in a table, when the user clicks the hyperlink, the onClick javascript opens a new window with a sort of buisiness card with the company details. In the javascript code I pass the idCompany to the details page using the following bit of code:
....jsp?idBedrijf=#{currentRow.value[慴edrijf.idBedrijf抅}?...
This works fine. On the details page, the user can, amongst others, click a timetable hyperlink. Clicking the hyperlink is supposed to open a new window displaying the company's timetable. (for details see my post above).
The visitor of my site, could leave several windows open, and click on several timetable hyperlinks, one after the other. When I store the idCompany in the session bean, I am not sure whether clicking on a timetable hyperlink, opens the right timetable.
Furthermore, how do I store the idCompany in the session bean, using the onClick event to open a new window. Is it possible to have an action event and an onClick event executed when a user clicks a hyperlink, or do I use either the one or the other.
By the way. Why does this work when the hyperlink is in a table (...jsp?idBedrijf=#{currentRow.value[慴edrijf.idBedrijf抅}?...) and not when it's a hyperlink on the page, and I would like to bind the idCompany to a property?
Thanks Annet.
JagXa at 2007-7-8 23:23:31 >

# 3
>
> By the way. Why does this work when the hyperlink is
> in a table
> (...jsp?idBedrijf=#{currentRow.value[‘bedrijf.idBedrij
> f’]}”,...) and not when it's a hyperlink on the page,
> and I would like to bind the idCompany to a
> property?
>
> Thanks Annet.
currentRow is a TableRowDataProvider that is updated as the table is rendered. Using it outside the table is not a good idea. Your binding should look something like #{Page1.dataProvider1.value['bananna']}