af:serverListener not fired on a jspx page load

Hi,
I'm using JDeveloper 11g Update 1.
I would like to fire a serverListener on a jspx page load.
The javascript method that i'm using is fired while the server listener is not fired.
Here's the code.
<pre>
//In my jspx
<af:document title="Page Title" clientComponent="true">
<af:clientListener method="fireServerListener" type="load"/>
<af:clientAttribute name="serverListenerType" value="serverMethod"/>
<af:serverListener type="serverMethod" method="#{myBean.serverMethod}"/>
<f:facet name="metaContainer">
<trh:script source="js/lib.js"></trh:script>
</f:facet>
//In lib.js
function fireServerListener(event){
var source = event.getSource();
var immediate = this._immediate;
var params = {};
var srvLstnrType = source.getProperty("serverListenerType");
AdfCustomEvent.queue(source, srvLstnrType, params, immediate );
//In my bean
public void serverMethod(ClientEvent clientEvent) {
System.out.println("serverMethod() is called");
</pre>
Please, give any ideas how to resolve it.
Best Regards,
JavaDeVeLoper

Hi Frank,
I've tried what's suggested. I've placed the trh:script at the bottom of the page.
The server listener in this piece of code at the bottom is fired, but in my case the problem (to fire a server event on body load) still exists.
<pre>
<af:commandButton text="Button" partialSubmit="true" clientComponent="true">
<af:clientListener method="fireServerListener" type="action" />
<af:clientAttribute name="serverListenerType" value="serverMethod" />
<af:serverListener type="serverMethod"
method="#{myBean.serverMethod}"/>
</af:commandButton>
</pre>
Any suggestions :)
Best Regards,
JavaDeVeLoper

Similar Messages

  • Thrown validation exception not being showed in jspx page

    Hi,
    I have a page with af:table which uses one view object.That view object is using one entity object. In one of the method of the EntityImpl class of my entity object i throw ValidationException.I debugged the application and i saw that it is throwing the exception.But it is not being shown in the page. What might be wrong here?
    try{
    setAttributeInternal(BANKTYPE, value);
    catch(TooManyObjectsException e) {
    e.printStackTrace();
    throw new ValidationException ("You are trying to add existing record");
    My jspx page is having *<af:messages id="m1"/>*
    Does the jspx page need any configuration to show the thrown exception in a popup?
    Regards,
    Priya.

    Hi vinod,
    I tried it and it worked.Thanks a lot :). Can you please tell me why it was not happening with the ValidationException?
    Regards,
    Priya.

  • ADF JDeveloper wysiwyg visual editor does not render properly my jspx page

    Hi everybody,
    I am working with JDev 11.1.1.5 and I have an issue with the wysiwyg visual editor.
    My jspx page does not render properly: I cannot see the full page whatever is the resolution, even in full screen mode.
    I've tried to activate in the preferences the option Show Design Time Messages in Log but it does not display any error.
    When I run my page or execute a preview of my page, my page is rendered correctly the browser.
    Can someone help please?
    Thanks by advance

    Hi Frank,
    I've tried to change the resolution but whatever is the resolution the page is not rendered correctly. Actually, I can see the full page, but there are some panel boxes which are not displayed.
    In my page, I have a main panelgrouplayout which contains 2 dashboard panels. The second dashboard contains panel boxes, only the 3 first rows of panel boxes are displayed in this dashboard panel while I have 6 rows of panel boxes.
    In the design page, when I click on the 2nd dashboard and do "design this container", I can actually see that all the rows display correctly, it simply that I do not see them all in the main page.
    In short, the 2 dashboard panels display entirely, simply the 2nd one does not show all its content while displayed in the main page.
    Is there a solution for this?
    Thanks by advance

  • Issue with invoking javascript during jspx page load

    Hi All,
    I am using Jdeveloper 11gR2.
    I have embedded a small javascript snippet in the adf page to invoke a managed bean method during page load.
    <af:serverListener type="onloadEvent" method="#{AMBean.click}"/>
                <af:clientListener method="onLoadClient" type="load"/>
                <af:resource type="javascript">function onLoadClient(event) {AdfCustomEvent.queue(event.getSource(),"onloadEvent",{},false); return true;}</af:resource>
    In the associated managed bean method, I want to change the setContentStyle of all the input text field found during run time -
            System.out.println("There control is inside the listeners");
            FacesContext facesContext = FacesContext.getCurrentInstance();
            System.out.println("facesContext"+facesContext);
            UIViewRoot root = facesContext.getViewRoot();
            System.out.println("root - " +root);
            RichPanelFormLayout formClass = (RichPanelFormLayout)root.findComponent("db");
            System.out.println("formClass - " + formClass);
            List<UIComponent> uiComponentList = formClass.getChildren();
                  for (UIComponent uiComponent : uiComponentList) {
                      if (uiComponent instanceof RichInputText) {
                          //((RichInputText)uiComponent).setDisabled(false);
                          //((RichInputText)uiComponent).setColumns(100);
                         ((RichInputText)uiComponent).setContentStyle("width:200px");
                          System.out.println("uiComponent - " +uiComponent);
    Currently the javascript function "queues" the setContentStyle action for an action event, i.e. during the initial page load, the properties of text fields are not changed, however as soon as i click any button on the page, the text field width is reset to what I have defined in setContentStyle property.
    Is there a way to execute setContentStyle action as soon as the page loads initially?
    Best Regards,
    Ankit Gupta

    Hi Arun,
    Many thanks for the revert.
    The exact Jdeveloper version is 11.1.2.4.39.64.36.1.
    I have a scenario where in the the user will be navigated to a page to display an input form, but the underlying VO will change during runtime which means depending on the value selected by the user, he will be shown an ADF form accordingly.
    Also during runtime, the number of input text fields will change according to the number of attributes in underlying VO.
    Kindly advise based on the use case explained above.
    Best Regards,
    Ankit Gupta

  • CSS on some pages is not displaying properly on initial page load.

    I'm running into an issue where a page loads and the styles do not render correctly. After the page loads, I can temporarily fix this by choosing: View->Page Style->No Style, then doing it again with: View->Page Style->Basic Page Style. Though when navigating away from the page and then coming back to it, I will have to do it over again.
    I'm experiencing this issue on v. 36.0.3 for Windows and v. 36.0 for Ubuntu

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can check the Net log and the Network log in the Web Console (Firefox/Tools > Web Developer) to see how long it takes for content to arrive.
    *https://developer.mozilla.org/Tools/Network_Monitor
    You can also try to reset (power on/off) the router and maybe check with your ISP if it happens on more than one OS.

  • Question about table data loading at startup of .jspx page

    I'm trying to debug an intermittent user error - the user loads a .jspx page (jdev 10.1.3.1) - this page contains an af:table that uses a read-only view object with a sql statement containing bind variables. The table uses a partial trigger linked to a command button that when pressed, updates the data in a table by calling a service method on the application module. The pagedef file does not contain an invokeaction, so my assumption is that the table will not attempt to be populated or execute the sql in the view object until the user pressess the command button?
    The error received is a JBO-271222 - it appears (though not 100%) that when the page loads the sql on the view object attempts to execute w/o the user pressing the command button, which gives an error saying the statement parameter 1 (bind variable) is not set. I have not been able to replicate the issue, but a couple of users have experienced this. Is there any reason the table would attempt to execute the view object when the page is first loaded?
    Note one other twist is that the id for the af:table is also used as a partial trigger to another section of the page (so that when the table is populated and a row selected, the other section of the page is updated.) This should not be causing the view object to run at startup though.
    Thanks for any suggestions.

    Hi javaX,
    I'll take a shot at this one...
    Here's my guess: I think the answer may lay in your pageDef.xml file.
    1) You have no <invokeAction> in your file, so you're not running the <action> / <methodAction> to set the parameters.
    2) However, you do have an <iterator> for your viewObject. This <iterator> does infact get executed during the startup of your application.
    My suggestion is to perhaps tweak the refresh= / refreshCondition= for the iterator. This way you can identify when the <iterator> will get executed. Also check the possible use of #{adfFacesContent.postback} in the refreshCondition. This may also help you out.
    The other suggestion is to set some arbritary NDValue= for your <action>/<methodAction> that will cause the query to return nothing, and then <invokeAction> this before your iterator. The execution in pageDef.xml is sequental in the <executables> section.
    Hope this helps!
    Kenton

  • Cursor does not appear on Facebook page load. Spacebar shifts page down.

    Cursor does not appear anywhere on Facebook page load. It used to land in the first text box, and as I was used to this I would open an FB page and start typing. Nothing was entered into the text box, and when I hit Spacebar it shifts the page down.
    Couple of things:
    It acts this way both in normal and in "safe mode".
    It acts correctly on Google - it is my home page and when I open it the cursor is always in the search box. It also acts correctly on YouTube.
    The cursor DOES NOT appear in the URL bar (thankfully)
    The cursor DOES NOT appear in any text boxes on any other pages I open >> The Weather Channel, TED.com, Amazon.com
    The Spacebar scrolls the screen down one frame at a time.
    It has the same behavior with the "Always use the cursor keys to navigate within pages
    I am using FF 18.0.1 on Windows XP
    I have tried a lot of the weird tips and tricks suggested on this support forum, but none of them address specifically this issue.
    Thanks in advance.

    If I'm not logged on then the cursor is in the login form at the top.<br />
    Once logged in the main body has focus and not a specific element, so you have to click in an input filed to set focus to it.
    If it worked before then they have changed the code of that page recently and it is just a coincidence that it happened around the time that Firefox updated.

  • 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

  • Scroll goes to bottom when page loads

    Hi all,
    I'm facing a kind of presentation problem with a Portal we are developing based on WebCenter 11g technology. We are currently using JDev 11.1.1.3.0 version.
    The situation is as follows:
    We have a base page (let's say base.jspx), this page contains a region and in the region a .jsff is showing some content from a Bean whose information comes from UCM. This region is divided in two parts: main content and related items (which are also the same kind of content). The action on the related items of the content being showed should reload the region shoing the new content and its related items.
    The problem is that when clicking on a related item, when the region reloads, it goes automatically to the bottom if the article is long enough as to create scroll. Notice that we don't redirect to any jspx page different that base.jspx at any moment. We remain at base.jspx and it is just the region that reloads with the new information. In this sense, solutions based on javascript on the main page trying to set the window scroll to (0,0) don't work as the window itself has no scroll. It is the region that has the scroll (actually, the corresponding panelStretchLayout or PanelGroupLayout).
    I've also tried to fix it with a javascript function trying to get the elementId and set its scroll, but the elements from the jsff are not visible from the jspx page.
    Do you have any idea why I'm getting this behavior?
    Any light you could shed on this would be highly appreciated.
    thank you very much in advance
    Juanma.

    In seems that the problem is that the last component being shown in the PanelGroupLayout is a commandLink which has associated an af:showPrintableBehavior. The component is getting the focus on it so that's why the page goes directly to the bottom.
    As I commented in previous posts, the page is not reloading, and it is part of a jsff contained in a main jspx, so javascript based solutions would be hardly possible.
    Any suggestion?

  • Getting Page Load Error while opening a Opportunity in new window

    Hi All,
    outbound SSO is enabled.
    when i try to punch-in to my application from CRM through opportunity web link with Web Link Target as "open in custom tab" its working properly, but when i have Web Link Target as "open in new window" i am getting page load error. previously with out Outbounf SSO it is working properly.
    Do i need enable any settings in CRM
    thanks

    when the web link target is "open in new window" or "open in current window" the request send to third party application from CRM ONDemand is HTTPS request as SSL is not enabled it is giving "page load error"(In the web link we are specifying http only) (User athentication type is "username & password/ SSO")
    Is there any setting in CRM Ondemand to send Http request only instead of HTTPS?

  • Af:serverListener on jspx page - compilation error - jDeveloper 11.1.1.4.0

    I have a weird problem that adding a serverListerner component on jspx page causes compilation error:
    The class of the deferred-methods return type "{0}" can not be found.
    No property editor found for the bean "javax.el.MethodExpression"
    If I remove serverListener (to pass compilation) and then add it again in run-time, it works normally (the backing bean method is being triggered correctly, including passing params, etc).
    It is happening only on the current project, but when I make a test case it works normally. I suspect it has something with the project settings, but I couldn't find the cause regarding that the project has advanced and there are so many differences to be able to do simple comparison.
    Does anyone know what could be the reason for af:serverListener to break compilation, please?
    ... from jspx page...
    <af:resource type="javascript">
    function aaa(event) {
    var esrc = event.getSource();
    AdfCustomEvent.queue(esrc, "bbb", {fvalue : "TEST"},true);
    event.cancel();
    </af:resource>
    <af:inputText label="Label 1" id="it1">
    <af:clientListener method="aaa" type="click"/>
    <af:serverListener type="bbb" method="#{backing_bean.onClick}"/>
    </af:inputText>
    ... from BB ...
    public void onClick(ClientEvent clientEvent) {
    String message = (String) clientEvent.getParameters().get("fvalue");
    System.out.println(message);
    }

    Hi,
    Try like this
    <trh:script>clientListenerMethoName= function(event) {
    var source = event.getSource();
    AdfCustomEvent.queue( source, "serVerListenerType", {}, false); }
    </trh:script>
    Next :
    <af:clientListener method="clientListenerMethoName" type="click"/>
    <af:serverListener type="serVerListenerType" method="#{beanName.methodName}"/>
    Edited by: Raj Gopal K on May 4, 2011 4:05 PM

  • Navigation Handler is not working in jspx page..

    Hi,
    I have written a sample application with 3 pages.
    - one.jpsx
    - two.jspx
    - error.jspx
    In one.jspx page a scriptlet is written to forward the page to error.jspx. But it is not working. Any help or suggestions would be appreciated.
    pages:
    one.jspx_
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <jsp:directive.page import="javax.faces.context.FacesContext"/>
    <jsp:scriptlet>
    FacesContext fc = FacesContext.getCurrentInstance();
         fc.getApplication().getNavigationHandler().handleNavigation(fc,"","error");
    </jsp:scriptlet>
    <f:view>
    <af:document>
    <af:form>
    <af:outputText value="This is first page"/>
    <af:commandButton text="Click on" action="two"/>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    error.jspx_
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document>
    <af:form>
    <af:outputText value="This is error page.."/>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    two.jspx_
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document>
    <af:form>
    <af:outputText value="This is second page"/>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    adfc-config.xml_
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
    <view id="one">
    <page>/one.jspx</page>
    </view>
    <view id="two">
    <page>/two.jspx</page>
    </view>
    <view id="error">
    <page>/error.jspx</page>
    </view>
    <control-flow-rule>
    <from-activity-id>one</from-activity-id>
    <control-flow-case>
    <from-outcome>two</from-outcome>
    <to-activity-id>two</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    </adfc-config>
    Thanks
    Sukumar

    What's the reason you think the JSP <jsp:scriptlet> tags works in JSF?
    CM.

  • When-tab-page-changed not firing

    I have 2 seperate forms opened on a single page. One displays on left side of screen and has tabs. One display on right side. If I am currently on my right side form (no tabs) and click on a tab on the left side form, it seems the 'When-tab-page-changed; trigger is not firing the first time. I have tried this on 6i and 10g webforms. If I try it on client/server 6i it works. Any suggestions?

    I just tried this with 10gR2 in web. My form with the tabs only get focus and does not call when-tab-page-changed when you click on a tab after returning from the other form.
    A 2nd button press does then call the when-tab-page-changed.

  • Not working in jspx page

    Hi.,
    I am using jdev11.1.5
    I had created a EO [Finyear] with that corresponding VO
    I had created a VO [finperiod VO name] using read only Querry with the given querry
    select distinct fp_bu,fp_year,fp_period, decode(gdh_status,'R','Yes','No') distribution,decode (aj_status ,'N','Yes','No') Recursion,
    decode(RSUPHD_STATUS,'P','Yes','No') Supplier,decode(RCDOC_STATUS,'P','Yes','No') Customer
    from gl_dist_hd,fin_periods,appl_journals,rec_suplr_doc_hd,rec_cust_doc_hd
    where
    fp_period = gdh_period(+) and
    gdh_period = aj_period(+) and
    aj_period = RSUPHD_DOC_PERIOD(+) and
    RSUPHD_DOC_PERIOD = RCDOC_DOC_PERIOD(+)
    ORDER BY fp_period ascI had created a viewlink between two vo finperiod , finyear
    finperiod.bu = finyear.bu
    finperiod.year = finyear.yearwhile i am running the viewlink in Business Component browser it works fine
    But when i tried to run this in my jspx page it displays the output for one period
    i need to display the output for all the 12 period corrsponding to that year.,
    would anyone pls help me

    Hi,
    When you ran the AM tester (and selected the view link), it is displayed as master form and detail table. But, in the jspx page, you have only the table.
    Can you create another page and try dropping it as master form and detail table to check if it works on the same manner as which the AM tester?
    -Arun

  • Table SelectionEvent not fired after filtering

    Hi,
    consider the following scenario (ADF 11g Dec. 2008 build): a filterable af:table with 3 rows and RowSelection="single".
    Row 1, the first one, starts as current and is highlighted in the table.
    Now, apply a query-by-example so that only rows 2 and 3 are visible. The af:table thus highlights row 2 because it's the first of the two remaining rows... however, no SelectionEvent is fired in that case so no MakeCurrent takes place, and the user thinks the current row is row 2 but instead the underlying iterator isn't updated. User is forced to click on row 3 and then on row 2 again to make row 2 current (= fire a SelectionEvent). This also completely defies all the logic we put in our custom SelectionListener (it does MakeCurrent then updates a region in the page according to the selected row in the table).
    An even bigger problem in the scenario above is that if you filter so that only row 3 is shown, it gets automatically highlighted and then there's no way to make it current at all, since the af:table in your browser won't let you "select" a row which is already highlighted. That is, the SelectionEvent only fires if a user manually clicks on a row which is not currently highlighted in the table.
    This happens for all af:tables no matter the properties set, even after straight drag-and-drop of a VO to the .jspx page.
    This behaviour seems just broken, if the af:table does highlight/select a row automatically client-side, it should send a SelectionEvent to the server so that a MakeCurrent can be performed, keeping the iterator's current position in sync with what the user sees.
    Is there a way to workaround this issue? I'd say "fix af:table" would be the solution, but if these problems are still here I guess it's been designed this way? (...why?)
    Any help would be appreciated.
    thanks,
    Riccardo

    this is my php connection file
    <?php
      $username = "kependudukan";
      $password = "kependudukan";
      $dbname = "localhost/XE";
      $c = oci_connect ($username, $password, $dbname);
      if (!$c) {
      echo "Koneksi ke server database gagal dilakukan";}
      //else {
      //echo "Konekasi ke server database sukses";}
    ?>
    Everything works fine except the trigger..
    I use Windows 7 Professional 32-bit
    intel core i-3
    RAM 2GB

Maybe you are looking for

  • How to change the default servcie port number to be checked for the IPS sig

    Dear i have an AIP-SSM (IPS) installed in a an ASA firewall. i have configured an access-list in the firewall to forward the traffic coming from the internet toward the internal server to be checked by the IPS module. but the case is that the service

  • Unable to back up contacts from Droid MAXX to cloud

    I am complete lost here. Ever since I installed Verizon Cloud all of my online storage for contacts has disappeared. I visit the coud site and it says there are no contacts there. I originally had Backup Assistant PLUS installed and it worked fine. T

  • What a JPEG looks like

    When I take a jpeg image to Photoshop, its appearance's color changes from the original image to a slightly revised image. I know that on PS5, at least, there are three different options given, before displaying the image on a monitor. Is there a way

  • Sequence Aspect Ratio for HD

    I am transferring HD video from AVCHD into FCP 6.0.4, and I need to know what the correct setting is for the aspect ratio (in the sequence preset editor). The footage is captured 1920x1080 at 30p. I plug that all in, but the only choice for plain HD

  • Substitution Problem in Workflow settings

    Hi,     We are trying for automatic forwarding of work item from one sap user Inbox to other sap user Inbox using substitution in workflow settings. I am getting work items in both users Inboxes. My requirement is work item should appear in substitut