How to call the bean support just after JSFF / fragment of page loads?

Hello

I have a simple requirement - call the Backing Bean method for my page-fragment AFTER that its loading. The JSFF is delimited to the workflow.

I tried the solution given here: http://fortunefusionminds.blogspot.com.au/2013/04/how-to-invoke-backing-bean-method-right.html but it does not work for me.

Every time I tried to access any link layer (i.e. the PanelFormLayout DepartmentId) attribute/property within the refreshRegion method below gives NullPointerException.

My DepartmentId property is exposed to the Backing Bean by using the Bindings property in the property inspector.

@Override

{} public boolean refreshRegion (RegionContext regionContext)

int refreshFlag = regionContext.getRefreshFlag ();


if(refreshFlag == RegionBinding.PREPARE_MODEL) {}

System.out.println (getDepartmentId.GetValue ())

}

regionContext.getRegionBinding (.refresh (refreshFlag));

Returns false;

}


{} public void setDepartmentId (RichInputText departmentId)

this.departmentId = departmentId;

}

public RichInputText getDepartmentId() {}

return departmentId.

}

Any help please?

Thank you

Hitesh Patel


Hi all

Here's how it works for me.

1. in your backing bean create property & its get accessor for afterPageLoad as below. We don't need a setter method.

private; channel afterPageLoad

public String getAfterPageLoad() {}

If (!.) {AdfFacesContext.getCurrentInstance.isPostBack ()}

initPage();

}

Return afterPageLoad;

}

private void initPage() {}

System.out.Print ("I'm initPage() and called exactly once");

}

2. create a hidden field to the bottom of your JSFF page as below.

Thanks - Hitesh

Tags: Java

