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

Similar Messages

  • 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

  • Conditional display of page

    I have a link from page "Customer info" to another page ("Customer specification").
    When I click the link (which is a customer name) I want the "Customer specification" page to show only the data pertaining to that particular customer. Unfortunately, I haven't managed to figure out how to send the value of the customer name as a parameter to another page.
    Can anyone offer suggestions?

    Hi Tias,
    Did you look at the Application Builder Concepts? http://download.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/concept.htm#BEIFCDGF
    In there you'll see: You can create links between pages in your application using the following syntax:
    f?p=App:Page:Session:Request:Debug:ClearCache:itemNames:itemValues:PrinterFriendly
    Hope that helps,
    Dimitri
    -- http://dgielis.blogspot.com

  • 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

  • Conditionally Displaying Regions w/o Submitting Page

    I have a radiogroup with 6 choices in it. For each of these 6 choices exists a corresponding region, which I want to conditionally display upon choosing its corresponding choice in the radiogroup. The problem I'm having is that the only way I know how to do this is to make the radiogroup a radiogroup w/ submit, but I don't want to submit the entire page and its contents upon making a selection from the radiogroup, I just want to conditionally display specific regions and not submit the page until the submit button is clicked. It seems as though there should be an easy way to do this, is there?

    That's actually the first thing I tried too. The only problem with that is that with just a redirect, the item doesn't seem to store the value of the choice from the radiogroup, so there's no criteria there by which to set the conditional display.

  • Conditional display based on Page Template

    I'd like to make some conditional display based on Page temlate value (definition). Example:
    return page_template='TABS';With such an feature it will be easy to exclude some elements defined on "Page 0" on some pages. I know that this could be done by enumerating page_id's...but in this way it will be much flexible...
    Is there such a feature? Will it be ever possible?

    A more flexible way (IMHO) to do this sort of thing would be to define onload application-level computations that set a application item to either SHOW or HIDE depending on the conditions you need. Then make the Page 0 components conditional upon this application item's value.

  • 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?

  • Conditional display in a SQL-Report/Report Region

    Hi,
    here I have an example for "Conditional display in a SQL-Report/Report Region". I figured it out in Firefox 3.6.2 using Firebug as development tool on Apex 3.2.1.00.12.
    First you have to put the following javascript code in the Page HTML-Header:
    <script type="text/javascript">
    <!--
    // SOURCE
    // W:\oracle\PRJ DWLS\javascript.07.js
    // Beispiel Funktion zur bedingten Formatierung einer Tabellenzelle.
    // Help (Substitution Strings):
    // http://htmldb.oracle.com/pls/otn/wwv_flow_help.show_help?p_lang=de&p_session=2412201185523196&p_flow_id=4003&p_step_id=420,4003
    // HTML Expression:
    // <script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#DFT_COND1#
    function ex_conditional_td
    ( p_id
    , p_rownum
    , p_cellnum
      var l_td;
      l_td = vd_getColumn(p_id, p_rownum, p_cellnum);
      // hier die Bedingung definieren
      if (true) {
        l_td.style.color = '#808080';
    }  // -- eof ex_conditional_td -- //
    // Beispiel Funktion zum Abstellen der onMouse Funktionalität der Tabellenzeile
    // HTML Expression:
    // <script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#DFT_ID#"
    function ex_conditional_tr
    ( p_id
    , p_rownum
      var l_tr;    // TABLE.TR
      var l_td;    // TABLE.TR.TD
      if (true) {
        l_tr = vd_getRow(p_id, p_rownum);
        l_tr.onmouseover = null;
        l_tr.onmouseout  = null;
        for (var i=0; i<l_tr.cells.length; i++) {
          l_td = l_tr.cells;
    l_td.style.backgroundColor = '#DDDDDD';
    } // -- eof ex_conditional_tr() -- //
    var g_DEBUG = false;
    var g_TBODY = null;
    // Liefert das Body-Element der Tabelle mit der ID <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // Return
    // das Body-Element oder NULL, wenn die Zeile nicht gefunden wurde
    function vd_getBody
    ( p_id
    if (g_TBODY == null) {
    var l_table = null;
    l_table = document.getElementById( p_id );
    if (l_table == null) {
    l_table = document.getElementByName( p_id );
    if (l_table != null) {
    if (vd_debug()) {
    alert("Tabelle gefunden, " + l_table.nodeName);
    g_TBODY = vd_search( l_table, 'TD', 't10data', 'TBODY');
    return g_TBODY;
    } // -- eof vd_getBody() -- //
    // Liefert die Zeile <p_rownum> der HTML-Tabelle mit der Id <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // p_rownum - die Zeilennummer
    // Return
    // die Zeile oder NULL, wenn die Zeile nicht gefunden wurde
    function vd_getRow
    ( p_id
    , p_rownum
    var l_body = vd_getBody(p_id);
    if ( l_body != null
    && l_body.nodeName == 'TBODY'
    && l_body.children[p_rownum].nodeName == 'TR') {
    return l_body.children[p_rownum];
    else {
    return null;
    } // -- eof vd_getRow() -- //
    // Liefert die Spalte <p_column> der Zeile <p_rownum> der HTML-Tabelle mit der
    // Id <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // p_rownum - die Zeilennummer
    // p_column - der Index der Spalte / Zelle
    // Return
    // die Zelle oder NULL, wenn die Zelle nicht gefunden wurde
    function vd_getColumn
    ( p_id
    , p_rownum
    , p_column
    var l_tr = vd_getRow(p_id, p_rownum);
    if ( l_tr != null
    && l_tr.nodeName == 'TR'
    && l_tr.children.length >= p_column
    && l_tr.children[p_column].nodeName == 'TD') {
    return l_tr.children[p_column];
    else {
    return null;
    } // -- eof vd_getColumn() -- //
    // Rekursives Suchen nach einem Node.
    // Zweck: Das bedingte Formatieren einer Tabellenzelle in einem Apex Standard
    // SQL-Report.
    // Diese Funktion durchsucht rekursiv, ab einem Ausgangsknoten <p_node>, alle
    // darunter befindlichen Elemente, ob in dem Element <p_seachIn> sich die
    // Klasse <p_class> befindet.
    // Bei Standard-Reports ist die Reportzelle (TD) mit der Klasse
    // "t10data" formatiert.
    // Zunächst muss dazu die Tabellenzelle (TD) selbst, die übergeordnete
    // Tabellenzeile (TR), der Tabellenbody (TBODY) oder die Tabelle (TABLE)
    // selbst ermittelt werden.
    // Der Beispielaufruf:
    // var l_body;
    // var l_node = document.getElementById( 'R112233' );
    // l_body = search( l_node, 'TD', 't10data', 'TBODY');
    // durchsucht also das mit der Id "R112233" versehene Element [der Report, für
    // den in Apex eine statischen ID vergeben werden musste] rekursiv, bis er
    // die [erste] Tabellenzelle "TD" findet, die als Klasse "t10data"
    // definiert hat. Für diese ermittelt er dann das übergeordnete TBODY-Element.
    // Parameter
    // p_node - das Ausgangselement
    // p_searchIn - der Knotenname, der durchsucht werden soll
    // [node.nodeName == p_searchIn]
    // p_class - der Name der CSS Klasse
    // [node.classList[<index>] == p_class
    // p_parentName - der Name [node.parentNode.nodeName == p_parentName]
    // des Elements, das zurückgeliefert werden soll. Wird als
    // p_parentName der Suchname p_searchIn angegeben, wird
    // das Element selbst zurückgegeben.
    // Return
    // das per p_parentName gesuchte Element (TD, TR, TBODY, TABLE)
    function vd_search
    ( p_node
    , p_searchIn
    , p_class
    , p_parentName
    var LN = "vd_search";
    var l_element = null;
    // DEBUG
    if (vd_debug()) {
    alert(LN + ":" + "Untersuche " + p_node.nodeName + ", id=" + p_node.id);
    // 1) der aktuelle Knoten ist der, der durchsucht werden soll
    if (p_node.nodeName == p_searchIn) {
    if (p_node.classList.length > 0) {
    for(var c=0; c<p_node.classList.length; c++) {
    if (p_node.classList[c] == p_class) {
    // Parent Node dynmisch suchen
    l_node = p_node;
    if (l_node.nodeName == p_parentName) {
    return l_node;
    while(l_node != null && l_node.parentNode != null) {
    if (l_node.parentNode.nodeName == p_parentName) {
    return l_node.parentNode;
    else {
    l_node = l_node.parentNode;
    // 2) wenn nicht 1) oder nicht in 1) gefunden, dann in den Kindelementen
    // weitersuchen
    if (p_node.children.length > 0) {
    var i = 0;
    while (i<p_node.children.length && l_element==null) {
    l_element = vd_search( p_node.children[i], p_searchIn, p_class, p_parentName);
    i++;
    return l_element;
    } // -- eof vd_search() -- //
    // Gibt an, ob Debug ein- (true) oder ausgeschaltet (false) ist.
    // Return
    // true - debug ist eingeschaltet
    // false - debug ist ausgeschaltet
    function vd_debug()
    return g_DEBUG;
    -->
    </script>
    Maybe you have to modify the "vd_getBody" function. I'm searching the table cell with having the class "t10data". When you use another theme, there's maybe another class used.
    Second is, that you set an static id for your report region. I prefer this structure:
    R<app-id><page-id><seq> (Raaaaappppsss) e.g. R094260001010.
    First example is to turn off the onMouse-Effect. Maybe on the first or last column definition you put this code in the "HTML-Expression" area:
    <script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#ID#This will call the example function ex_conditional_tr with the parameter
    a) the region id
    b) the rownum (as oracle always starts with 1 this is the first data row [rownum=0 is the table header row])
    Second example is the conditional formatting of a table cell. Put this in the HML-Expression area:
    <script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#ENAME#This will call the example function ex_conditional_tr with the parameter
    a) the region id
    b) the rownum
    c) the cellnum (here we have to subtract 1 to get the "real" cell index)
    The "ex_conditional" functions are just a representation of how to get the row or cell node.
    Hope this help a bit.
    Tom

    I would use a CASE statement in the select....
    each CASE would be an img src tag for a different button if the button is an image.
    does that make sense? I can include an example if you would like...

  • 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.

  • Problems with Conditional Display and Read Only

    Hi Everybody,
    I have a form to Add/ Modify Table Info.
    I have column which stores numeric value (like no. of purchases, no.of returns etc.,) and I have a text field with this Database column as Source.
    In some cases the value is a foreign key (Id of the Owner, Buyer etc.,) to another table. In such cases, I want to display a select list containing people information. Is that possible?
    This is what I did to achieve that
    I added a select list with info from second Table. Made both the text field and the select list to conditional display and conditional read only.
    My understanding is that When an item is made read only it should not be saved to the Database.
    But while Updating I am getting the following Error
    ORA-06550: line 1, column 130: PL/SQL: ORA-00957: duplicate column name ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored.
    Any can anybody help me out on this?
    Thanks
    Nimmi

    My understanding is that When an item is made read only it should not be saved to the Database
    No, all page items with a Source Type of "Database Column" will be used by the Automatic DML process to insert/update the database. Form inputs with the "disabled" HTML attribute set are not POSTed to the server.
    Try to create 2 items, one Select List and other Text Field but setup their conditions such that only one of them is rendered on the page at any given time. That might work.

  • 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.

  • Need help with conditional display

    I found a older thread (704012) that explains how to conditionally display a link using style.  Which is what I want to do.  The part I'm having trouble with is that part of the instructions say to put
    class="row_has_values_#HAS_VALUES#"
    in the Link Attributes which I have done.  I also have a column in the report called HAS_VALUES and I'm properly populating it in my select.  I know because I left it displayed while I'm testing.  I can run the report and I have Y's and N's showing up in that column but the conditional part does not work.  When I look at the page source (below) I see that in the html the #HAS_VALUES# has not been replaced by the actual Y or N.  I think that's where I'm having trouble?  I think it might work if there was a Y or N in that but I don't understand why that didn't happen.
    <tr class="odd"><td headers="LINK"><a href="f?p=125:3:12628966088981::NO::P3_PROGRAM_KEY:2" class="row_has_values_#HAS_VALUES#"><img src="/i/e2.gif"  border="0"></a></td><td  align="left"

    LawrenceJ wrote:
    I've continued to snoop around and see lots of posts on conditional display in reports.  Common desire I guess.  I saw some stuff that I interpreted to suggest that what I'm trying to do may not work in interactive reports, only in classic reports.  Does that sound familiar?
    That would certainly apply to anything template-related. However there have been enhancements to IRs (like adding HTML Expressions) that might supersede information in older posts. If you provide a link to the sources you've found and the APEX version you're using someone will be able to confirm whether that information is relevant.
    Many other posts on doing things conditionally in reports seemed to lean towards "selecting" the html based on data values and then just letting that get put in the report column.  That looks promising but sure is a bit ugly.  I've very little apex experience but lots of mod pl/sql and that sort of solution was pretty common when I did stuff with it.  I saw a little suggesting using templates as a solution but I'll confess to not understanding it at all.
    As I pointed out in the original thread, if the conditional display of the link is in any way security related then CSS or JS/jQuery methods are not acceptable. If the user is not supposed to be able to click the link or see any data contained in it, then you have to use a method that ensures that the link element never reaches the browser.
    Hard-coding the link HTML in the report query is the common approach, but is as you say a bit ugly. Using a custom report template (my favourite APEX subject) enables clean separation of the report query, conditional logic and HTML structure. If you know HTML then you're advised to get familiar with using templates in APEX. You'll find this a major advance on the PL/SQL web toolkit. What is it that you're not understanding about using templates?

  • Help with Conditional Display and Validation

    Version 4.1.1.00.23
    Hello,
    I'm having a difficult time with a conditional display and validation I'm hoping someone can help with.
    Requirements:
    When the Start Date (Datepicker) and/or End Date (Datepicker) change then display the Change Reason (Select List) and Change Description (Textbox)
    If the page is saved without entering a Change Reason display a validation error message that the Change Reason cannot be empty (NULL)
    What I've tried
    Create a Dynamic Action on the Start Date
    Event: Change
    Selection Type:Item(s)
    Items(s): P51_START_DATE
    Condition: none
    True Action Section:
    Action: Show
    Fire on Page Load: Checked
    Show all page items on the same line: No
    Affected Items Section:
    Selection Type:Item(s)
    Item(s): P51_CHANGE_REASON,P51_CHANGE_DESC
    I've also created a Dynamic Action with similar settings for the P51_END_DATE.
    I created a Validation for the P51_CHANGE_REASON as Function Returning Error Text:
    DECLARE
        v_start_date    work_items.start_date%TYPE;
        v_end_date      work_items.end_date%TYPE;
    BEGIN
        SELECT start_date
              ,end_date
        INTO   v_start_date
              ,v_end_date
        FROM   work_items
        WHERE  work_items_id = :P51_WORK_ITEMS_ID;
        IF ( (v_start_date != TO_DATE(:P51_START_DATE,'DD-MON-YYYY') OR v_end_date != TO_DATE(:P51_END_DATE,'DD-MON-YYYY') ) AND
              :P51_CHANGE_REASON IS NULL ) THEN
            RETURN 'Change Reason must have a value';
        END IF;
    END;
    The Issue
    I tried to create another Dynamic Action to hide the P51_CHANGE_REASON and P51_CHANGE_DESC fields on page load, but when either of the date fields are changed and the validation is fired the P51_CHANGE_REASON and P51_CHANGE_DESC are hidden again.
    There are two buttons to submit the page: 'SAVE' will submit the page and stay on the page and 'SAVE_CHANGES' will submit the page and branch to the previous page (which is a report with EDIT buttons to edit the record).
    I can't get the page load Dynamic Action to NOT fire when the validation is fired.
    I hope this is clear and if not what information can I provide?
    Thanks,
    Joe

    Phil,
    Thank you for looking at this.
    Yes if the Change Reason is NULL when the edit page is displayed then the Change Reason and Change Description fields are hidden. If the Start Date (Datepicker) and/or End Date (Datepicker) change then display the Change Reason (Select List) and Change Description (Textbox). If the page is saved without entering a Change Reason display a validation error message that the Change Reason cannot be empty (NULL).
    The problem I'm having is that if no Change Reason is entered and the page is saved thereby firing the validation the Change Reason and Change Description fields are hidden again (because of the On-Load Dynamic Action to hide them). So now the user can't put in a Change Reason...unless they change one of the date fields again which isn't going to be accepted.
    Is there a way to determine if a validation error was fired and be able to use that on the On-Load Dynamic Action to hide the two fields? Something like...If the validation fired then don't run?
    Please let me know if I'm still confusing you.
    Thanks,
    Joe

  • Problem in displaying second page in smartform

    hi,
    I m trying to display two pages (page 1 and page 2) in the smartform.
    I m using command (of flow logic) in the main window of first page to achieve this.
    While i m able to see the output by running the Smartform FM stand-alone, i cant see the same while i run it through driver program.
    Does it require any special conditions ? any config issues??
    Pl help...

    On the first page have you given the next page in "General Attributes" Tab and in the command also.,
    Check there must be the probelm wiht either of these two.
    assign points if it helps.
    -Gaurang

Maybe you are looking for