Re: [solved] [jsf-issue] problem go from jsp page to another jsp in new window

Splash Forums PrettyFaces Users [solved] [jsf-issue] problem go from jsp page to another jsp in new window Re: [solved] [jsf-issue] problem go from jsp page to another jsp in new window

#19990

alynoor
Participant

my problem solved 1- i use 2 managed bean , one of request scope (used in attendReport.jsp ) and the other with session scope (used in printAttendReport.jsp)

2 – add new jsp contains the h:commandLink of the print (attendReportPrintAction.jsp)

3 – divide the view of attendReport.jsp to two subviews (each subview has its own form) one contains inputs and outputs of attend and the other contains include to (attendReportPrintAction.jsp)

<%@ include file=”attendReportPrintAction.jsp” %>

4 – send and get parameters using two methods

{code}

public static Object getSessionMapValue(String key) {

return FacesContext.getCurrentInstance().getExternalConte xt().getSessionMap().get(key);

}

public static void setSessionMapValue(String key, Object value) {

FacesContext.getCurrentInstance().getExternalConte xt().getSessionMap().put(key, value);

}

{code}

faces-config.xml

{code}

<managed-bean>

<managed-bean-name>attendReportBean</managed-bean-name>

<managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>

<managed-bean-scope>request</managed-bean-scope>

</managed-bean>

<managed-bean>

<managed-bean-name>print_attendReportBean</managed-bean-name>

<managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>

<managed-bean-scope>session</managed-bean-scope>

</managed-bean>

<navigation-rule>

<display-name>viewReport</display-name>

<from-view-id>/attend/attendReport.jsp</from-view-id>

<navigation-case>

<from-action>#{AttendReportBean.attendReport}</from-action>

<from-outcome>attendReport</from-outcome>

<to-view-id>/attend/attendReport.jsp</to-view-id>

</navigation-case>

</navigation-rule>

<navigation-rule>

<display-name>printReport</display-name>

<from-view-id>/attend/attendReport.jsp</from-view-id>

<navigation-case>

<from-outcome>printAttendReportAction</from-outcome>

<to-view-id>/attend/printAttendReport.jsp</to-view-id>

</navigation-case>

</navigation-rule>

{code}

attendReportPrintAction.jsp

{code}

<f:subview id=”printAttendReportSubView” >

<h:form id=”printAttendReportForm” onsubmit=”return check222();” >

<table width=”100%” border=”0″ cellpadding=”0″ cellspacing=”0″>

<tr>

<td width=”11%”>

<table width=”70″ border=”0″ cellpadding=”0″ cellspacing=”0″>

<tr>

<td width=”7″ height=”28″><img src=”../images/B-left.gif” width=”7″ height=”28″ /></td>

<td align=”center” background=”../images/B-bg.gif”>

<h:commandLink id=”printLink” value=”طباعة” title=”طباعة” action=”#{print_attendReportBean.printAttendReport Action}” target=”_blank” styleClass=”linksNumBlue”>

</h:commandLink>

</td>

<td width=”7″ height=”28″><img src=”../images/B-right.gif” width=”7″ height=”28″ /></td>

</tr>

</table>

</td>

<td align=”right”> </td>

</tr>

</table>

</h:form>

</f:subview>{code}

i hope this helps someone