Similar Questions

  • How to get the selected values of the af:selectManyChoice in the bean support

    Hello

    I have a selectManyChoice with a list of static, as shown below.
    At the click of the button, is called a method in the bean support. I want to get the list of the values selected by the method of the bean.
    How to do the same thing.
    <af:panelFormLayout id="pfl1" fieldWidth="50%" labelWidth="50%">
            <af:selectManyChoice label="Days" id="smc1"
                                 binding="#{Bean.addDaysChoice}">
              <af:selectItem label="Monday" value="MON" id="si17"/>
              <af:selectItem label="Tuesday" value="TUE" id="si13"/>
              <af:selectItem label="Wednesday" value="WED" id="si15"/>
              <af:selectItem label="Thursday" value="THU" id="si14"/>
              <af:selectItem label="Friday" value="FRI" id="si11"/>
              <af:selectItem label="Saturday" value="SAT" id="si16"/>
              <af:selectItem label="Sunday" value="SUN" id="si12"/>
            </af:selectManyChoice>        
              <af:commandButton text="Button"
                                actionListener="#{bean.callSomeMethod}"
                                id="cb1"/>  
    <af:panelFormLayout/>
    Thank you
    Ajay

    Published by: Ajay on January 31, 2011 06:26

    Hello

    What about setting the property "value" of the selectManyChoice, and then point to a method of the managed bean (setter/accessor for a variable of type list)?

    Frank

  • How to call the web service?

    Hello

    I want to know how to call the web service from my application HTML5 & javascript.

    Please help me find this detail as what I can access easily. and I want to access web services online (a method of it) I'm not concered with how background Web service takes place.

    I just want that when you call a web service method, I will return the result.

    Please try this out for a WebService call

    var xmlhttp;
    xmlhttp = new XMLHttpRequest();
    xmlhttp.open("get","your url",true);
    xmlhttp.setRequestHeader("Accept","application/json");
    xmlhttp.setRequestHeader("Content-type", "application/json");
    xmlhttp.onreadystatechange=function() {
     if (xmlhttp.readyState==4) {
      if (xmlhttp.status == 200) {
        console.log(xmlhttp.responseText);
      }
     }
    }
    xmlhttp.send();
    

    This will display the result of the invocation of webservice. The url is the application that you deploy and the type can be get/post. If xmlhttp.send (post) takes argument for the display of the data. You can call it by clicking a button in HTML.

  • How to complete the implementation of process after inserting the new sim card to unlock the phone

    Try to unlock the phone more 6s with ATT, but do not know how to perform the implementation of process after inserting the new sim card. I got the unlock code confirmed att.

    After the unlock code is confirmed, you will have to restore the unit to the factory via iTunes settings.  He must inform you that the device is unlocked, THEN you change sim cards.

  • How to call the setting menu of the BIOS on HP DV4 1540us netbook?

    Hi all

    How to call the setting menu of the BIOS on HP DV4 1540us netbook?

    F2 does NOT an on-screen BIOS setting.

    Is there another trick?  Or, perhaps, defining the procedure step by step to start the BIOS?

    TIA

    Power on the laptop and all logo HP being displayed, press F10.

  • How to call the procedure type table

    Hi I have the below requirement

    Created in the sub table type

    CREATE or REPLACE the TYPE char_type IS the TABLE OF VARCHAR2 (4000);

    create or replace procedure test_proc_type (p_type char_type) is

    Start

    I'm looping 1.p_type.count

    dbms_output.put_line (p_type (i));

    end loop;

    end;

    How to call the procedure with parameter as a type!

    SQL> create or replace type  char_type as table of varchar2(4000)
      2  /
    
    Type created.
    
    SQL> create or replace procedure test_proc_type (p_type char_type)
      2  is
      3  begin
      4    for i in 1..p_type.count loop
      5      dbms_output.put_line (p_type(i) ) ;
      6    end loop;
      7  end;
      8  /
    
    Procedure created.
    
    SQL> set serveroutput on
    SQL>
    SQL> exec test_proc_type(char_type('A','B','C','D','E'))
    A
    B
    C
    D
    E
    
    PL/SQL procedure successfully completed.
    
    SQL>
    
  • Hi, I am trying to download the Lightroom 6 stand-alone version and get the following message just after a click of the extraction area: "the account was registered to another country. Please log out and log in with an existing account for this country.

    Hi, I am trying to download the Lightroom 6 stand-alone version and get the following message just after a click of the extraction area: "the account was registered to another country. Please log out and log in with an existing account for this country. "I'm in Namibia and tried to change my country of Africa, in the USA, but still the same problem. TIA

    Hi Annen,

    Please see the following forum topic.

    Try to buy the trial period in a different e-mail - message error "error in your account order has been registered for another country. Please log out and log in with an existing account for this country. OK ".

    Kind regards

    Sumit Singh

  • How to call the java function with javascript setting in mobile adf?

    How to call the java function with javascript setting in mobile adf?

    The ADF Mobile utility container API can be used from JavaScript or Java.

    Application container API - 11 g Release 2 (11.1.2.4.0)

  • How to call the stored procedure when I press the button

    Hello

    I want to know how to call the procedure/SQL statement when I press the button using callable statement.

    can someone give me it please link who knows the steps to do this.

    Thanks in advance,
    SAN

    Hello

    read this good example http://www.baigzeeshan.com/2010/05/calling-plsql-procedure-and-function-in.html

    ~ Abhijit

  • How to call the variables of the scene inside movieClips

    How to call the variables of the scene inside movieClips

    One way would be to use "MovieClip (root)" to target variables in the main timeline... MovieClip (root) .someVariable = someValue;

  • How to call the javascript function in ADF

    I have the javascript function stored in a .js file external (try to reuse in another application). How can call the javascript function for an event of ADF faces component. I need to I am a newbie to ADF, all ideas are appreciated.

    Kind regards
    Surya

    Published by: sgodavar on Sep 24, 2010 11:44

    Include JavaScript to the jsff/jspx as page:

    Call it like:

    Type = "dblClick" / >
    Amit

  • How to call the function (function Build-in user) in Pro * C program

    We have developed the application Pro * C program.
    TimesTen version is "TimesTen release 11.2.1.5.0 (64-bit, Linux/x86_64) (tt112150:53308) 2010-03 - 04 T 20: 39:30Z.

    We would like to develop Pro * C program you are using PL/SQL.

    We have a few questions.
    How to call the function (function Build-in user) in Pro * C program?

    #########
    TEST
    #########

    ttisql:
    Command > create or replace FUNCTION F_SAMPLE (i_str IN VARCHAR2)
    > BACK NUMBER
    > o_number NUMBER;
    > START
    > select i_str
    > in o_number
    > double;
    >
    > O_number RETURN;
    >
    > EXCEPTION
    > Others THEN
    > RETURN 0;
    > END;
    > /.
    display errors
    The function is created.
    Order > show errors
    No errors.
    Command >
    Command > set serveroutput on;
    Command > declare
    > number of num1;
    > start
    > num1: = F_SAMPLE ('A');
    > DBMS_OUTPUT. PUT_LINE ("F_SAMPLE" |) ' ' || NUM1);
    > end;
    > /.
    F_SAMPLE 0

    PL/SQL procedure successfully completed.

    Command >


    Pro * C case:

    EXEC SQL BEGIN DECLARE SECTION;
    number of num1;
    EXEC SQL END DECLARE SECTION;

    EXEC SQL EXECUTE
    Start
    : num1: = F_SAMPLE ('A');
    end;
    END-EXEC;

    Make sure to install:
    Error on line 146, column 3, file plsqlPROC.pc:
    Error on line 146, column 3 in file plsqlPROC.pc
    number of num1;
    .. 1
    PCC-S-02201, encountered the symbol "num1" when expecting one of the following conditions:


    Thank you.

    GooGyum

    There are two problems with your variable declaration:

    1. the name of the variable and type are thew misplacement autour.

    2. you may not use a host variable type.

    If you change this to:

    EXEC SQL BEGIN DECLARE SECTION;
    int num1;
    EXEC SQL END DECLARE SECTION;

    Then it will work very well.

    Chris

  • How to call the taskflow or bean method after returning from operational-stream-call activity.

    I use JDev 11.1.2.4.0.

    Here is my scenario:

    A page contains a table with a button 'Add' called a popup.  The popup has controls to select data and save/Cancel buttons.  The Save button calls a managed bean method will add a line to the iterator in the table is built on.  I'd like the table to refresh the closure of the pop-up window.

    This is how I implemented it:

    I have taskflow1 that contains an activity view (page1).  Page 1, I have a button that calls managedBean1.method1 () who does a job and returns a result of 'showpopup '.  ShowPopup goes to a task-flows-call activity, called taskflow2.  Taskflow2 has a point of view (page 2, which is presented as a popup) activity and a return.   I want to call a method in managedBean1 to refresh the table once the popup is closed and I can't understand the right way to do it.

    After writing this I wonder if I should create the popup in the calling page rather than creating a separate workflow.  I started with a separate workflow because the popup is a quite complex.

    Thanks for help.

    Rudy

    Add a listener to return the button 'Add '. It will be called by ADF Faces upon return of the taskflow. For example:

    useWindow = "true" windowWidth = "600" windowHeight = "400".

    action = "#{MyBean.Method1} '"

    returnListener = "#{MyBean.myReturnListener}" / >

    And the bean method:

    public void myReturnListener (ReturnEvent returnEvent)

    {

    Do something, for example to update the table on the screen

    AdfFacesContext.getCurrentInstance () .addPartialTarget (myTable);

    }

    NB. don't forget to mark the taskflow call activity to 'run as dialog '.

    If you need the taskflow return result, you can get it in the earpiece to return via the method ReturnEvent.getReturnValue ().

    Dimitar

  • How to call the method of bean of support on the component date. MinValue

    Hello

    I have a method in bean

    {} public void sample()

    Set the entry code

    }

    I want to call the sample method when I click the date component. MinValue in .jsff

    Right now using the < af:clientListener method = 'onClick' type = "click on" / > inside the < af:inputDate > element

    < af:resource type = "javascript" >

    function onClick (clickEvent) {}

    Alert ("hiii");

    Here, I want to call the sample method by clicking on date. MinValue

    }

    < / af:resource >

    Any Solution would be Appreciable

    Try to follow this:

    -Inside af: inputDate add clientListener and serverListener

    
         
         
    
    

    The serverListener method must map to a function in backbean

    -in java script method write this

    function onClick(event)
    {
      var source = event.getSource();
      AdfCustomEvent.queue(source,"serverListenerOperations", {}, false);
    }
    
  • How to refresh the items in selectOneChoice after change of database items

    WWW the JPA and ADF application, but without BC.
    In the present draft of the table T1 (long tid, tNom string) model. Current methods of JPA for work with the table. They are built automatically from table.
    His presentations via block EJB and data controls.
    In the project view this page where is used.
    ....
    < af:popup id = "idDlgAddType" >
    < af:dialog title = "New type" id = "d3" dialogListener = "#{TypeBean.handleAddDialog}" >
    < af:inputText label = "Type" id = "idDlgInputTypeName" value = "#{TypeBean.typename}" / >
    < / af:dialog >
    < / af:popup >
    < af:selectOneChoice id = value = "#{bindings.t1FindAll.inputValue"idTypeList"} ' simple 'true' shortDesc = 'Type' = >"
    < f: selectItems value = "#{bindings.t1FindAll.items}" id = "idTypesNames" / > "
    < / af:selectOneChoice >
    < af:spacer width = "5" id = "sp2" / >
    < af:commandButton immediate = "true" text = "Adding a type" clientComponent = "true" id = "idBtnAddType" >
    < af:showPopupBehavior popupId = "idDlgAddType" alignId = "idBtnAddType" align = "afterStart" / >
    < / af:commandButton >
    ......

    This supported beans class CType synonymous TypeBean. In this class this method handleAddDialog.
    Bean saved:
    public class CType {}
    private String typename;
    ....
    {} public void handleAddDialog (DialogEvent event)
    If (event.getOutcome () .equals (DialogEvent.Outcome.ok)) {}
    AdfFacesContext.getCurrentInstance () .getViewScope () .put ("T1", new T1 (null, this.typename));
    BindingContainer bc is BindingContext.getCurrent () .getCurrentBindingsEntry ();.
    Method JUCtrlActionBinding = (JUCtrlActionBinding) bc.getOperationBinding ("persistT1");
    Method.Execute ();

    RichSelectOneChoice cid = (RichSelectOneChoice) FacesContext.getCurrentInstance () .getViewRoot () .findComponent ("idTypeList");
    AdfFacesContext.getCurrentInstance () .addPartialTarget (cid);

    }
    }
    }

    Question:
    How to force the object selectOneChoice to read items from a database?
    The selected channels do not lead to the necessary result. New record in the table is displayed. But it is not displayed in the list on the screen.
    Moreover, the regeneration of the page through a browser control also does not lead to the appearance of the record added in the list.

    Hello

    Re-run the iterator, which depends on the list of selectOneChoice. You can do so after completing the update. The reason why you don't see a change in your current implementation is that you do not change the collection of the iterator that fills the list

    Frank

Maybe you are looking for