Redirect on page load (table-driven rules)

ADF 11gR1 PS1
Hi all,
On some pages, I need to redirect the user based on a table driven rules (eg page is active only between dates x and y, etc). Because there will be numerous pages with this functionality, as well as table driven configuration with regards to the rules (eg which page is affected, what dates are valid, what url should the user be redirected to), and since this can happen for both unbound and bound tasks, I'm not sure if using a router is the best way to do this.
Per this thread
Redirect in adfc
I'd like to attempt to do this via a bean method called during page load. Here's what I can't figure out:
1) Is there a way the bean method can figure out the calling page name?
2) How to call the bean method on page load that would allow a redirect.
Regarding #2, on the previously mentioned thread, someone mentioned a PhaseListener on RESTORE_VIEW, but I don't quite understand how do to that.
Thanks.

Hi,
the after RESTORE_VIEW phase can be listened for in a PhaeListener you configure in the faces-config.xml file. This RESTORE_VIEW phase has accec to the FacesContext and thus to the ViewRoot, which provides information about the requested viewId. You can then change the ViewId of this ViewRoot based on your redirection needs.
A router activity is the best practices here because the use case you describe is conditional navigation. So if you need to have the logic in a managed bean, then why don't you point the router case to this ?
Frank

Similar Messages

  • Table executes query on page load

    I have a popup in my page and a table in my popup...
    I use this popup for searching among records. When I render my popup, table comes with the sql suery results (invokes in popup load)...
    But I don't want the table come with the query results on load...I want table to list sql query results when I execute the search query.
    I want ; On load table as es empty,then When I execute, list query results.
    How Can I do this?
    Here is My sql query:
    SELECT KODU,ADI FROM TCARI WHERE UPPER(KODU) LIKE UPPER(:pk || '%') AND
    UPPER(ADI) LIKE UPPER(:pab || '%') AND UPPER(ADI) LIKE UPPER('%' || :pai || '%')
    Regards, islam

    Hi,
    option 1: Set the default value of the bind variable so that the query returns no result
    option 2: before launching the dialog (e.g. in a actionListener) set the underlying VO into find mode
    Frank

  • Named Criteria for Table Not Filtering on Page Load

    Hi Guys and Gals,
    I'm tying to create a filtered table using named view criteria (http://docs.oracle.com/cd/E24382_01/web.1112/e16182/web_search_bc.htm#BABBCHIH).
    I create the Named Criteria; I drag from the Named Criteria from the Data Control onto the page; I select ADF Read-Only Filtered Table option. I run the page and much to my chagrin, the table is not filtered. A table with all results, plus a filter box with a value "S" (my named criteria filter value), is displayed.
    Shouldn't the results already be filtered upon page load?
    The filter works correctly when I run tests in my AppModule.
    Using JDev 11.1.2.1.0.
    Will

    I've found a workaround.
    I drag and drop the VO (unfiltered) from the Data Control and select read-only table. In my pageDef, I select the table's binding and check the "Enable Filtering" box. I then select the attribute to filter on and the applicable filter text.
    The table then displays filtered results on page load.
    However, I only see this working for very simple filtering (i.e. one column with simple filter requirements). It should be nice to know why dragging and dropping Named View Criteria onto the page does not automatically filter table results on page load.
    Will

  • Error while opening modal (skillbuilder plugin)  page on page load

    Hi all,
    I'm using 4.2.1. ( on 11GR2 ), theme 25.
    Skillbuilder Modal page plugin v2
    Modal pages are working great, on all kinds of events, but if I try to open one via a D.A. on page load it fails with "Uncaught TypeError: Object load has no method 'stopImmediatePropagation' " error (in the browser console).
    <edit>
    just found that this error is caused by the "cancel event" DA action which should be fired after the open modal dialog action. If I ommit this cancel event the modal page is not loaded but also no error is shown.
    </edit>
    Any ideas on how to fix this? In the end I just want to open a modal window after the page is loaded depending on the value of an item set when loading the page ( the branch sets an item value to indicate that the modal window should be opend ).
    Regards
    Bas
    Edited by: Bas de Klerk on 11-apr-2013 7:43

    Narrowed it down to change in behaviour between APEX 4.1 and APEX 4.2
    Page source for both versions is alsmost similar, besides the different APEX js libraries being loaded, so probably the source of the problem is somehow in there.
    Apex 4.1 generates code below :
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html lang="nl" xmlns="http://www.w3.org/1999/xhtml" xmlns:htmldb="http://htmldb.oracle.com" xmlns:apex="http://apex.oracle.com">
    <head>
      <title>sdfsdfsf</title>
    <link rel="stylesheet" href="/i/css/apex_4_1.min.css" type="text/css" />
    <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_4_1.css" type="text/css" /><![endif]-->
    <link rel="stylesheet" href="/i/libraries/jquery-ui/1.8.14/themes/base/jquery-ui.min.css" type="text/css" />
    <script type="text/javascript">var apex_img_dir = "/i/", htmldb_Img_Dir = apex_img_dir;</script><script src="/i/javascript/apex_4_1.min.js" type="text/javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0.css" type="text/css" />
      <!--[if IE]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie.css" type="text/css" /><![endif]-->
      <!--[if IE 6]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie6.css" type="text/css" /><![endif]-->
      <!--[if IE 7]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie7.css" type="text/css" /><![endif]-->
    </head>
    <body >
    <!--[if lte IE 6]><div id="outdated-browser">You are using an outdated web browser. For a list of supported browsers, please reference the Oracle Application Express Installation Guide.</div><![endif]-->
    <form action="wwv_flow.accept" method="post" name="wwv_flow" id="wwvFlowForm">
    <input type="hidden" name="p_flow_id" value="101" id="pFlowId" /><input type="hidden" name="p_flow_step_id" value="3" id="pFlowStepId" /><input type="hidden" name="p_instance" value="3963167387744880" id="pInstance" /><input type="hidden" name="p_page_submission_id" value="1130499891713056" id="pPageSubmissionId" /><input type="hidden" name="p_request" value="" id="pRequest" />
    <div id="header">
      <div id="app-logo"><a href="f?p=101:1:3963167387744880"><span style="font-family:Arial; color:green; font-size:18; white-space:nowrap; font-weight:bold;">SoMStudie v1.06 - Productie</span></a></div>
      <div id="navbar">
        <div class="navbar-entry"><a href="javascript:{if (confirm('Applicatie uitloggen ? Niet opgeslagen wijzigingen gaan verloren !')) redirect('wwv_flow_custom_auth_std.logout?p_this_flow=101&p_next_flow_page_sess=101:1');}" class="navbar-link">Uitloggen</a></div>
        <div class="app-user">Welcome: ADMIN</div>
      </div>
    </div>
    <div id="tabs">
      <div class="frame">
        <div class="bg">
          <div class="tab-holder">
          </div>
        </div>
      </div>
    </div>
    <div id="topbar"></div>
    <div id="messages"></div>
    <div id="body">
      <table class="tbl-body" cellspacing="0" cellpadding="0" border="0" summary="">
        <tbody>
          <tr>
            <td class="tbl-main" width="100%"><div class="rounded-corner-region" id="R9719141085411482" >
      <div class="rc-blue-top"><div class="rc-blue-top-r">
        <div class="rc-title">sdfsdf</div>
        <div class="rc-buttons"></div>
      </div></div>
      <div class="rc-body"><div class="rc-body-r"><div class="rc-content-main"><table id="apex_layout_9719141085411482" border="0" class="formlayout" summary="" role="presentation" datatable=0 ><tr><td nowrap="nowrap" align="right"><label for="P3_X" tabindex="999"><a class="optional-w-help" href="javascript:popupFieldHelp('9719940026416952','3963167387744880')" tabindex="999">X</a></label></td>
    <td  colspan="1" rowspan="1" align="left" valign="middle"><input type="hidden" name="p_arg_names" value="9719940026416952" /><input type="text" id="P3_X" name="p_t01" value="" size="30" maxlength="4000" class="text_field" /></td></tr>
    </table>
    </div></div></div>
      <div class="rc-bottom"><div class="rc-bottom-r"></div></div>
    </div></td>
            <td class="tbl-sidebar"></td>    
          </tr>
        </tbody>
      </table>
    </div><div id="footer"><div class="content">
      <div id="customize"></div> 
    </div></div>
    <input type="hidden" name="p_md5_checksum" value=""  /></form>
    <script type="text/javascript">
    apex.da.initDaEventList = function(){
    apex.da.gEventList = [
    {"triggeringElement":"document","triggeringElementType":"DOM_OBJECT","bindType":"bind","bindEventType":"ready",actionList:[{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,javascriptFunction:function(){
       if (this.browserEvent !== 'load'){
          apex.jQuery(document).apex_modal_page('openPageFromApexThis', this);
    },"attribute02":"STATIC","attribute03":"f?p=101:21:3963167387744880::21:::","attribute05":"data-url","attribute06":"div#success-message","attribute07":"AUTO","action":"PLUGIN_COM_SKILLBUILDERS_MODAL_PAGE"},{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,javascriptFunction:apex.da.cancelEvent,"action":"NATIVE_CANCEL_EVENT"}]}];
    </script>
    <link rel="stylesheet" href="#PLUGIN_PREFIX#plugins/modal-page/server/TEST.css" type="text/css" />
    <script type="text/javascript" src="wwv_flow_file_mgr.get_file?p_plugin_id=34423998056404065675&p_security_group_id=4874907161072557&p_file_name=jquery.colorbox-min.js"></script>
    <script type="text/javascript" src="wwv_flow_file_mgr.get_file?p_plugin_id=34423998056404065675&p_security_group_id=4874907161072557&p_file_name=apex_modal_page.min.js"></script>
    <script type="text/javascript">
    <!--
    apex.jQuery(document).ready(function(){
    (function(){apex.jQuery(document).apex_modal_page({
       "transition":"none",
       "draggable":true,
       "initialHeight":100,
       "initialWidth":300,
       "overlayOpacity":.5,
       "scrolling":true,
       "loadingImageSrc":""
    (function(){apex.da.initDaEventList();})();
    (function(){apex.da.init();})();
    //-->
    </script></body>
    </html>Apex 4.2 on same server etc, after upgrade generates code below :
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html lang="nl" xmlns="http://www.w3.org/1999/xhtml" xmlns:htmldb="http://htmldb.oracle.com" xmlns:apex="http://apex.oracle.com">
    <head>
      <title>sdfsdfsf</title>
      <link rel="stylesheet" href="/i/css/apex.min.css?v=4.2.0.00.27" type="text/css" />
    <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie.min.css?v=4.2.0.00.27" type="text/css" /><![endif]-->
    <link rel="stylesheet" href="/i/libraries/jquery-ui/1.8.22/themes/base/jquery-ui.min.css" type="text/css" />
    <script type="text/javascript">
    var apex_img_dir = "/i/", htmldb_Img_Dir = apex_img_dir;
    </script>
    <script src="/i/libraries/apex/minified/desktop_all.min.js?v=4.2.0.00.27" type="text/javascript"></script>
    <script src="/i/libraries/apex/minified/legacy.min.js?v=4.2.0.00.27" type="text/javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0.css" type="text/css" />
      <!--[if IE]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie.css" type="text/css" /><![endif]-->
      <!--[if IE 6]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie6.css" type="text/css" /><![endif]-->
      <!--[if IE 7]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie7.css" type="text/css" /><![endif]-->
    </head>
    <body >
    <!--[if lte IE 6]><div id="outdated-browser">You are using an outdated web browser. For a list of supported browsers, please reference the Oracle Application Express Installation Guide.</div><![endif]-->
    <form action="wwv_flow.accept" method="post" name="wwv_flow" id="wwvFlowForm" novalidate >
    <input type="hidden" name="p_flow_id" value="101" id="pFlowId" /><input type="hidden" name="p_flow_step_id" value="3" id="pFlowStepId" /><input type="hidden" name="p_instance" value="2102738057213" id="pInstance" /><input type="hidden" name="p_page_submission_id" value="6687700944614" id="pPageSubmissionId" /><input type="hidden" name="p_request" value="" id="pRequest" />
    <div id="header">
      <div id="app-logo"><a href="f?p=101:1:2102738057213"><span style="font-family:Arial; color:green; font-size:18; white-space:nowrap; font-weight:bold;">SoMStudie v1.06 - Productie</span></a></div>
      <div id="navbar">
        <div class="navbar-entry"><a href="javascript:{if (confirm('Applicatie uitloggen ? Niet opgeslagen wijzigingen gaan verloren !')) redirect('wwv_flow_custom_auth_std.logout?p_this_flow=101&p_next_flow_page_sess=101:1');}" class="navbar-link">Uitloggen</a></div>
        <div class="app-user">Welcome: ADMIN</div>
      </div>
    </div>
    <div id="tabs">
      <div class="frame">
        <div class="bg">
          <div class="tab-holder">
          </div>
        </div>
      </div>
    </div>
    <div id="topbar"></div>
    <div id="messages"></div>
    <div id="body">
      <table class="tbl-body" cellspacing="0" cellpadding="0" border="0" summary="">
        <tbody>
          <tr>
            <td class="tbl-main" width="100%"><div class="rounded-corner-region" id="R9719141085411482" >
      <div class="rc-blue-top"><div class="rc-blue-top-r">
        <div class="rc-title">sdfsdf</div>
        <div class="rc-buttons"></div>
      </div></div>
      <div class="rc-body"><div class="rc-body-r"><div class="rc-content-main"><table id="apex_layout_9719141085411482" border="0" class="formlayout"  summary="" role="presentation"><tr><td nowrap="nowrap" align="right"><label for="P3_X" tabindex="999"><a class="optional-w-help" href="javascript:popupFieldHelp('9719940026416952','2102738057213')" tabindex="999">X</a></label></td><td  align="left" valign="middle"><input type="hidden" name="p_arg_names" value="9719940026416952" /><input type="text" id="P3_X" name="p_t01" class="text_field"  value="" size="30" maxlength="4000"  /></td></tr></table></div></div></div>
      <div class="rc-bottom"><div class="rc-bottom-r"></div></div>
    </div></td>
            <td class="tbl-sidebar"></td>    
          </tr>
        </tbody>
      </table>
    </div><div id="footer"><div class="content">
      <div id="customize"></div> 
    </div></div>
    <input type="hidden" name="p_md5_checksum" value=""  /><input type="hidden" name="p_page_checksum" value="E08AB8A6D69B3450572EC2E89A528B29" id="pPageChecksum" /></form>
    <script type="text/javascript">
    apex.da.initDaEventList = function(){
    apex.da.gEventList = [
    {"bindEventType":"ready",actionList:[{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,javascriptFunction:function(){
       if (this.browserEvent !== 'load'){
          apex.jQuery(document).apex_modal_page('openPageFromApexThis', this);
    },"attribute02":"STATIC","attribute03":"f?p=101:21:2102738057213::21:::","attribute05":"data-url","attribute06":"div#success-message","attribute07":"AUTO","action":"PLUGIN_COM_SKILLBUILDERS_MODAL_PAGE"},{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,javascriptFunction:apex.da.cancelEvent,"action":"NATIVE_CANCEL_EVENT"}]}];
    </script>
    <link rel="stylesheet" href="#PLUGIN_PREFIX#plugins/modal-page/server/TEST.css" type="text/css" />
    <script type="text/javascript" src="wwv_flow_file_mgr.get_file?p_plugin_id=34423998056404065675&p_security_group_id=4874907161072557&p_file_name=jquery.colorbox-min.js"></script>
    <script type="text/javascript" src="wwv_flow_file_mgr.get_file?p_plugin_id=34423998056404065675&p_security_group_id=4874907161072557&p_file_name=apex_modal_page.min.js"></script>
    <script type="text/javascript">
    apex.jQuery( document ).ready( function() {
    (function(){apex.jQuery(document).apex_modal_page({
       "transition":"none",
       "draggable":true,
       "initialHeight":100,
       "initialWidth":300,
       "overlayOpacity":.5,
       "scrolling":true,
       "loadingImageSrc":""
    (function(){apex.da.initDaEventList();})();
    (function(){apex.da.init();})();
    });</script>
    </body>
    </html>Any suggestions why this plugin does not load on page load in 4.2 would be great ( a fix would be even better :) ).
    Regards

  • Redirect jsp page problem

              I have problem when I want to redirect a page, inputparam2test.jsp back to the perious
              page, inputparam1test.jsp. Everything works until I
              add a "if" statement in the inputparam1test.jsp.
              The error is "Error 500--Internal Server Error".
              Can anybody help me out? Thanks a lot!
              inputparam1test.jsp:
              <html>
              <head>
              <title>create a patameter input form</title>
              </head>
              <body>
              <%!
              String dataset;
              String modeltype;
              %>
              <%
              dataset = request.getParameter("dataset");
              modeltype = request.getParameter("modeltype");
              %>     
              <center>
              <form action="inputparam2test.jsp" method="post">
              <table cellspacing=10>
              <tr>
              <td colspan=2>
                        Please enter model parameters
                   </td>
                   </tr>     
              <tr>
                   <td>
                        Dell LRI
                   </td>
                   <td>     
                        <select name="DellLRI">
                        <option value="1">1
                        <option value="0">0
                        </select>
                   </td>
                   </tr>
                   <%
                   if(modeltype.equals("Direct")) {
              out.println("in if");
              %>
                   <tr>
                   <td>
                   </td>
                   <td>     
                        <input type="submit" value="Next>" name="Next>">
                   </td>
                   </tr>
              </form>
              </center>
              </body>
              </html>
              inputparam2test.jsp:
              <html>
              <head>
              <title>continue input parameters </title>
              </head>
              <body>
              <%
              response.sendRedirect("inputparam1test.jsp");
              %>
              </body>
              </html>
              

    You do not check if the modelType is null and
              if(modeltype.equals("Direct")) {
              out.println("in if");
              will result in a NullPointerException when it is null.
              Almond Huang <[email protected]> wrote:
              > I have problem when I want to redirect a page, inputparam2test.jsp back to the perious
              > page, inputparam1test.jsp. Everything works until I
              > add a "if" statement in the inputparam1test.jsp.
              > The error is "Error 500--Internal Server Error".
              > Can anybody help me out? Thanks a lot!
              > inputparam1test.jsp:
              > <html>
              > <head>
              > <title>create a patameter input form</title>
              > </head>
              > <body>
              > <%!
              > String dataset;
              > String modeltype;
              > %>
              > <%
              > dataset = request.getParameter("dataset");
              > modeltype = request.getParameter("modeltype");
              > %>     
              > <center>
              > <form action="inputparam2test.jsp" method="post">
              > <table cellspacing=10>
              > <tr>
              > <td colspan=2>
              >           Please enter model parameters
              >      </td>
              >      </tr>     
              > <tr>
              >      <td>
              >           Dell LRI
              >      </td>
              >      <td>     
              >           <select name="DellLRI">
              >           <option value="1">1
              >           <option value="0">0
              >           </select>
              >      </td>
              >      </tr>
              >      <%
              >      if(modeltype.equals("Direct")) {
              > out.println("in if");
              >      }
              > %>
              >      <tr>
              >      <td>
              >      </td>
              >      <td>     
              >           <input type="submit" value="Next>" name="Next>">
              >      </td>
              >      </tr>
              > </form>
              > </center>
              > </body>
              > </html>
              > inputparam2test.jsp:
              > <html>
              > <head>
              > <title>continue input parameters </title>
              > </head>
              > <body>
              > <%
              > response.sendRedirect("inputparam1test.jsp");
              > %>
              > </body>
              > </html>
              Dimitri
              

  • ADF ProcessScope -- I get a new AdfFacesContext on each page load

    I am trying to store some variables in the ADF processScope. But the next time the page is loaded and calls the managed bean methods, the AdfFacesContext is different, and so the processScope is empty. The managed bean is session scope, and I am setting the processScope variables in the bean's Java code.
    In particular this happens when I click on the af:table pagination links, e.g. the "next 25".
    How can I get access to the same AdfFacesContext (and therefore the same processScope) the next time the page loads and calls the managed bean?
    I am using JDeveloper 10.1.3.3.0.
    Here is the example code, and the output that is produced from my System.out.println statements:
    ========== Controller.java (session scope managed bean) ===============
    package adfproject;
    import java.util.Map;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.List;
    import oracle.adf.view.faces.context.AdfFacesContext;
    public class Controller {
    private List<Map> list = new ArrayList<Map>();
    private String label;
    private static int counter;
    public Controller() {
    // initialize list with Map objects
    for ( int i = 1; i<10 ; i++) {
    Map map = new HashMap();
    map.put("A","first column");
    map.put("B", "row " + i);
    list.add(map);
    // called from JSP to initialize the ECO bean
    public String getLoad() {
    printAdfProcessContext("in getLoad");
    // get value from current process scope
    String currentLabel = (String)getProcessAttribute("LABEL");
    // print currentLabel
    System.out.println("current LABEL = "+currentLabel);
    // if currentLabel null, build new one with counter, incr counter
    if (currentLabel == null) {
    label = "xyz " + ++counter;
    System.out.println("new LABEL: "+label);
    // remember the current label in the process scope, and in member
    setProcessAttribute("LABEL",label);
    return ""; // empty string so nothing is displayed on web page
    public static void printAdfProcessContext(String label) {
    AdfFacesContext afCtx = AdfFacesContext.getCurrentInstance();
    System.out.println("============ "+label+" ===========");
    System.out.println("AdfFacesContext = "+afCtx);
    Map ps = afCtx.getProcessScope();
    System.out.println("Process scope = "+ps);
    * Get attribute from ADF "processScope".
    * This is a special scope provided by ADF which is in between Session
    * and Request.
    * @param name attribute name
    * @return
    public static Object getProcessAttribute(String name) {
    AdfFacesContext afCtx = AdfFacesContext.getCurrentInstance();
    return afCtx.getProcessScope().get(name);
    * Add or overwrite attribute in ADF "processScope".
    * This is a special JSF "scope" provided by ADF Faces which is somewhere
    * between Session scope and Request scope. It can be accessed in JSF
    * pages using the EL expression #{processScope.myAttribute}.
    * @param name attribute name
    * @param value attribute value
    * @return
    public static void setProcessAttribute(String name, Object value) {
    AdfFacesContext afCtx = AdfFacesContext.getCurrentInstance();
    afCtx.getProcessScope().put(name,value);
    public String getLabel() {
    return label;
    public List<Map> getList() {
    return list;
    ============= jsftest.jsp =====================
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
    <f:view>
    <afh:html>
    <afh:head title="ADF Context Test">
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    </afh:head>
    <afh:body>
    <h:form>
    <af:outputText value="#{controller.load}"/>
    <h:panelGrid columns="2">
    <af:outputLabel value="LABEL"/>
    <af:outputText value="#{controller.label}"/>
    <af:outputLabel value="Map"/>
    <af:table emptyText="No items were found" value="#{controller.list}"
    var="row" rows="4">
    <af:column sortable="false" headerText="A" formatType="text">
    <af:outputText value="#{row.A}"/>
    </af:column>
    <af:column sortable="false" headerText="B" formatType="text">
    <af:outputText value="#{row.B}"/>
    </af:column>
    </af:table>
    </h:panelGrid>
    </h:form>
    </afh:body>
    </afh:html>
    </f:view>
    ================= Console Output when page loads initially ==================
    08/09/03 15:27:18 ============ in getLoad ===========
    08/09/03 15:27:18 AdfFacesContext = oracle.adfinternal.view.faces.context.AdfFacesContextImpl@101751
    08/09/03 15:27:18 Process scope = ProcessScopeMap@7009019[_map={}, token=null,children=null]
    08/09/03 15:27:18 current LABEL = null
    08/09/03 15:27:18 new LABEL: xyz 1
    ======= Console Output when I click the "next 4" link on the table, and the page reloads ========
    08/09/03 15:32:42 ============ in getLoad ===========
    08/09/03 15:32:42 AdfFacesContext = oracle.adfinternal.view.faces.context.AdfFacesContextImpl@16bf9ce
    08/09/03 15:32:42 Process scope = ProcessScopeMap@31287037[_map={}, token=null,children=null]
    08/09/03 15:32:42 current LABEL = null
    08/09/03 15:32:42 new LABEL: xyz 2
    ====== Comments =========
    As you can see above, the AdfFacesContextImpl object has changed, so I have lost the ProcessScopeMap.
    Also, on the displayed page, the label is still "xyz 1" instead of changing to "xyz 2".
    Thanks for your help,
    JbL

    Thanks for the idea, Murph.
    I didn't need a session scope bean, request would be fine, I just was trying to make something work that would allow me access to the process scope attributes. I want to allow multiple browser windows searching on different objects independently, so I don't want to use session scope.
    I tried removing the variable declaration and setting/getting the processScope attribute in the setter/getter methods, to make the process scope attributes independent of the managed bean. But each time the page loads (by clicking the table navigation links), I still lose the process scope attributes. I tried with both session and request scope beans. Either way, in the getLoad() method, when I try to get the label from the process scope (using the new version of getLabel()), it is null.
    So the root problem is still there.
    For continued discussion on this more specific problem, see my separate thread "JSF ProcessScope attribute missing on page reload from af:table pagination"
    at JSF ProcessScope attribute missing on page reload from af:table pagination

  • Spry Accordion - Tabs open and then close after page loads

    I am using a Spry Accordion menu driven from a database.
    The menu opens up during the page load and then closes.
    I'm using SpryAccordion.js 1.6.1
    And to open a preset tab, I'm using:
    <script type="text/javascript">
    <!--
    var Accordion1 = new Spry.Widget.Accordion("Accordion1",{useFixedPanelHeights:false, enableAnimation: false, defaultPanel: 0 });
    //-->
      </script>
    But, all of the tabs open and then close on page load.
    My page:   http://www.texashotjobs.us/00C01.aspx
    Any fix for this??
    Thanks, Ron

    Well to both thanks.  Actually I wasn't disappointed as I had a two part question...
    I tested the 1.6 JS and remembered that I had to modify the 1.4 so that tabs actually would link.  So I reverted back to 1.4.
    So, going to 1.6 fixed the open panel on load but "unfixed" the panel tab from linking.....
    So changing this in the 1.6 js fixed the link issue as well:
    Spry.Widget.Accordion.prototype.onPanelTabClick = function(e, panel)
        if (panel != this.currentPanel)
            this.openPanel(panel);
        else
            this.closePanel();
        if (this.enableKeyboardNavigation)
            this.focus();
    //    if (e.preventDefault) e.preventDefault();
    //    else e.returnValue = false;
    //    if (e.stopPropagation) e.stopPropagation();
    //    else e.cancelBubble = true;
    I t appears everything is working........
    Thanks, Ron Gaddis
    Visual Reality Productions

  • Creation of components on page load

    Hi All,
    My question stems from the answers I received in these forum posts:
    - http://forum.java.sun.com/thread.jspa?threadID=5262963
    (how to dynamically add components to a specific position in the page)
    - http://forum.java.sun.com/thread.jspa?forumID=427&threadID=5262253
    (how to register a PhaseListener to trigger before rendering the response)
    What I'm trying to do now is to dynamically create components inside a container as soons as the page loads. To do this I have placed the following code inside the beforePhase() method of my PhaseListener:
    FacesContext.getCurrentInstance().getApplication().addComponent("Label", Label.class.getCanonicalName());
    Label label = (Label)FacesContext.getCurrentInstance().getApplication().createComponent("Label");
    label.setText("Hello World!");   
    panelGroup.getChildren().add(label);I've also modified my JSP page as follow:
    <webuijsf:panelGroup binding="#{TestPage.panelGroup}"/>I've tried debugging the code, and my PhaseListener is definitely working (as my code gets executed), but when the view is rendered the label isn't displayed at all. It works fine, however, if I put the code inside a method and connect an actionListenerExpression to it which gets called when a button is pushed.
    Any ideas?
    Ristretto

    Hi Ristretto,
    A couple comments. First, if the "Label" component is already declared in a faces-config.xml file somewhere, you don't need to re-register it w/ JSF... and you certainly don't need to do it each time your code is executed. If this is the Woodstock Label component (as the "webuijsf:" prefix implies for your other components), then you don't need to do this. So you can remove the first line of code (the addComponent() line).
    From what you've described, I would think it should work. Your panelGroup variable is the same instance of the object returned from the binding in your JSP, and the phase listener gets invoked before anything gets rendered. If that happens, everything should work as you want it to. Obviously something's not right, though... and unfortunately I don't see it either.
    Why do you want to do this in a phase listener instead of during your binding?
    I would not recommend creating a hierarchy of managed beans that register themselves as phase listeners and provide behavioral functionality for your application. This is very likely to be difficult to maintain, will cause every page to execute these phase listeners, and simply cause you problems. That said... there may be cases where phase listeners are a good fit in order to execute code on every request, so maybe what you're doing is ok for your use-case -- that's your call. :)
    Let me show you a complete, runnable example of how JSFT can do exactly what you described below w/o writing any Java code or compiling, etc.:
    <sun:page>
    <sun:html>
    <sun:head title="Woodstock Example" />
    <sun:body>
    <sun:form id="form">
    <sun:panelGroup id="panelGroup">
        <!afterCreate
            createComponent(type="sun:label", id="label", parent="$this{component}", component=>$attribute{comp});
            setUIComponentProperty(component="$attribute{comp}", property="text", value="Hello World!");
        />
    </sun:panelGroup>
    </sun:form>
    </sun:body>
    </sun:html>
    </sun:page>The "sun:" tags are the same as the "webuijsf:" tags (woodstock) you are using. If you use the facelets syntax w/ JSFT, you can map the prefix to "webuijsf:" also. When run, the panelGroup part of the page looks like this in the browser's source:
    <span id="form:panelGroup"><label id="form:panelGroup:label" class="LblLev2Txt_sun4">
    Hello World!
    </label></span>The "createComponent" and "setUIComponentProperty" handlers are builtin to JSFT and do what your simple example needed, however, using a simple annotation you can create your own custom handler to do anything you want (assuming your performing some logic or retrieving data from somewhere to create these components on the fly). These handlers demonstrate that there are better alternatives to "managed beans." Managed beans tend to get tied to a particular page and scope... but logic should neither be tied to a page, scope, or a particular use-case. By allowing parameterized handlers to exist, you can invoke them from anywhere. This is the re-usability you are trying to achieve through inheritance without the overhead that you will incur.
    If you'd rather add the component during the rendering phase instead of the restore view phase (afterCreate is during the restore view phase in JSFT), you can use the "beforeEncode" event. And furthermore, you don't have to associate the event w/ the component in which it should be associated with (although you can)... for example you could put this event at the top of the page so that it gets invoked at the beginning of the render response phase:
    <!beforeEncode
        getUIComponent("form:panelGroup" component=>$attribute{parent});
        createComponent(type="sun:textField", parent="$attribute{parent}", component=>$attribute{comp});
        setUIComponentProperty(component="$attribute{comp}", property="text", value="#{pageSession.foo}");
    />This causes a woodstock textfield to be added before rendering the page. However, unlike creating a component tree, rendering happens each time the page is refreshed. So, this code could potentially get invoked many times... just add a button w/o any navigation rule and you'll see it add a new text field each time you click the button.
    Last... you may want to consider using facelets way of composing pages. This allows you to create a template which may include page-based phase listeners, or events (as shown above), or bindings... as well as the obvious header / footer and other template content. This again is a much better re-use strategy than maintaining a bunch of JSPs. And JSF 2.0 is going to emphasize Facelets syntax over JSP for this reason.
    Good luck!
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • Guest Portal web page load is slow and timesout on occasions

    Hi All,
    I'm hitting a rather unusual issue with our Guest WLAN users.  Firstly let me describe the topology:-
    2 x 5508 WLC controllers one Foreign and one Anchor.  Mobility tunnel between the two WLC's as the Guest WLAN is on the WLC sitting in the DMZ.
    30+ 2702i AP's running in FlexConnect mode for Dot1X WLAN and Central Switching for Guest WLAN.
    Cisco ISE 1.3 acting as Radius server and providing Authentication and Authorisation policies.
    Dot1x Authentication and Authorisation works fine with Dynamic VLAN assignment based on AD memberships.
    The issue is with the Guest WLAN is that from a security perspective we weren't allowed to use the Central Web Authentication using L2 MAC filtering with the L3 Security of None as described in Cisco Document: 115732.
    So the Guest WLAN has been set up with no L2 security and the L3 Security of Web Policy with Web Authentication to External Server i.e. Cisco ISE and RADIUS override on the Advanced tab of the Guest WLAN.
    So a client connects to the Guest WLAN SSID > receives the DHCP IP address hosted by the Anchor WLC and then one opens a  browser types in the URL and the Security message is presented > Continue to this website (not recommended) selected and the process of receiving the Web Redirect Sign On Web page begins and hangs around forever.
    Depending on the Client i.e. Apple IPAD the sign on page loads correctly although can be slow to start with but a successful login is completed, but with windows clients and MAC Air books there is an issue with the browser either timing out the page and a retry is necessary or we can't move beyond the following page -  https://x.x.x.x:8443/portal /PortalSetup.action?portal=194a5780-5e4e-11e4-b905-005056bf2f0a?switch_url=https://1.1.1.1/login.html&client mac=00:23:4e:86:98:3c&wlan=GUEST&redirect=www.cisco.com/
    Any suggestions would be really appreciated with this as it's creating a lot of frustration.
    Thanks in advance.
    Regards,
    Mark

    Hi Mark,
    Yes Guest Cert will need to be external. Because Guest Users if they have a non-corporate laptop for example will not have your Internal Company Certs installed in their browser (that you loaded onto ISE), so they cannot trust your internal Cert.
    If your open Firefox or IE under Options/Security View Certificates you will see a list, if its a Guest you will see well known public Certs like Geotrust, Verisign etc.
    For my setup I brought a GeoTrust cert and loaded this into ISE, this way Guests will always Trust the Geostrust ISE cert like https://guest.com for example and the login will appear and be trusted.

  • My page generates an Excel file but sometimes fails if the page loads to slowly...

    I'm having a problem generating an Excel file using CF and
    looping over a bunch of queries to get a table of data to display
    to the user. This is slow but works fine except for an instance
    recently where the page seems to be loading but after a few minutes
    it stops and says "the page cannot be displayed". The error leads
    me to believe it is a server error and not a CF error but I'm not
    sure. I don't have timeout checked in my CF Admin so that should
    mean that I can request pages for as long as I need to right?
    I'm using the cfheader and cfcontent to dynamically generate
    an Excel spreadsheet from my HTML. I tried using the cfflush tag
    and that seemed to help since it pushes content to the browser
    during the page load but it doesn't work with the cfheader and
    cfcontent tags.
    So then I tried using the cfsavecontent tag and then save the
    HTML to a file but again I couldn't use the cfflush tag inside the
    cfsavecontent tag so now I'm stuck.
    The page DOES load when I run in on my local machine with MX
    6.1 Developer Edition and SQL Server Personal Edition. It DOES NOT
    work when I run it on my production server that then calls my
    separate database server. I'm wondering if there is a timeout (non
    CF) set somewhere on the productions server or the database server
    or if there is some sort of limit to the amount of data you can
    transfer between servers?
    I'm totally stumped now so any advice is greatly
    appreciated!

    That didn't work for me and the page times out right about 5
    minutes (300 seconds). I don't have timeout checked in the CF
    Administrator so I don't think it is CF that is causing the
    timeout. I checked IIS also and the timeout is set to 900 seconds.
    Is there a possibility that SQL Server has some sort of
    connection limit and I'm using too many cfquery tags? If anyone has
    experienced a similar problem I would really appreciate the help,
    thanks.

  • Using a4j to load a rich:dataTable after the page loads

    I have a rich:dataTable that calls a session bean which executes an SQL query to generate the data to be displayed in the table. Something simple like:
    <rich:dataTable rowClasses="evenRow,oddRow"
    rows="30"
    value="#{Bean.items}"
    var="items">
    where Bean.getItems() performs an SQL query and returns List<Item>.
    The problem is that the query takes a long time to execute (~45 seconds) and I'd like the page to initially load while the query is being executed, displaying a spinner while it loads. Once the query is done, I'd like to update the initially empty table using ajax.
    I set up a spinner using a4j:status and it works fine after the page initially loads (using a rich:datascroller).
    However, the page will not initially load until the query completes, which is a problem because the query is so slow. What happens is the user clicks on the "List Items" tab from my site's homepage, sits there on the same page for 45 seconds with absolutely no visual indication that anything is happening, and then finally is taken to the list of items page.
    What is needed to make the dataTable load via AJAX the first time, as well as all subsequent times?
    Thanks!
    Edited by: rcrowell on Sep 8, 2008 5:42 PM

    rcrowell wrote:
    The issue isn't the PK of the table; the query is joining across many tables and aggregating data from one table in particular with millions of rows. The table has paging, but again that won't help the timinig issues due to the aggregation that must be performed on a large table.
    Surely there must be a way to get the dataTable to always load its data via ajax, and not only after the first time.Well JSF does not have AJAX built-in, so why would there be? Perhaps one of the AJAX-based frameworks has this. I imagine it wouldn't be hard to do with the existing AJAX frameworks even without a built-in component specifically for it. Trigger an AJAX action on load which rerenders a panel which will only contain the dataTable upon the rerendering.
    >
    I think I could do it by adding a 'dataTableRendered' variable to the bean and using a jsFunction to set this variable to True when the page loads, but I'm looking for a better way. (I'm also not 100% sure this would do what I want.)

  • Need to update a record on page load. How? (ASP/VBScript)

    The standard Update Record behavior requires a form on the page, plus a recordset to identify the value to be updated. In my scenario, the value for the record to be updated is already in the URL as the ID. I just don't know how to write it myself and Dreamweaver won't do this.
    The page I want to do this on is a record detail page, so there is already a record ID already present in the querystring. The record is new until a user views it, and what I need is something that just writes a simple value to one field in the table for the record being viewed. This is it in a nutshell:
    Using the value from the ID in the URL querystring, update the "viewed" field in a specific table with the value of "y".
    This would be the first operation as the page loads and then the page would load and show the data that it already does.
    I'd be happy with raw code is someone is generous enough to provide that, or perhaps some instructional help on reverse engineering the standard update record code generated by Dreamweaver. Or, if you know of any extensions designed to do this - I'd be interested in that too!
    My app I'm working on is in ASP/vbscript.
    Subject line edited by moderator to indicate server model

    Good point! I wasn't thinking about how that would make the app vulnerable to sql injection.
    The function I want to perform is similar to how an email changes from unread to read when you view it. I simple want the records being viewed to take on the status of being read or "viewed". Perhaps I'm going about this in the wrong way, but I've been planning to use a database field as the indicator of whether a record has a viewed status or not. Null value is new, and a value of "y" (yes) meaning the value is viewed/read.
    If you have a better recommendation, I'm all ears.

  • Looking for hook into a mb method on page load of jsff with auto query on view criteria.

    Hello,
    I have a View Criteria that is set to Query Automatically (showing data to match today's date).  The target table has a detail table and there is a control that shows parsed XML from the current row in the detail table into a table that I build dynamically. The main table and the detail table show the proper data on page load but the table for the parsed XML is empty.  The dynamic table is bound to a managed bean where the parsing is done and data is created.  I have the control refreshing properly on a row change of the main and detail tables and on a queryListener for the view criteria.
    This is for a jsff page. I have been trying a bunch of approaches with no success.  The detail table has a ppr to the main table and the query.  I am looking some event on either the query, the main table or the detail table where I can make a call to my managed bean to parse the XML, build the table and refresh the control.  I have an attribute binding to the XML data (when I placed it in a control as plane XML it refreshed properly).  I only need this on initial page load or first time the tables are populated, I have the other use cases covered.
    Running JDev 11.1.2.4
    Thank you
    Rudy

    ok but where?
    i have read a topic about "setRefreshOption", but i need a component to execute it.
    i have read a topic about a false criteria (1=2), and when i want search, i remove it, but again, i need a component to execute it.
    i have read a topic about ${adfFacesContext.postback == true} to write into iterator proeprty, but i haven't this view into my appmodule.
    i'm really sorry, but please, can you explain me a little ?
    Edited by: bradici on 8 oct. 2009 16:36

  • Method called three times on page loading

    I have a page with panelTabbed and several showDetailItems. On the first showDetailItem I have ADF Query component with the results table.
    I want the second showDetailItem to be enabled or disabled depending on whether there is a selected row in the results table or not.
    I have second showDetailItem's Disabled property set to an EL expression referring to a method in a backing bean.
    This method is called three times during initial page loading. I suspected that it was caused by some partialTriggers, but without any partialTriggers
    ADF behave the same way.
    Moreover, first two times there is a selected row in an iterator. Only the third time there's no selected row (empty initial state of the results table).
    And if this method returns false (not disabled) first two times and true (disabled) third time only, the second showDetailItem is enabled after page is loaded.
    What is responsible for these redundant calls of the method?

    Studio Edition Version 11.1.2.0.0
    Build JDEVADF_11.1.2.0.0_GENERIC_110531.1615.6017

  • ADF/JSF page loads when any command button is clicked

    Hello All,
    I am lost in the ADF/JSF page flow (using Jdev 10.1.3). Following are the tags (in order) in my page;
    (WHEN THIS PAGE LOADS, IT GOES TO THE DATABASE TO GET VALUES (for the drop down lists that will appear on the page); THIS SHOULD HAPPEN JUST ONCE AND AT THIS POINT)
    <f:view>
    <afh:body>
    <afh:html>
    <af:form>
    <af:panelpage>
    <f:facet name="contextSwitcher">
    <af:panelHorizontal> has a af:commandLink </af:panelHorizontal>
    </f:facet>
    <f:facet name="messages">
    <af:messages/>
    </f:facet>
    <af:panelform>
    <h:panelGrid columns="2" cellspacing="14">
    has 2 panelgroups (one group has *2 SelectOneChoice lists (that need to be populated by fetching data from database* and the other group has 2 CommandButtons - 'Go' and 'Cancel") (GO BUTTON SETS THE SHOWPANEL() TO TRUE)
    (WHEN GO BUTTON IS CLICKED, THE PAGE GOES TO THE DATABASE (AS IT DID ON PAGE LOAD). *THIS SHOULD NOT BE HAPPENING*. ONLY THE METHOD (action="#{muBean.doWork}" )THAT IS ASSOCIATED WITH GO BUTTON ACTION SHOULD BE CALLED)
    </h:panelGrid>
    <h:panelGrid columns="2" cellspacing="14" rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
    has 3 inputText fields
    </h:panelGrid>
    <af:table var="someTable" rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
    has a bunch of af:columns
    </af:table>
    <af:panelHorizontal rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
    has 3 af:commandButtons - submit, save, add row
    (WHEN submit or save or add row BUTTON IS CLICKED, THE PAGE KIND OF LOADS AND GOES TO THE DATABASE (AS IT DID ON PAGE LOAD). *THIS SHOULD NOT BE HAPPENING*. ONLY THE METHOD THAT IS ASSOCIATED WITH submit/save/add row BUTTON ACTION SHOULD BE CALLED)
    </af:panelHorizontal
    </af:panelForm>
    </af:panelPage>
    <!-- Footer -->
    <jsp:include page="/pages/includes/footer.jspx"/>
    </af:form>
    <f:verbatim>
    <script type="text/javascript" src="../script/tree.js"></script>
    </f:verbatim>
    </afh:body>
    </afh:html>
    </f:view>
    </jsp:root>
    _*why is it that when the command buttons are clicked, the whole page is loaded? Only the methods associated with the action (action="#{newMapRequestItem.addARow}" ) should be called.*_
    _*IS THERE A WAY TO AVOID THIS WITHOUT USING PARTIAL PAGE RENDERING ?*_
    _*DOES MY TAG NESTING LOOK OK?*_
    Edited by: user12054715 on Mar 24, 2010 12:00 PM

    Can somebody please address this?
    Thanks,

Maybe you are looking for

  • Adobe Photoshop Touch: Disable snapping in when moving pictures and text

    Hallo, I really have to disable that snap in when I move imported pictures or text in a file in Adobe Photoshop Touch but. I didn't find a feature yet to disable it. Can you help me please? Thank you. schokomueller

  • Issue with Sender File Adapter

    Hi, In Sender File Adapter I have used content convertion. If the content convetion fails or the channel goes to error state, the sender file channel stops polling. The channel is not polling in the next interval once it goes to error state. Please h

  • IPhone 4 (IOS 4.3.3) Exchange 2003 Contacts created on iPhone will NOT sync w Exchange

    if a contact is created in Exchange (via Outlook or OWA) it will sync into the iPhone flawlessly. But if it is created on the iPhone, it WILL NOT go into Exchange. I sync to my PC; I make sure enough time has passed for a iPhone sync-still DOES NOT W

  • Editing ProRes material on G4...

    Hello... I need to edit ProRes material on my dual 1Gig G4... 1Gb RAM... have Final cut 6... only have Firewire hard drives (400/800) on which to put the ProRes footage. Only need to edit on my cinema display - don't need to output to an HD monitor.

  • Keynote Edit Slide - Selecting a slide past 10

    Hello I have been experiencing an issue with the Latest Version of Keynote running on Yosemite Beta ( asking this question to determine if I need to install on another Mavericks machine) I have been creating a Presentation with multiple links to diff