File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Issue while trying to display dynamic section Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Issue while trying to display dynamic section" Watch "Issue while trying to display dynamic section" New topic
Author

Issue while trying to display dynamic section

Sivakumar Subburaman
Greenhorn

Joined: Jun 10, 2011
Posts: 13
Hi,

Currently we have a project in production which is deployed in WAS 6.1. We are trying to migrate that to WAS7

I have a piece of code as given below. if "ShowView" is set to "true", we need to display set of section under that block. All business logic has been written in onPageLoadBegin and at the end, based on certain conditions, we set "ShowView" flag. Acutally what is happening is that, when it comes to the page, it first executes the java piece of code(skips all the code comes under if block) and then control goes to onPageLoadBegin. After executing that method, it does not display those sections, because, java piece of code already executed and those section skipped already.

It is perfectly working in WAS 6.1. I am pretty new to JSF and not sure how exactly preRender and server piece of code works together. Logically, in general, always server piece of code executes first, followed by JSP/Struts code. According to that, what is happening is correct. Since it is working in WAS 6.1 already, am confused.

<hx:scriptCollector id="scriptCollector2" preRender="#{pc_CustomerHistoryView.onPageLoadBegin}">
<h:panelGrid columns="1" rowClasses="rowX1, rowX2">
<%
String showview=(String)request.getAttribute("ShowView");
if(showview != null && showview.equals("true"))
{
%>
//set of JSF tags
<% } %>

Any help appreciated and let me know if you require more info.

Sivakumar Subburaman
Greenhorn

Joined: Jun 10, 2011
Posts: 13
I also tried replacing the java piece of code to JSTL tags for comparision. Still it is the same issue.

<c:set var="showView" value="#{pc_CustomerHistoryView.showView}" scope="page" />
<c:if test="${showView == 'true'}">

Any help appreciated

Regards,
Siva
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue while trying to display dynamic section