On JSF Page load UI components loading sequence

Hi All,
I have some questions about the UI components loading sequence on the JSF page load.
When a JSF page loads it loads its UI components which have a sequence of getters and setters declared in the backing bean of that jspx page.
Qustion 1: How these getters and setters in backing bean work in loading the jspx page?
Question 2: How this backing bean is related to the Page Definition file for the page loading?
Question 3 (main query): What is the sequence of the getters and setters. Means, if i drop 3 UI components, 1 input text, then a command button and then an output text, then they are accordingly declared in backing bean. On page load first i/p texts getter gets called, then setter, then command button's and theno/p texts, in these sequence.
But can i manipulate their sequence of loading. If yes then how it can be possible?

Answer 1: Getters and Setters in bean normally will be bounded to ui component's properties in jspx page, when jspx page loads these getters get called through introspection and setters gets called when a request is submitted.
Answer 2: Backing bean and page definition are two different entities and they are no way related unless you have a data control for the backing bean and have bindings for those methods in page definition file
Answer 3: The sequence of getters and setters depends on the order of the components they bounded to in jspx page. components in jsf page gets loaded from top to bottom so the getter bound to the top component gets called first and the getter bound to bottom component gets called last.
The only way to change the sequence of getter methods getting called is to just change the order of the components they bound to in jspx page.
Usually, it is not suggested to put business logic inside getters and setters, where you have action and actionlisteners for the same. If you follow that, you don't need to worry of the sequence of getters and setters execution
Sireesha

