External Page Displayed In Page Fragment

Hello,
I am attempting to replicate the method in which frames work by using Page Fragments. I have a header at the top of the page and a "frame" along the left side of the page that allows for navigation. The rest of the web page is an area that updates based on the navigation selection that is made. I would now like to have one of the navigation buttons load a page fragment that contains an external page. Whenever I use getExternalContext().redirect(...) method inside of the Page Fragment, I am totally redirected to the external site and I lose my "frames" functionality. Thanks for the help.
Scott

Page Fragments are not like frames; a page fragment is -inlined- into the document by the server. Look at the source in the browser (View Source); the server sends a single html page to your browser.
If you want frames-like functionality in the browser, you'll need to use frames. You might be able to use iframes too.
-- Tor
http://blogs.sun.com/tor

Similar Messages

  • RegionRenderer encodeAll The region component with id: pt1:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance.

    Hi,
    I am using JDEV 11.1.2.1.0
    I am getting the following error :-
    <RegionRenderer> <encodeAll> The region component with id: pt1:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance. It is recommended that you restructure the page fragment to have a single root component.
    Piece of code is for region is:-
       <f:facet name="second">
                                                <af:panelStretchLayout id="pa1"
                                                                       binding="#{backingBeanScope.Assign.pa1}">
                                                    <f:facet name="center">
                                                        <af:region value="#{bindings.tfdAssignGraph1.regionModel}" id="r1"
                                                                   binding="#{backingBeanScope.Assign.r1}"/>
                                                    </f:facet>
                                                </af:panelStretchLayout>
                                            </f:facet>
    How do I resolve it ?
    Thanks,

    Hi,
    I see at least 3 errors
    1. <RegionRenderer> <encodeAll> The region component with id: pt1:r1 has detected a page fragment with multiple root components.
    the page fragment should only have a single component under the jsp:root tag. If you see more than one, wrap them in e.g. an af:panelGroupLayout or af:group component
    2. SAPFunction.jspx/.xml" has an invalid character ".".
    check the document (you can open it in JDeveloper if the customization was a seeded one. Seems that editing this file smething has gone bad
    3. The expression "#{bindings..regionModel}" (that was specified for the RegionModel "value" attribute of the region component with id "pePanel") evaluated to null.
    "pageeditorpanel" does seem to be missing in the PageDef file of the page holding the region
    Frank

  • Conditional display in  page fragments

    Hi all,
    I have to include a page fragment in one of the pages of my application.
    Certain elements in the page fragment should be displayed based on certain conditions only.
    How can this be done ?
    Thanks in advance
    Ananya

    HI Ananya...
       You can definitely do this....
    You have got two option..
    1. If the Condition is known to you before displaying the page at the first attempt...
    Define an attribute of STRING type say it HID_FLAG
    inside the event ONCREATE...
    On the basis of the condition set the flag to TRUE if want to display that region..otherwise..set it to FALSE..
    Now inside the PAGE LAYOUT....
    <% IF HID_FLAG = 'TRUE'. %>
    Between this define the portion of your layout that you want to show on the basis of condition...
    <% ENDIF. %>
    2. Another option is that you dont know the condition initially....and the condition is defined on the  ONINPUTPROCESSING.....
    For this you can set that flag on the EVENT HANDLING....
    Hope it solve your problem .....Otherwise do revert back....
    Cheers:)
    Mithlesh

  • Displaying external page as portlet

    How do I display an external page like 'http://www.wsj.com" as a opened page in a portlet as opposed to a link?

    You have 3 choices for doing this:
    1) You can use the dump URL portlet that comes with the PDK.
    2) If you want to show only part of a page (ie. get rid of advertisements and misc. other junk) you could build a PL/SQL portlet using UTL_HTTP to call the page, parse out the good stuff and display it as a portlet.
    3) If you are know your user population and know that they are using IE or newer versions of Netscape, you can make an HTML portlet, and add the URL as part of an Iframe, for example:
    <IFRAME src="http://www.yahoo.com" height=500 width=500></IFRAME>

  • How can I do a dynamic include of a page fragment?

    I have a technical support website with a lot of simple html pages. What I want to do is hyperlink from the index page to another page, which would display these html pages as a page fragment, dynamically based on a session bean set by the hyperlink.
    I basically want to do this, if it was possible:
    <jsp:directive.include file="#{SessionBean1.pageToDisplay}"/>
    Now the FAQ's has a topic "How can I do a dynamic include of a page fragment?", which would seem to answer my question.
    But this is all it says, and it makes no sense to me. Could someone please translate? :)
    "Using a page fragment file (but using instead of the usual Creator approach) will accomplish a dynamic include."

    Here is 1 solution:
    First add this to the jsp:root tag:
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    Then surround the page fragment directive with something like this:
                            <div style="position: absolute; left: 24px; top: 408px">
                                <c:if test="${SessionBean1.count > 0}">
                                    <jsp:directive.include file="testPF.jspf"/>
                                </c:if>
                            </div>

  • Is it possible to access getRequestBean1 from a component in page fragment?

    Hi,
    Assume I have two pages, the first page has a button (say button1) among other components; the second page contains a page fragment which has a button (say button2) in it.
    In the button1 action, I set the value for a property (say X) which has request bean scope. When I click this button, the navigation will lead to the second page.
    I then tried to retrieve the value using getRequestBean1( ).getX() in the button2 action. To my disappointment, I found that getX( ) always return null.
    I know I may be able to overcome this by making X a session scope property, but I would be grateful if somebody could shed some light on this problem.
    Many thanks.
    Xiaoyan

    Your problem is not related to page fragments. It has to do with the lifetime of a request bean. Here is an excerpt from http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/scopes.html
    Request scope begins when the user submits the page and ends when the response is fully rendered, whatever page that is.
    When you clicked the button on page 1 which submitted the page, the request bean was instantiated. When the response for page 2 was sent to the browser, the request bean's life ended. That is, it is no longer around after the page is displayed.
    One of the ways you can keep the value around for the subsequent submission is to add a hidden field to the page fragment.
    Bind the hidden field to the request bean's property. Then have something like this in the action method
    public String button2_action() {
    staticText1.setText( hiddenField1.getText());
    return null;
    You might want to read the above mention tutorial to learn more about scope and managed beans.

  • How can I include a dynamic content in the page fragment?

    My header.jspf contains codes similar to the following in the init() method:
    Object o =getValue("#{sessionScope.username}");
    if(o!=null){
    greetingStaticText.setRendered(true);
    }else{
    greetingStaticText.setRendered(false);
    But this code is not working as expected.
    I tried the following in the jsp page, but still no use:
    <jsp:include page="../Header.jspf"/>
    Thanks.

    Before the initial render, your logic sets rendered false. Then on the postback when the user logs in, init executes (setting it false again); the static text is overwritten with the corresponding static text object from the component tree; and subsequently the action method executes (setting username in session); the page redisplays, with rendered still false. You can overcome this by setting the rendered property from your action method. Here are steps that simulate the solution:
    1. Create a property in SessionBean1 called username of type String.
    2. Drag a Page Fragment Box onto Page1. Create a fragment called Fragment1.
    3. Drag a Hyperlink onto Page1. Set its text to "Go to Login Page" and its url property to /faces/Login.jsp.
    4. Double-click to edit Fragment1.
    5. Drag a Static Text. Set its id to greetingText and its text to "Welcome, #{SessionBean1.username}!"
    6. Drag a Hyperlink. Set its id to logoutHyperlink and its text to "Logout"
    7. Double click the logoutHyperlink and use the following code:
    public String logoutHyperlink_action() {
    getSessionBean1().setUsername(null);
    greetingText.setRendered(false);
    logoutHyperlink.setRendered(false);
    return "Page1";
    8. Append the following to Fragment1.init():
    String username = getSessionBean1().getUsername();
    greetingText.setRendered(username != null);
    logoutHyperlink.setRendered(username != null);
    9. Implement these two methods as follows:
    public void setGreetingText(StaticText st) {
    boolean rendered = this.greetingText.isRendered();
    st.setRendered(rendered);
    this.greetingText = st;
    public void setLogoutHyperlink(Hyperlink h) {
    boolean rendered = this.logoutHyperlink.isRendered();
    h.setRendered(rendered);
    this.logoutHyperlink = h;
    10. Create a new page called Login.
    11. Drag a Page Fragment Box onto Login.jsp (choose Fragment1.jspf).
    12. Drag a Text Field and bind its text property to #{SessionBean1.username}
    13. Drag a button. Set its id to loginButton and its text to "Login"
    14. Double-click loginButton and use the following code:
    public String loginButton_action() {
    ((UIComponent)getValue("#{Fragment1.greetingText}")).setRendered(true);
    ((UIComponent)getValue("#{Fragment1.logoutHyperlink}")).setRendered(true);
    return "Page1";
    15. Open Page Navigation and create an outcome called "Page1" that goes from Login.jsp to Page1.jsp.
    16. Run the app.
    17. Page1 displays with no greeting text. Click the "Go to Login Page" link.
    18. Type "misty" in the text field and click the Login button.
    19. Page1 displays, this time with the greeting text "Welcome, misty!" and a Logout hyperlink.
    20. Click the Logout hyperlink to logout. Page1 displays, this time with no greeting text or Logout hyperlink.

  • Page Fragment not appearing in Page Navigation!!

    My project contains a Page Fragment named Logo.jspf which is intended to be displayed on the top of every page in my project.
    I have a Link Action element on Logo.jspf and when clicked it should load Login.jsp only if the user is not loged in, and if the user is already loged in it should load some other page. I aware that I have to add codes in the action listener method in Logo.java.
    As the Page Fragment (in my case that is Logo.jspf) is not appearing in Page Navigaton window it is not possible to add code like following: (Because I cannot visually draw an arrow with name �login� from �Logo.jspf� to �Login.jsp�)
    public String linkAction1_action() {
    return �login�;
    Please anyone help to do this. Thank you very much.

    To forward to a particular page from a servlet we usually use codes similar to the following:
    request.getRequestDispatcher("/Login.jsp").forward(request, response);
    How can I get rhe request object (or the session object) from a bean in a JSC project?
    Any suggestions very much appreciated. Thank you very much.

  • "detected a page fragment with multiple root components" warning

    I am getting a warning on the standalone WLS when I run my page that contains a taskflow as region. I am using a page fragment in my taskflow.
    <Warning> <oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer> <ADF_FACES-60099> <The region component with id: ptMain:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance. It is recommended that you restructure the page fragment to have a single root component.>
    The warning states the obvious, I have everything within a panelheader in my page fragment. Also, I do not get the warning on the integrated WLS. Any ideas as to why this warning is still popping up in the log? I am using JDev 11.1.1.3.
    Thanks,
    Jessica

    Thank you for responding. I do not have any popups. I do, however, have another region nested within this fragment ( have this warning on another fragment that doesn't have a nested region though). Here is the code for my fragment.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core">
    <af:panelHeader text="Pawn"
    binding="#{backingBeanScope.backing_Fragments_PawnSearch.ph1}"
    id="ph1" type="default">
    <af:panelFormLayout id="pfl2">
    <af:panelSplitter binding="#{backingBeanScope.backing_Fragments_PawnSearch.ps1}"
    id="ps1" orientation="vertical" splitterPosition="62"
    inlineStyle="width:775px; height:660px;">
    <f:facet name="first">
    <af:panelBox text="Search #{bindings.agency.inputValue} Data to Update"
    binding="#{backingBeanScope.backing_Fragments_PawnSearch.pb1}"
    id="pb1">
    <f:facet name="toolbar"/>
    <af:panelGroupLayout id="pgl3" layout="horizontal">
    <af:inputText value="#{bindings.control_number.inputValue}"
    label="Control Number" required="true"
    columns="#{bindings.control_number.hints.displayWidth}"
    maximumLength="#{bindings.control_number.hints.precision}"
    shortDesc="#{bindings.control_number.hints.tooltip}"
    id="it1">
    <f:validator binding="#{bindings.control_number.validator}"/>
    </af:inputText>
    <af:inputDate value="#{bindings.trans_date.inputValue}"
    label="Date" required="true"
    shortDesc="#{bindings.trans_date.hints.tooltip}"
    id="id1">
    <f:validator binding="#{bindings.trans_date.validator}"/>
    <af:convertDateTime pattern="#{bindings.trans_date.format}"/>
    </af:inputDate>
    <af:inputText value="#{bindings.agency.inputValue}" simple="true"
    required="#{bindings.agency.hints.mandatory}"
    columns="#{bindings.agency.hints.displayWidth}"
    maximumLength="#{bindings.agency.hints.precision}"
    shortDesc="#{bindings.agency.hints.tooltip}"
    binding="#{backingBeanScope.backing_Fragments_PawnSearch.it2}"
    id="it2" visible="false">
    <f:validator binding="#{bindings.agency.validator}"/>
    </af:inputText>
    <af:commandButton actionListener="#{bindings.ExecuteWithParams.execute}"
    text="Search"
    disabled="#{!bindings.ExecuteWithParams.enabled}"
    id="cb5"
    returnListener="#{backingBeanScope.backing_Fragments_PawnSearch.refreshPage}"
    action="#{backingBeanScope.backing_Fragments_PawnSearch.RenderMe}">
    <af:setActionListener from="#{bindings.PawnItemView1Iterator.currentRowKeyString}"
    to="#{requestScope.pawnkey}"/>
    </af:commandButton>
    <af:spacer width="10" height="10"
    binding="#{backingBeanScope.backing_Fragments_PawnSearch.s1}"
    id="s1"/>
    <af:goButton text="Clear Values and Create New" id="gb1"
    destination="index.jspx"
    rendered="#{backingBeanScope.backing_Fragments_PawnSearch.saveButtonRendered}"/>
    </af:panelGroupLayout>
    </af:panelBox>
    </f:facet>
    <f:facet name="second">
    <af:panelGroupLayout binding="#{backingBeanScope.backing_Fragments_PawnSearch.pgl4}"
    id="pgl4" layout="scroll" partialTriggers=""
    visible="true">
    <af:panelGroupLayout binding="#{backingBeanScope.backing_Fragments_PawnSearch.pgl6}"
    id="pgl6" inlineStyle="width:775px;"
    visible="#{backingBeanScope.backing_Fragments_PawnSearch.renderTF}">
    <af:region value="#{bindings.PawnEntryFormTF1.regionModel}"
    id="r1" inlineStyle="width:750px;"/>
    </af:panelGroupLayout>
    <af:panelGroupLayout binding="#{backingBeanScope.backing_Fragments_PawnSearch.pgl5}"
    id="pgl5" layout="horizontal"
    visible="#{backingBeanScope.backing_Fragments_PawnSearch.renderMessage}">
    <af:outputFormatted value="No #{bindings.agency.inputValue} Pawn data matching the Control Number and Transaction Date from above."
    binding="#{backingBeanScope.backing_Fragments_PawnSearch.of1}"
    id="of1"
    inlineStyle="font-weight:bolder; font-size:small;"/>
    <af:spacer width="10" height="10"
    binding="#{backingBeanScope.backing_Fragments_PawnSearch.s2}"
    id="s2"/>
    <af:goButton text="Clear Search and Start Again"
    binding="#{backingBeanScope.backing_Fragments_PawnSearch.gb2}"
    id="gb2" destination="index.jspx"/>
    </af:panelGroupLayout>
    </af:panelGroupLayout>
    </f:facet>
    </af:panelSplitter>
    </af:panelFormLayout>
    </af:panelHeader>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_Fragments_PawnSearch-->
    </jsp:root>

  • Bounded-Task-Flow Page Fragment Control Flow Help

    jDeveloper: 11.1.1.0.2
    I am having an issue trying to figure out the correct way to use control flow cases between a bounded-task-flow with page fragments and an unbounded-task-flow page. We have taken the approach in our application to have a few shell / container pages to host bounded-task-flows made up of page fragments to facilitate re-usability and to speed up development. There are 4 or 5 shell pages on the applications unbounded-task-flow. As of now, we have about 20 page fragments that are implemented as bounded-task-flows. These fragments don't do much now, meaning there is only a single fragment in each bounded-task-flow. The issue I am having is trying to invoke a control flow navigation action from one of the fragments to load a different shell page.
    For Example, shellPage1.jspx contains fragment-flow-1 as a region. In my adfc-config.xml I have shellPage1.jspx and shellPage2.jspx, with control flow cases "toShell1" and "toShell2" respectively connecting the two pages. I have a link's action bound to the "toShell2" within the fragment that makes up fragment-flow-1. When the application is run, shellPage1.jspx and its fragment are displayed. But clicking on the link in the fragment ("toShell2") does absolutely nothing. It does not navigate me to the shellPage2.jspx as expected. What am I doing wrong here or do not understand?
    If the fragment is included as a JSP include, and not a bounded task flow include, everything works as expected. This is not desirable as we then need to copy the fragment's pageDef into the shellPage's pageDef to get the DataControls to function.
    If the faces-config.xml is used instead, and a JSF navigation case is used, it will also work as expected. This is not desirable because we really don't want to be mixing adcf-config and faces-config.
    So I am really stumped here.... Thanks in advance!

    Hi there:
    In your case, the adfc-config.xml has the control flow case between shell pages. And the task-flow-N.xml or your-task-flow.xml for each page fragment by default doesn't inherit control flow case from their containing shell page. In your case, in the page fragment task-flow.xml, you should add a "Parent Action" to flow to shell page2 for example. The outcome of "Parent Action" would be "toShell2" if calling from ShellPage1 page fragment.
    Is this 'Correct' or 'Helpful' for you? Please mark it as so if it does.
    Good luck,
    Alex

  • Printing Report via page fragment instead of .jspx

    Hi, I am using Jasper reports for printing the report for each selected patient in a table in my software, When I call the printing method from a .jspx button it works, but when i do the same work in a page fragment than my report did not run. Anyone can help me Please? (Jdeveloper studio 11.1.2.0.0) and Ireport (4.0.1)

    Code for page fragment:
    <?xml version='1.0' encoding='UTF-8'?>
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core">
    <af:outputText value="Print Report" id="ot1"/>
    <af:commandButton text="print appointment" id="cb1" action="#{JasperBeanPrinting.runReportAction}"
    partialSubmit="true"/>
    <af:panelCollection id="pc1">
    <f:facet name="menus"/>
    <f:facet name="toolbar"/>
    <f:facet name="statusbar"/>
    <af:table value="#{bindings.Patients.collectionModel}" var="row" rows="#{bindings.Patients.rangeSize}"
    emptyText="#{bindings.Patients.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.Patients.rangeSize}" rowBandingInterval="0"
    filterModel="#{bindings.PatientsQuery.queryDescriptor}"
    queryListener="#{bindings.PatientsQuery.processQuery}" filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.Patients.collectionModel.selectedRow}"
    selectionListener="#{bindings.Patients.collectionModel.makeCurrent}" rowSelection="single" id="t1">
    <af:column sortProperty="#{bindings.Patients.hints.PatientId.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.PatientId.label}" id="c1">
    <af:outputText value="#{row.PatientId}" id="ot2">
    <af:convertNumber groupingUsed="false" pattern="#{bindings.Patients.hints.PatientId.format}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.Dob.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.Dob.label}" id="c2">
    <f:facet name="filter">
    <af:inputDate value="#{vs.filterCriteria.Dob}" id="id1">
    <af:convertDateTime pattern="#{bindings.Patients.hints.Dob.format}"/>
    </af:inputDate>
    </f:facet>
    <af:outputText value="#{row.Dob}" id="ot3">
    <af:convertDateTime pattern="#{bindings.Patients.hints.Dob.format}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.ContactNo.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.ContactNo.label}" id="c3">
    <af:outputText value="#{row.ContactNo}" id="ot4"/>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.Gender.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.Gender.label}" id="c4">
    <af:selectOneChoice value="#{row.bindings.Gender.inputValue}" label="#{row.bindings.Gender.label}"
    required="#{bindings.Patients.hints.Gender.mandatory}"
    shortDesc="#{bindings.Patients.hints.Gender.tooltip}" readOnly="true" id="soc1">
    <f:selectItems value="#{row.bindings.Gender.items}" id="si1"/>
    </af:selectOneChoice>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.Address.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.Address.label}" id="c5">
    <af:outputText value="#{row.Address}" id="ot5"/>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.PatientName.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.PatientName.label}" id="c6">
    <af:outputText value="#{row.PatientName}" id="ot6"/>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.DistrictName.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.DistrictName.label}" id="c7">
    <af:outputText value="#{row.DistrictName}" id="ot7"/>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.ProvinceName.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.ProvinceName.label}" id="c8">
    <af:outputText value="#{row.ProvinceName}" id="ot8"/>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.Status.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.Status.label}" id="c9">
    <af:outputText value="#{row.Status}" id="ot9"/>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.Unit.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.Unit.label}" id="c10">
    <af:outputText value="#{row.Unit}" id="ot10"/>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.Rank.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.Rank.label}" id="c11">
    <af:outputText value="#{row.Rank}" id="ot11"/>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.IdCard.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.IdCard.label}" id="c12">
    <af:outputText value="#{row.IdCard}" id="ot12"/>
    </af:column>
    <af:column sortProperty="#{bindings.Patients.hints.ArmyNo.name}" filterable="true" sortable="true"
    headerText="#{bindings.Patients.hints.ArmyNo.label}" id="c13">
    <af:outputText value="#{row.ArmyNo}" id="ot13"/>
    </af:column>
    </af:table>
    </af:panelCollection>
    </ui:composition>
    Code of Printing Bean:
    import java.io.ByteArrayOutputStream;
    import java.io.InputStream;
    import java.sql.Connection;
    import java.util.HashMap;
    import java.util.Map;
    import javax.faces.context.FacesContext;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServletResponse;
    import javax.sql.DataSource;
    import net.sf.jasperreports.engine.JasperExportManager;
    import net.sf.jasperreports.engine.JasperFillManager;
    import net.sf.jasperreports.engine.JasperPrint;
    import net.sf.jasperreports.engine.JasperReport;
    import net.sf.jasperreports.engine.type.WhenNoDataTypeEnum;
    import net.sf.jasperreports.engine.util.JRLoader;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.binding.BindingContainer;
    import java.io.File;
    import java.util.HashMap;
    import net.sf.jasperreports.engine.JRException;
    import net.sf.jasperreports.engine.JasperCompileManager;
    import net.sf.jasperreports.engine.JasperFillManager;
    import net.sf.jasperreports.engine.JasperPrint;
    import net.sf.jasperreports.engine.JasperReport;
    import net.sf.jasperreports.engine.*;
    import net.sf.jasperreports.engine.util.JRLoader;
    import net.sf.jasperreports.engine.util.JRSaver;
    import net.sf.jasperreports.engine.xml.*;
    import net.sf.jasperreports.engine.design.JasperDesign;
    import net.sf.jasperreports.engine.export.JRPdfExporter;
    import net.sf.jasperreports.engine.export.JRPrintServiceExporter;
    import net.sf.jasperreports.engine.export.JRPrintServiceExporterParameter;
    import net.sf.jasperreports.view.JRViewer;
    import net.sf.jasperreports.view.JasperDesignViewer;
    public class JasperBeanPrinting
    public JasperBeanPrinting()
    public String runReportAction()
    DCIteratorBinding empIter = (DCIteratorBinding) getBindings().get("PatientsIterator");
    String empId = empIter.getCurrentRow().getAttribute("PatientId").toString();
    Map m = new HashMap();
    m.put("patientId", empId);// where employeeId is a jasper report parameter
    try
    runReport("report2.jasper", m);
    catch (Exception e)
    return null;
    public BindingContainer getBindings()
    return BindingContext.getCurrent().getCurrentBindingsEntry();
    public Connection getDataSourceConnection(String dataSourceName)
    throws Exception
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup(dataSourceName);
    return ds.getConnection();
    private Connection getConnection() throws Exception
    return getDataSourceConnection("jdbc/pmrDS");// datasource name should be defined in weblogic
    public ServletContext getContext()
    return (ServletContext)getFacesContext().getExternalContext().getContext();
    public HttpServletResponse getResponse()
    return (HttpServletResponse)getFacesContext().getExternalContext().getResponse();
    public static FacesContext getFacesContext()
    return FacesContext.getCurrentInstance();
    public void runReport(String repPath, java.util.Map param) throws Exception
    Connection conn = null;
    try
    HttpServletResponse response = getResponse();
    ServletOutputStream out = response.getOutputStream();
    response.setHeader("Cache-Control", "max-age=0");
    response.setContentType("application/pdf");
    ServletContext context = getContext();
    InputStream fs = context.getResourceAsStream("/reports/" + repPath);
    JasperReport template = (JasperReport) JRLoader.loadObject(fs);
    template.setWhenNoDataType(WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL);
    conn = getConnection();
    JasperPrint print = JasperFillManager.fillReport(template, param, conn);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    JasperExportManager.exportReportToPdfStream(print, baos);
    out.write(baos.toByteArray());
    out.flush();
    out.close();
    FacesContext.getCurrentInstance().responseComplete();
    catch (Exception jex)
    jex.printStackTrace();
    finally
    close(conn);
    public void close(Connection con)
    if (con != null)
    try
    con.close();
    catch (Exception e)
    Edited by: 967034 on Apr 16, 2013 6:27 AM

  • Need solution for Use Case - Page Fragment?

    I have a set of controls and table which I need to insert into many tabs such that each tab displays the same table and functions but with slightly different data. The controls and table could be used in many different areas so doesn't make sense to code each and everyone mutiple times. I thought then that making this set of functions a page fragment and including it would do the trick, however, an exception that I have the same ID's defined was raised.
    Can someone tell me what technology I should use for this use case such that one a single page with tabs I can include the same set of controls many times? Can page fragments be used multiple times on one page or do I need some sort of declarative component?
    Thank you,
    Kris

    Task Flows is the way to go...
    Just create a bounded task flow and create a default view activity (which is going to be your page fragment with table and other controls).
    Now you can drop this TF on every tab and this way you will get a resuable table and control.
    Read about Task flows in dev guide if you need further understanding on this.
    One more thing, this will give you exactly same stuff on each tab. So, I am not sure what you want to change in every tab? A detailed description of your requirement might help.
    Vik
    Hope this helps
    http://adfjsf.blogspot.com
    http://www.linkedin.com/groupSharingMsg?displayCreate=&connId=-1&groupID=1801839

  • Unable to acess page fragraments bindings of included page fragment

    Hi All,
    We are using Jdeveloper 11.1.1.5.0
    I have included a page fragment(say JSFF2) inside a page fragement one(JsFF1).
    Issue is, bindings defined in the page defination of JSFF2 is not getting picked up
    when jsff1 is rendered on UI.
    Can any one please help how we can include the page defination of J2FF2 inside the
    pagedefination of JsFF1, without using the regions?
    used declarative component to add the page
    <af:declarativeComponent viewId="/com/panduit/spa/pageFragments/spaMaintaince/PartsPricing.jsff"
    id="dc1"/>
    Thanks,
    Chandana

    Thanxz for the response.
    I have two jsff page parentjsff and childjsff. Using declarative component i have include child jsff in parent jsff.
    On my my child jsff , I have table which based on transient VO.No data is being displayed in the table, when I run my JSPX that contains parent JSFF.
    But when Ii include transient VO iterator in my parents jsff page def, then only data is being displayed.
    Thanxz
    Chandana

  • CSS with page fragments does not seem to work

    Hi,
    I am using creator 2 update 1 and I have some problems setting styleClass to a page fragment, I read some older posts about this issue but I couldn't find a solution for this.
    I have a navigation fragment that holds simple hyperlinks inside.
    I want to give all the hyperlinks the same background-image so I create a new entry in the default resources/stylesheet.css of my project and try to set it to each hyperlink in its styleless entry in its properties.
    1. first you can't choose a styleClass for the fragment when clicking on (...) - it does not show any style class
    2. when I just set it by hand to the property , the creator does not have an effect on the hyperlinks (their style is not changed) , if I put for each hyperlink in its "Inline" style (property style) all the values that defined in the styleClass I want to use then the results are fine but this mean I need to take care of the style for each hyperlink alone and not use the styleClass ...
    Any ideas?
    thanks.

    OK, I found what the problem was: the URL to the background-image was wrong, only when I picked the image through the css editor it got the correct URL to the image and displayed it in all the hyperlinks

  • Threadinar10 - Page Separator, Page Fragment Box , Tab Set & Tab Components

    Hi All,
    This is the tenth in the Threadinar series. See the Components Threadinar Index at http://forum.sun.com/jive/thread.jspa?threadID=103424 for the complete list to date.
    This Threadinar will discuss 4 components in the "Components Palette: Layout Section" section of the Creator Component Catalog.
    The components we will focus on today are
    "Page Separator", "Page Fragment Box" , "Tab Set" & "Tab" Components.
    Let us begin our discussion with the "Page Separator" Component.
    Page Separator Component
    You can drag the Page Separator component from the Palette's Layout category to the Visual Designer to create a horizontal line that resizes to any page width selected by the user. This component is the visual equivalent of an HTML <hr> tag.
    In the page bean, a Page Separator component is a PageSeparator object.
    * Note: If you want to use an HTML <hr> tag, drop a Meta component on the page and set its tag property to hr.
    [b]Page Fragment Box Component
    This component enables you to include a page fragment in a page. A page fragment is a separate, reusable part of a page that can be included in any number of pages. For example, you might want to put a common a visual element like a header graphic in a page fragment and then include it in all the pages in an application.
    When you drag the Page Fragment Box component from the Layout category of the Palette and drop it on a page, the Select Page Fragment dialog box prompts you for the name of the page fragment to be included. You can enter the name of an existing page fragment or create a new page fragment. If you create a new page fragment, the IDE gives the new fragment a .jspf file suffix and creates a node for it in the Projects window, as well as adding the page fragment to the Outline window.
    * Note: A Page Fragment Box component simply includes a page fragment in a page. Deleting a Page Fragment Box component from a page does not delete the page fragment itself, even if you originally used the Select Page Fragment dialog box to create the page fragment.
    After dropping a Page Fragment Box component on the page, if you click inside the component, you see the properties for the included fragment. If you click the border of the component, you see the properties for the enclosing <div> block. You can also use the Outline window to select the enclosing block, the page fragment, or the components in the page fragment. In the Outline window, the Page Fragment Box component is represented by a node named directive.include:fragment-file.jspf, where fragment-file is the name of the page fragment file.
    If you double-click the page fragment, it opens as a page in the Visual Editor, enabling you to edit it like a regular page. The page fragment has an associated JavaBeans object, a page fragment bean, which you can edit by clicking the Java button at the top of the page fragment when it is open in the Visual Editor. As with a regular page, if you drop a component like a button in a fragment, double clicking adds an event handler in the page fragment bean, enabling you to reuse the code on any page to which you add the page fragment. A common scenario for reusing component code would be a Search Box fragment that has a search Label, a Text Field where the user enters the search string, some Inline Help, and search logic code in the page fragment bean.
    * The tab order of the components in the page is unlikely to work properly unless you enclose the entire page fragment box in the Faces Verbatim component.
    For more details see tutorial : "Using Page Fragments"
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/pagefragments.html
    [b]Tab Set Component
    The Tab Set component in the Palette's Layout category is a container for a set of Tab components. Typical uses of a tab set are:
    * To provide alternate sets of components on the same page and enable the user to navigate to them by clicking on tabs. The user sees only the components under the currently selected tab. For more information on adding components to tabs, see Tab Component.
    * To navigate among a set of pages. If you use a tab set this way, you would usually have the tab set near the top of each page with the component's width set at 100%. You would use the Page Navigation editor to define each tab to display a page in the application, with the current page's tab set as the selected tab. In addition, you would need to delete the default Layout Panel component under each tab so the tab would display the page contents.
    You can set Tab Set properties in the component's Properties window.
    A Tab Set component contains Tab Components, and Tab components can contain other Tab components. You can see these components displayed as hierarchical nodes in the Outline window after you add a Tab Set to your page.
    You can add a new tab to a tab set in two ways, by right-clicking the Tab Set component and choosing Add Tab or by dropping a new tab component on the Tab Set or on a Tab component.
    You can drop a new tab component on a tab set in the Visual Designer to the right or left of existing tabs to create a new tab at that level. The tabs in a tab set can also be containers for other tabs. If you drop a Tab component on an existing tab, the new tab becomes a child of the tab on which you dropped it. The maximum number of levels for tabs is three.
    The tab set component determines which tab is rendered as selected, storing the value in the selected property. By default, the selected property is set to the first tab created for the component. If you click a tab while designing your web page, that tab becomes the selected tab. You can tell during design time that a tab is selected because its color changes.
    [b]Tab Component
    A Tab is part of a Tab Set component. You can add a new tab to a tab set in two ways, by right-clicking the Tab Set component and choosing Add Tab or by dragging a new Tab component from the Layout category of the Palette and dropping it on the Tab Set or on another Tab component. You can also drag from the Palette and drop the tab on the tab set's nodes in the Outline window.
    * If you drop the Tab component to the left or right of an existing tab, it is added to the same row of tabs.
    * If you drop the Tab component on an existing tab, the dropped tab becomes a child tab of the tab on which you drop it unless the existing tab is a third level tab. You can have at most three levels of tabs in a tab set.
    o Note: You cannot add a child tab to a tab that has components in its Layout Panel. When you drop a tab on an existing tab component that has an empty Layout Panel, the empty Layout Panel is deleted to make room for the dropped tab.
    By default, a Tab component has a Layout Panel below it where you can drop components that will be displayed when the user selects the tab. The Layout Panel by default has its panelLayout property set to Grid Layout, meaning that components dropped on the panel are aligned at the location where they are dropped. You can change the layout behavior by setting the panelLayout property to Flow Layout, which aligns dropped components left to right in rows. For more information on Layout Panel properties, see Layout Panel Component Properties Window.
    To select a tab in a tab set, either click the Tab component on the page or select the Tab component's node in the Outline window. To select the whole tab set, either click the border of the Tab Set component on the page or select the tab set's node in the Outline window. Alternatively, you can select a Tab component and either press Escape or right-click and choose Select Parent to select its parent component.
    * Note: If you select a tab on a page in the Visual Designer, a side effect is that it becomes the selected tab. If this effect is not what you want, select the tab in the Outline window so you can set its properties.
    You can drag tabs in the Outline window to change their location and level in the tab set.
    Some typical uses of tabs:
    * You can drop components on the Layout Panel component below a tab to enable a set of components to be displayed below each tab. When the user selects a tab, they see only the components that are associated with the tab, without having to change pages.
    * You can use a tab set to navigate among a set of pages. Each tab component links to a page in your web application. You would use the Page Navigation editor to define each tab to display a page in the application, with the current page's tab set as the selected tab. If you want to use the tab set for page navigation, be sure to delete each tab component's Layout Panel.
    You can also right-click the Tab component and choose one of the following options:
    * Edit action Event Handler. Code the action event handler, the method that is called when the user clicks the tab. This method determines which page or resource to open based on specified conditions. The action method typically processes mouse clicks and returns a string indicating the name of a page navigation case (the page in your application to display next). The default name for the method is tab-id_action, where tab-id is the value of the tab's id property.
    * Bind to Data. Dynamically set the text that appears on the tab. You can bind the component's text property to an object or a data provider, as described in the topic Bind to Data Dialog Box.
    * Property Bindings. Opens a dialog box that enables you to bind properties of the component in addition to the text property to other objects or bean properties that update this component's properties automatically.
    [b] Please join in and share your comments, experiences, additional information, questions, feedback, etc. on these components. <br><br>
    Thank you for your participation

    The following blog has a mini tutorial on using a tab set in a page fragment for page navigation:
    http://blogs.sun.com/divas/entry/tabbing_thru_the_tulips
    A reader commented that the mini tutorial needed to be improved upon to show how to keep the tab state and navigation state in synch.
    How would you do it? If you have a good example, maybe post it to this thread.
    Also, there is no tab tutorial but it is on the priority list. What would you like a tab tutorial to show how to do?

