My JSF Page Markup
<h:form> <bocrv:reportPageViewer reportSource="#{multiParam.getGetReport(param['reportId'])}" allowParameterPrompting="true"/> </h:form>
The Backing Bean
import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException; import com.crystaldecisions.sdk.occa.report.reportsource.IReportSource; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jboss.seam.annotations.In; import org.jboss.seam.annotations.Name; import javax.faces.context.FacesContext; import javax.servlet.ServletException; import javax.servlet.http.HttpSession; import java.io.IOException; @Name("multiParam") public class MultiParam { private static Log log = LogFactory.getLog(MultiParam.class); @In ReportingServiceImpl reportingService; public IReportSource getGetReport(String id) throws ReportSDKException, IOException, ServletException { log.debug("Report ID: " + id); String reportId; FacesContext facesContext = FacesContext.getCurrentInstance(); HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false); if (session != null) { reportId = (String) session.getAttribute("reportId"); if (StringUtils.isNotEmpty(reportId)) { //found in session return reportingService.getReportSource(reportId); } else if (StringUtils.isNotEmpty(id)) { // get from the request param session.setAttribute("reportId", id); return reportingService.getReportSource(id); } } return null; } }
Now When the JSF page is accessed the first time around It readily prompts for the parameter, But when The parameter is supplied and the ok button is pressed, the form is posted back to itself and the screen asking for parameter is being displayed again.
Can someone please guide me as to where am i going wrong with this...