Similar Messages

  • JSF page & Sqlserver DB - gave 'Use the sqljdbc4' class error !

    Hello,
    I created an JSF page with business components and data controls generated from a connected sqlserver database.
    The driver class used is 'sqljdbc4.jar' and works for all generaled VIEW LINKS by the AppModule.
    However, on running the created JSF page, I get the following error - although the 'sqljdbc4.jar class (NOT sqljdbc.jar) is used for the DB connection, and the only reference in the application.
    The error message is:
    Could not create pool connection. The DBMS driver exception was: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
    QUESTION: Does that mean that I need to locate another sqlserver driver that supports JRE version 1.6 - although I understood from the documentation that 'sqljdbc4.jar' should work with JRE version 1.6?
    see full message log below - when trying to deploy the JSF page:
    *** Using port 7101 ***
    C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain\bin\startWebLogic.cmd
    [waiting for the server to complete its initialization...]
    JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=512m
    WLS Start Mode=Development
    CLASSPATH=C:\Oracle\MIDDLE~1\patch_wls1032\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\JDK160~1.5-3\lib\tools.jar;C:\Oracle\MIDDLE~1\utils\config\10.3\config-launch.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.2.0.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.0/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\Oracle\Middleware\jdeveloper\webcenter\modules\oracle.portlet.server_11.1.1\oracle-portlet-api.jar;C:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.jrf_11.1.1\jrf.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\common\eval\pointbase\lib\pbclient57.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\xqrl.jar;.;C:\Program Files\TIBCO;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\KEEP\A_SOA_ActiveVOS\SQLserverjdbc_Driver\sqljdbc_2.0\enu\sqljdbc.jar
    PATH=C:\Oracle\MIDDLE~1\patch_wls1032\profiles\default\native;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\native;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\bin;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.0\bin;C:\Oracle\MIDDLE~1\JDK160~1.5-3\jre\bin;C:\Oracle\MIDDLE~1\JDK160~1.5-3\bin;C:\app\Administrator\product\11.1.0\db_4\bin;C:\app\Administrator\product\11.1.0\db_3\bin;C:\app\Administrator\product\11.1.0\db_1\bin;C:\Program Files\PHP\;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Windows System Resource Manager\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;C:\ANT\bin;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Common Files\DivX Shared\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE;;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32\oci920_8
    * To start WebLogic Server, use a username and *
    * password assigned to an admin-level user. For *
    * server administration, use the WebLogic Server *
    * console at http:\\hostname:port\console *
    starting weblogic with Java version:
    java version "1.6.0_14"
    Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
    Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode)
    Starting WLS with line:
    C:\Oracle\MIDDLE~1\JDK160~1.5-3\bin\java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m -XX:MaxPermSize=512m -Dweblogic.Name=DefaultServer -Djava.security.policy=C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy -Djavax.net.ssl.trustStore=C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks -Dhttp.proxyHost=emeacache.uk.oracle.com -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=null -Dhttps.proxyHost=emeacache.uk.oracle.com -Dhttps.proxyPort=80 -Dhttps.nonProxyHosts=null -Dweblogic.nodemanager.ServiceEnabled=true -Xverify:none -da -Dplatform.home=C:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\server -Djps.app.credential.overwrite.allowed=true -Ddomain.home=C:\Users\ADMINI~1\AppData\Roaming\JDEVEL~1\SYSTEM~1.36\DEFAUL~1 -Dcommon.components.home=C:\Oracle\MIDDLE~1\ORACLE~1 -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Djrockit.optfile=C:\Oracle\MIDDLE~1\ORACLE~1\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.domain.config.dir=C:\Users\ADMINI~1\AppData\Roaming\JDEVEL~1\SYSTEM~1.36\DEFAUL~1\config\FMWCON~1 -Doracle.server.config.dir=C:\Users\ADMINI~1\AppData\Roaming\JDEVEL~1\SYSTEM~1.36\DEFAUL~1\config\FMWCON~1\servers\DefaultServer -Doracle.security.jps.config=C:\Users\ADMINI~1\AppData\Roaming\JDEVEL~1\SYSTEM~1.36\DEFAUL~1\config\fmwconfig\jps-config.xml -Djava.protocol.handler.pkgs=oracle.mds.net.protocol -Digf.arisidbeans.carmlloc=C:\Users\ADMINI~1\AppData\Roaming\JDEVEL~1\SYSTEM~1.36\DEFAUL~1\config\FMWCON~1\carml -Digf.arisidstack.home=C:\Users\ADMINI~1\AppData\Roaming\JDEVEL~1\SYSTEM~1.36\DEFAUL~1\config\FMWCON~1\arisidprovider -Dweblogic.alternateTypesDirectory=\modules\oracle.ossoiap_11.1.1,\modules\oracle.oamprovider_11.1.1 -Dweblogic.jdbc.remoteEnabled=false -Dwsm.repository.path=C:\Users\ADMINI~1\AppData\Roaming\JDEVEL~1\SYSTEM~1.36\DEFAUL~1\oracle\store\gmds -DUSE_JAAS=false -Djps.policystore.hybrid.mode=false -Djps.combiner.optimize.lazyeval=true -Djps.combiner.optimize=true -Djps.auth=ACC -Doracle.core.ojdl.logging.usercontextprovider=oracle.core.ojdl.logging.impl.UserContextImpl -Doracle.wc.openusage.clustername=localhost -Doracle.wc.openusage.collectorport=31314 -Doracle.wc.openusage.timeout=30 -Doracle.wc.openusage.unicast=true -Doracle.wc.openusage.enabled=false -Doracle.webcenter.tagging.scopeTags=false -XX:+UseParallelGC -XX:+DisableExplicitGC -Dwc.oracle.home=C:\Oracle\Middleware\jdeveloper -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\Oracle\MIDDLE~1\patch_wls1032\profiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sysext_manifest_classpath weblogic.Server
    <Apr 19, 2010 6:36:22 PM EDT> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath:
    C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain\lib\mbeantypes\csp-id-asserter.jar>
    <Apr 19, 2010 6:36:23 PM EDT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 14.0-b16 from Sun Microsystems Inc.>
    <Apr 19, 2010 6:36:24 PM EDT> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.2.0 Tue Oct 20 12:16:15 PDT 2009 1267925 >
    <Apr 19, 2010 6:36:27 PM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <Apr 19, 2010 6:36:27 PM EDT> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
    <Apr 19, 2010 6:36:29 PM EDT> <Notice> <LoggingService> <BEA-320400> <The log file C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\logs\DefaultServer.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.>
    <Apr 19, 2010 6:36:29 PM EDT> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\logs\DefaultServer.log00003. Log messages will continue to be logged in C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\logs\DefaultServer.log.>
    <Apr 19, 2010 6:36:29 PM EDT> <Notice> <Log Management> <BEA-170019> <The server log file C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\logs\DefaultServer.log is opened. All server side log events will be written to this file.>
    <Apr 19, 2010 6:36:49 PM EDT> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
    <Apr 19, 2010 6:37:27 PM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
    <Apr 19, 2010 6:37:28 PM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <Apr 19, 2010 6:38:44 PM EDT> <Notice> <LoggingService> <BEA-320400> <The log file C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\logs\DefaultDomain.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.>
    <Apr 19, 2010 6:38:44 PM EDT> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\logs\DefaultDomain.log00003. Log messages will continue to be logged in C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain\servers\DefaultServer\logs\DefaultDomain.log.>
    <Apr 19, 2010 6:38:44 PM EDT> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.>
    <Apr 19, 2010 6:38:48 PM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
    <Apr 19, 2010 6:38:48 PM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
    <Apr 19, 2010 6:38:48 PM EDT> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 10.254.255.241:7101 for protocols iiop, t3, ldap, snmp, http.>
    <Apr 19, 2010 6:38:48 PM EDT> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7101 for protocols iiop, t3, ldap, snmp, http.>
    <Apr 19, 2010 6:38:48 PM EDT> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 0:0:0:0:0:0:0:1:7101 for protocols iiop, t3, ldap, snmp, http.>
    <Apr 19, 2010 6:38:48 PM EDT> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "DefaultServer" for domain "DefaultDomain" running in Development Mode>
    <Apr 19, 2010 6:38:48 PM EDT> <Warning> <Server> <BEA-002611> <Hostname "WINSERVR2008", maps to multiple IP addresses: 10.254.255.241, 0:0:0:0:0:0:0:1>
    <Apr 19, 2010 6:38:49 PM EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
    <Apr 19, 2010 6:38:49 PM EDT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
    IntegratedWebLogicServer startup time: 192201 ms.
    IntegratedWebLogicServer started.
    [Running application BraaineDBupdateV1 on Server Instance IntegratedWebLogicServer...]
    [06:39:24 PM] ---- Deployment started. ----
    [06:39:24 PM] Target platform is (Weblogic 10.3).
    [06:39:30 PM] Retrieving existing application information
    [06:39:33 PM] Running dependency analysis...
    [06:39:33 PM] Deploying 2 profiles...
    [06:39:37 PM] Wrote Web Application Module to C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\o.j2ee\drs\BraaineDBupdateV1\ViewControllerWebApp.war
    [06:39:39 PM] Wrote Enterprise Application Module to C:\Users\Administrator\AppData\Roaming\JDeveloper\system11.1.1.2.36.55.36\o.j2ee\drs\BraaineDBupdateV1
    [06:39:39 PM] Deploying Application...
    <Apr 19, 2010 6:39:43 PM EDT> <Warning> <J2EE> <BEA-160195> <The application version lifecycle event listener oracle.security.jps.wls.listeners.JpsAppVersionLifecycleListener is ignored because the application BraaineDBupdateV1 is not versioned.>
    <SQLServerConnection><<init>> Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
    <Apr 19, 2010 6:39:45 PM EDT> <Warning> <JDBC> <BEA-001129> <Received exception while creating connection for pool "BraineDB": Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.>
    <Apr 19, 2010 6:39:47 PM EDT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1271716780677' for task '0'. Error is: 'weblogic.application.ModuleException: '
    weblogic.application.ModuleException:
         at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:290)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:391)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:59)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:256)
         at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1180)
         at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1104)
         at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:244)
         at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1065)
         Truncated. see log file for complete stacktrace
    >
    <Apr 19, 2010 6:39:47 PM EDT> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'BraaineDBupdateV1'.>
    <Apr 19, 2010 6:39:47 PM EDT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException:
         at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:290)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:391)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:59)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:256)
         at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1180)
         at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1104)
         at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:244)
         at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1065)
         Truncated. see log file for complete stacktrace
    >
    [06:39:47 PM] #### Deployment incomplete. ####
    [06:39:47 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
    #### Cannot run application BraaineDBupdateV1 due to error deploying to IntegratedWebLogicServer.
    [Application BraaineDBupdateV1 stopped and undeployed from Server Instance IntegratedWebLogicServer]

    No, you already have the needed driver in sqljdbc4.jar. The problem is that your classpath first points to sqljdbc.jar
    >
    ...;C:\KEEP\A_SOA_ActiveVOS\SQLserverjdbc_Driver\sqljdbc_2.0\enu\sqljdbc.jar
    >
    so this dirver is loaded instead of the sqljdbc4.jar.
    Remove the old jar from the class path and try again.
    Timo

  • How to Use another JSF page that I load by XMLHttpRequest?

    Hi everyone, I'm a newbie of JSF and curisous about how to load page content seperately by AJAX.
    I saw example of Java Blue Print. It's load some data to use in page. What I want is to load another JSF page when click a link or button, (Like include another page). And work with functions privoided by loaded JSF Page.
    My example is, In a main page. I request a JSF page and set it into a div layer.
    var requestURL = "/admin/customer/customer-list-body.faces";
    var content = postDataWithoutContent(requestURL);     divContent.innerHTML = content;     
    All JSF components are required under <f:view>, thus action of form is set as "action='"/admin/customer/customer-list-body.faces'"
    But my page is main.jsp. Each time I click command button in customer-list-body.faces, the url will change to customer-list-body.faces, I want to request and hold in main.jsp.
    What can I do then? Any advices?

    Hi,
    the list doesn't seem to be your problem. You need to track down the illegal argument exception. Once you have that sorted out, expose the method on the AM so it gets shown as a method binding. The return values then could be picked up in a managed bean to create the select Item list
    Frank

  • 12c design view of JSF page fails to render with 'Loading failed  Reason: Connection reset by server'

    When in the design view of a JSF page, the page never renders in JDeveloper 12c.  Instead I get an error message 'Loading failed   Reason: Connection reset by server'.  I traced this to a conflict with the port used by Cisco Anyconnect (5001) which seems to be something JDeveloper uses as well to render the page.  Is there a way to change the port used to render the page in design mode?  I could not find any settings in the preferences.

    Hi Frank,
    The proxy settings are set to use the system default proxy settings in JDev and I have not needed to change it when VPN'ed. 
    The product that is in conflict is the 'AnyConnect Web Security Agent' (acwebsecagent.exe) which runs whether I am on vpn or am in the office - it is listening on port 5001 and that is the same port jdev64w.exe is listening to when rendering the page in the design mode.  I confirmed this using netstat -ab.  After  getting the conflicting program switched off temporarily, the design mode of the page was rendered within the IDE so that I could then drop components on the design surface.
    Since I cannot get the Cisco product to listen on a different port, I am hopeful there is a way to modify the port used by JDev.
    Thanks,
    Sunil

  • How to clear the Managed Bean Values prior to load a JSF page

    Hello.
    I have a jsf page that contains fields that need to be cleared BEFORE the page is loaded.
    My managed bean where the fields are linked (I�m using the value attribute) is in the SESSION scope because I need to control they values across a popup window and if I use request scope, my vectors that load objects like dataTable are cleared when I post the form.
    My question is :
    How I CLEAR all the values in the managed bean BEFORE the page is loaded ???
    In the WebForms (Microsoft .NET) I have an method on the codebehind called Page_Load where I put my initialization code for my page.
    Thanks in advance.
    Rog�rio

    Rog�rio,
    You can do this with a PhaseListener. Just regiser a new listener for the RESTORE_VIEW phase, and implement the beforePhase method; you can do this in the backing bean's constructor, or somewhere elase. This is pretty much the same as the Page_Load event handler in .NET.
    Kito D. Mann
    Author, JSF in Action
    http://www.jsfcentral.com - JSF news, info, and FAQ
    Hello.
    I have a jsf page that contains fields that need to be
    cleared BEFORE the page is loaded.
    My managed bean where the fields are linked (I�m using
    the value attribute) is in the SESSION scope because I
    need to control they values across a popup window and
    if I use request scope, my vectors that load objects
    like dataTable are cleared when I post the form.
    My question is :
    How I CLEAR all the values in the managed bean BEFORE
    the page is loaded ???
    In the WebForms (Microsoft .NET) I have an method on
    the codebehind called Page_Load where I put my
    initialization code for my page.
    Thanks in advance.
    Rog�rio

  • Jsf page not loading

    hi am geting this error when trying to click the button to load jsf page am using the view to link two pages where QUERY IS ANOTHER VIEW
    oracle.adf.controller.activity.ActivityLogicException: ADFC-02013: The ADF Controller cannot find metadata for activity 'Query'.
         at oracle.adfinternal.controller.util.Utils.createAndLogActivityLogicException(Utils.java:233)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:972)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:824)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:554)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:158)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:115)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:84)
         at org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:50)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:130)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:106)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:965)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:346)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:204)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Edited by: user603350 on 2011/12/15 1:53 AM

    hi,
    Can you provide some code?
    Regards
    Dimitris.

  • Loading page animation while JSF page is being loaded

    JSF 2.1
    Mojarra 2.1.7
    JBoss 7.1.1
    The backing bean on my JSF page(s) are view-scoped, and during the initial request, the backing bean's @PostConstructor method may take some time to return as it is calling external systems that are outside of my control. Thus, during the RENDER_RESPONSE phase of the initial request to the JSF page, it may take, on average, 3 to 5 seconds to return ( sometimes longer than that .... which again, is outside of my control ). While this is happening, the page rendered is of course blank as the response has not been written yet.
    Naturally, I am thinking of a way to show an animated loading image.
    1) I have seen suggestions of using a4j:status and a4j:region, but these are only valid for Ajax requests, while what I need is something that I can use during the initial request ( not a post back ), of a JSF lifecycle.
    2) Suggestions of using two HTML divs... one DIV shows the animated image while the other DIV wraps the real content, but is initially hidden. Then use window.onload() to swap the style of the two DIVs so that the DIV wrapping the real content becomes visible while the DIV wrapping the animated image becomes hidden.
    But then again ... these DIVs will NOT be written to the response yet as I am still in RENDER_RESPONSE phase.
    The only thing that I can think of is to:
    3) Create another page whose sole purpose is to show the animated image, then somehow immediately forward the request to the real page. The animated image on the first page will hopefully continue animating until the final page is rendered.
    What have you guys done ?

    jmsjr wrote:
    gimbal2 wrote:
    3(alt)) show a view which displays the animation and then triggers the long-loading page to be requested (no forward). The long-loading page does not generate any response until there really is something to show, to keep the animation view visible.
    This was the simplest solution by far .. although there are some quirks to be deal with when using IE.As usual :/ It remains a questionable product no matter how many times they reinvent the wheel.

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

  • Error loading JSF page popup window - Cannot find FacesContext

    Hello,
    I am trying to load a popup window from my Visual Web JSF page. The popup window itself will be a Visual Web JSF page also.
    As an example, i have 2 buttons on my original page with jsp tags as follows::
    <webuijsf:button binding="#{Page1.button1}" id="button1" onClick="window.showModelessDialog('./PopupPage.jsp'); return false;"
    style="left: 19px; top: 16px; position: absolute" text="Button"/>
    <webuijsf:button actionExpression="#{Page1.button2_action}" binding="#{Page1.button2}" id="button2"
    onClick="window.showModelessDialog('./PopupPage.jsp');" style="position: absolute; left: 20px; top: 44px" text="Button"/>
    When i click Button1, the popup window appears but will not load the page within the window. I get the following report in the server log:
    StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.lang.RuntimeException: Cannot find FacesContext
    at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
    at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
    at org.apache.jsp.PopupPage_jsp._jspx_meth_f_view_0(PopupPage_jsp.java from :102)
    at org.apache.jsp.PopupPage_jsp._jspService(PopupPage_jsp.java from :77)
    ETC ETC
    If i click Button2 (which does NOT return false in the onclick Script and thus submits the first page) the first attempt fails with the same error, but if i try a second time the popup window displays and loads the page correctly.
    Any solutions would be greatly appreciated as this is driving me crazy :-s
    Edited by: coxy69 on Jan 9, 2008 10:29 PM

    Cannot find FacesContextThis generally indicates that you invoked a request which points to a JSP page which contains JSF tags, but that the request itself isn't passed through the FacesServlet. Make sure that the request URL is covered by the url-pattern setting of the FacesServlet in the web.xml.

  • Method call before visual web jsf page loads

    Hi All.....
    I have written a method in a java class that accesses the mysql backend db to check if a process is still running. If the process is still running, a JOptionPane is produced informing the user of this and offers an <ok> option(to check the process status again) and a <cancel> option(to redirect the user to the homepage). If the process is completed, I want the page to just load as normal. I want this method to be called before the visual web jsf page loads. I have the method call in the super_init() method of the page and everything seemed to be working fine, the problem I have run into is that if I set the value in the db to show the process is running, the JOptionPane is produced(like it should be), and then if I set the value to show the process has completed and choose <ok> from the pane, the page loads.....this is what I want. Now, after the page loads, if I set the value in the db to show the process is running again, the JOptionPane is produced again right after I apply the changes to the db edit!!!!. I don't know why this is happening. Should I be calling the method from somewhere other the super_init()????? I have tried the method call in the prerender(), preprocess(), and destroy() methods all with the same results.
    Anyone have any ideas on what the problem could be??
    Thanks in advance.
    Silgd

    The Java part of a JSP/Servlet based webapplication runs physically at the server machine.
    Only the HTML/CSS/JS part which is generated by the webapplication and sent to the client physically runs at the client machine.
    JOptionPane is a Java Swing component which thus runs at the server machine. So you as client would only see it when both the server and the client runs at physically the same machine. Which is often only the case in development environment and doesn´t occur in real life! There is normally means of two physically different machines connected through the network/internet.
    To solve your actual problem, look for Ajax poll techniques. To display an alert or confirm dialogue in the client side, you use Javascript for this.

  • Loading another jsf page from current jsf page

    Hello,
    I would like to add a button and then write logic to load another jsf page when the button is pressed
    Any sample code can be referenced?
    Thanks

    This is well documented in http://download.oracle.com/docs/cd/E15523_01/web.1111/b31973/af_navigate.htm
    Timo

  • JSF Page Load

    Is there such thing as a JSF Init Page Load? the same thing that .net has with Page_Load? How do i init the code behind bean?

    @sdechgan
    I had the same problem. What you can do is the following:
    in your Bean you need all your request parameters as properties with getter and setter.
    additionally add a boolan prepare property. Set this to false at the beans constructor : this.prepare = false;
    in your faces config define your bean this way :
    <managed-bean>
            <managed-bean-name>myBean</managed-bean-name>
            <managed-bean-class>org.you.package.beans.myBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
            <managed-property>
                 <property-name>requestParam01</property-name>
                 <value>#{param.requestParam01}</value>
             </managed-property>
             <managed-property>
                 <property-name>requestParam02</property-name>
                 <value>#{param.requestParam02}</value>
             </managed-property>
             <managed-property>
                 <property-name>prepare</property-name>
                 <value>true</value>
             </managed-property>
        </managed-bean>in your view add such a single line at the beginning ( right under <f:view... > )
    <h:panelGroup rendered="#{myBean.prepare}" />now, tomcat will execute myBean.getPrepare( )
    this method should look like this :
    public boolean getPrepare()
              if (prepare)
                   //do what you want with your request params. they are already set at this point !
              prepare = false;
             return prepare;
         }after loading the view once, the getPrepare Method is executed and the prepare property is set to false.
    I need that, because getPrepare is loaded at any ajax page reload, too. ( I'm using icefaces )
    access your jsf page with : http:localhost:8080/whatever/myPage.iface?requestParam01=hello&requestParam02=World

  • Javascript not loading in my JSF page

    I have a JSF page in which I use the t:popup field, which I can't get to show:
    <tr>
                        <TD><t:popup id="testpop" styleClass="popClass"
                             closePopupOnExitingElement="true" closePopupOnExitingPopup="true"
                             displayAtDistanceX="10" displayAtDistanceY="10">
                             <h:outputText id="obtest" value="pelle" />
                             <f:facet name="popup">
                                  <h:panelGroup>
                                       <h:panelGrid columns="1">
                                            <h:outputText value="Sample Popup Text" />
                                       </h:panelGrid>
                                  </h:panelGroup>
                             </f:facet>
                        </t:popup></TD>
                   </tr>
    I can compile the code without any errors and also load the page successfully with no javascript errors or other errors. However, the popup box does not show up. It is like the JSPopup.js script has not been loaded properly. But if I put an alert() in the JSPopup.js file it displays it on page load???
    On the same page I have an inputCalendar that works as it should, so I would think the correct JAR files have been loaded.
    I also have a home grown javascript:
    <script src="js/scripts.js" type="text/javascript">�</script>
    The function that uses this script only works when the above line is put right before the </body> (not in <HEAD>). This makes me believe that the same problem applies to the JSPopup.js file since it is rendered/included in the <HEAD> section.
    This is driving me crazy. Any ideas are welcome.
    Thanks

    Do you have any security or privacy oriented add-ons? These may include a feature to block content from sites other than the one you're on.
    If you want someone to look at your list, you can copy and paste it from the second table here:
    Help > Troubleshooting Information
    Alternately, you can try those sites with your add-ons disabled using Firefox's [http://support.mozilla.com/kb/Safe+Mode Safe Mode]. Use
    Help > Restart with Add-ons Disabled
    In the dialog, don't check any boxes, just click "Continue in Safe Mode." If the sites work as designed, then the most likely culprit is one of your add-ons.
    Does that help at all?

  • JSF page 'Initial load' problem

    I've found several threads touching on this already, but none seem to have a solution.
    When JSF loads a JSP page for the first time, it goes through the restore view phase which creates an initial view (as there isn't a current one to restore). It then goes directly to the render response phase.
    My problem is, I have a JSP/JSF page that I pass paramaters to via html GET. For example:
    http://localhost:8080/jsf/region.jsp?locationForm:directorate=1&locationForm=locationForm
    Because the first load goes directly to the render response phase, the parsing of these paramaters is never done & the page does not update as expected.
    The second time you perform the same request, JSF goes through the standard request processing lifecycle and works as you would expect, setting directorate to 1 in the backing bean and displaying an updated page.
    Is there any way to change JSF's default behaviour on a JSP initial load to do the whole lifecycle? Is there another way to get around this, short of loading the page twice to ensure it has the right information in it (which would be quite a hack)?
    I need to use html GET (as opposed to html POST) because:
    I'm using a technique of a hidden iframe that loads dynamically created javascript to update a dropdown list (DDL) on the main page without reloading the page in its entirity. This is to minimise network chatter as the system will be run on a 56k network. I have an onchange event on my JSF DDL that calls javascript to reload the hidden iframe.

    Thanks for the replies.
    I tried both of the suggested options
    1. If your bean is managed (declared as managed bean in faces_config), you can set the initial value of the property as, for example, #{param.locationFor }.
    Unfortunately I can't use this option as the backing bean i'm using has to be session scope. This is because the DDL options are set by the iframe page, not the main page. There could be many request/responses between client/server before the user finally presses the submit button. If I change the backing bean to request scope, I end up getting "Validation Error: Value is not valid" for the DDL because the selected ID is not in the backing bean's list of possible values for the DDL.. #{param} can't be used for session level BBs.
    2. If you don't want to use the managed bean properties, you can go get your parameters in your bean's constructor.
    I'm unable to use this option either. The backing bean is shared between the main page and the hidden iframe page. When the main page loads, the backing bean's constructor is called but that isn't the time when parameters need to be parsed. When the iframe page is loaded for the first time (via javascript onchange on a DDL on the main page) using http://localhost/iframe.jsf?iframeForm:ddlId=1&iframeForm=iframeForm is when I need to parse the parameters, by which time the backing bean is already instanciated and the constructor has already been called.
    I'm looking at where else I could get the parameters other than the constructor. I might be able to do it elsewhere.
    My guess as to why the following code works is it's not using a backing bean & isn't updating backing bean values on the first run:
    <f:view>
    <h:outputText value="param= #{param}"/>
    </f:view>To replicate the problem, create a simple backing bean, for example:
    public class sample {
        private Integer selectedId
        public String getSelectedId() {
            return selectedId
        public void setSelectedId(Integer selectedId) {
            this.selectedId = selectedId;
    }Then create the following sample.jsp:
    <!doctype html public "-//w3c//dtd html 4.01 transitional//en">
    <!--
      Copyright 2004 ArcMind, Inc. All Rights Reserved.
    -->
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <html>
    <head>
    <f:view>
      <h:form id="iframeForm">
        <h:panelGroup>
          <h:inputText id="selectedId" value="#{sample.selectedId}" />
        </h:panelGroup>
      </h:form>
    </f:view>
    </head>
    </html>Then try going to sample.jsp?iframeForm:selectedId=10&iframeForm=iframeForm (Similar to the request my main page is doing via javascript to populate the hidden iframe)
    The first time you do this, the text box will be populated with 0 (ie, it skipped the JSF lifecycle and ignored your 10 input). The second time and subsequent times it works as expected, with the text box containing the number 10.

  • Using Business Components in JSF pages

    I have several questions about using BCs in JavaServer Faces pages. I'm new to the JSF-BC development world.
    Here's what I'm trying to accomplish: a salesperson gets a call from a customer requesting a quote. The salesperson selects the URL for my RFQ form and begins filling it out. If there is an existing customer record in the company's database, the salesperson wants to be able to load customer info into the form from the database, rather than typing it all in. Reasonable enough, and probably simply enough.
    But it's kickin' my butt. I've created the domain objects (including one for the customer database, call it "CU") and the model objects (a View Object that filters out all fields but those needed on the form, an Application Module with a View Object Instance). Initially I am routing from the main form window to a dialog window where I am hosting the customer selection components, intending to return to the main window with the selection. On the dialog window I've dropped the VO and configured it to be an ADF Navigation List (which gets implemented as an af:selectOneChoice component). So far so good. The navigation to and from is working fine. The selectOneChoice list is being populated with the first range of returned records. Here's where I'm stuck.
    First of all I can't figure out how to kick the iterator into sending additional records after it's first range. You can scroll down to the end of the list in the selectOneChoice component but nothing happens after that. I know I can set the iterator's range to 0 to get all of the records dumped in at once, but that takes way too long. Any ideas?
    Secondly, when a selection is made, how do I access the selected data? I have set up a ValueChangeListener method in my dialog's backing bean that gets the NewValue() from the event object, but that value turns out to be the index into the collection of selectItems. How do I get the value of the data that shows in the list? Is that the label of the selectItem? If so, how do I access it? What I really want is to get the entire row of data represented by the returned index, but I'm lost as to how to do that. Any help would be much appreciated.
    At some point I want to let the salesperson type in a partial customer name and then retrieve only records matching the query's where clause. I see where I can create a bind variable on the view object, but am not sure how to pass the partial name value from the main form to the dialog. Currently I use an EL expression in the Action attribute of an af:selectInputText component to navigate to the dialog and I don't think I can pass parameters with that. I guess I would have to switch to using a method binding to a backing bean, eh? But even if I can get the partial name value to the dialog, how do I bind that value to the bind variable of the VO? (the VO that is already bound to the af:selectOneChoice component in the dialog.)
    And I am totally open to alternative suggestions for how to accomplish the original intention of all of this. Thanks for any guidance.
    Johnny Lee

    Thanks, Shay. That has gotten me a few steps further along. I modified my VO by creating a bind variable and modified the SQL to use this variable in it's where clause. I generated Java for my AppMod (which I hadn't done before, preferring to keep things simple) and created a method to supply a value to my VO's new bind variable. I need a little more hand-holding, though, to wire an input text field & button (or af:selectInputText?) to both the AppMod's new method AND the data component that will display the query results.
    "...drag the exposed method as a button onto a JSF page." That's easy enough, but I haven't yet figured out from the examples how to associate the value of an input component with the parameter of the AppMod's new method. It's getting late, I'm starting to see cross-eyed so I will sleep on this and take another look in the morning. Thanks for your help.
    Johnny Lee

Maybe you are looking for