Maybe you are looking for

  • TS1702 I need some help the apps were downloading slowly

    The apps downloaded but it didn't cause it's stuck in downloading mode what should I do? The iOS 6 update didn't work. Please I need some help. The apps didn't download. Talking Angela and Ginger didn't download. Talking Santa didn't update.

  • Can't import from home shared computer

    Okay here's the deal. My mom, who has her computer in the basement, got an iPad. Her computer didn't recognize it or find the driver. She uninstalled and reinstalled iTunes but keeps getting error messages that it didn't install correctly. A new unit

  • TS1717 iTunes will not auto-launch like it used to on Win7. Also cannot start in SAFE mode

    I've had this computer & this installation of iTunes for a very long time. It has always worked perfectly, and will auto-start every time I connect the iPhone. (my iPhone would light up and display the "Sync in Progress" message on its screen) The la

  • Mono line art image reproduction

    My book has about 150 scanned B/W line drawings which I have as TIFF files, 1 bit per pixel. Currently these are CCITT Fax 4 compressed, making them small, less than 100kb/page. I am submitting an Indesign-generated PDF of the book to a digital book

  • I need Bluetooth on my Pavilion.

    I don't have Bluetooth on my  Pavilion. I was asked to upgrade. I got following message when i entered the product number.   "HP has not tested this PC.   For this reason, HP is unable to provide upgrade instructions or Windows 8 drivers. You may los