Backing  Bean constructor getting called multiple times

I have a List of records in the Table with a link Add.
When i click Add i show a popup dialog which is attached to the dialogListener.
On clicking OK on the dialog i want to add a record in the List in the backing Bean, but the Bean constructor is getting called multiple times.
and the list to which the table is attached is also getting called multiple times.
is there a way in which the method gets called only once?
Message was edited by:
user607056

Hi!
af:table have property ContentDelivery. When <default> (lazy), the table "frame" iz rendered in first page cycle, and content (rows in table) are fetched lazy i.e. in second cycle. Thus, your backing bean is constructed twice.
If you set ContentDelivery to immediate, the table including data rows is generated in single page cycle thus your backing bean is constructed only once.
Hope this helps,
PaKo

Similar Messages

  • Why a getter method of a managed bean WILL be called multiple times

    Why a getter method of a managed bean WILL be called multiple times during the JSF lifecycle?Why this designed?

    This is by design indeed. Each step in the JSF lifecycle can call a getter to get the required information.

  • Php include file getting called multiple times

    I have created a form in file career.php. To carry out the validation user_registration.php is called at the beginning of the file.
    user_registration.php in turn calls library.php. Issue is that library.php is getting called multiple times.
    I have attached phperror.log which confirms the same.
    career.php
    <?php
    session_start();
    require_once('phpScript/user_registration.php');
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    user_registration.php
    <?php // This file is used for validating user form data. It calls process_upload.php to validate file uploaded by user
    $errors = array();  
    $messages = array();
    $testing = TRUE;
    error_log("Enter- user_registration.php. Testing mode $testing", 0);
    try {
              error_log("user_registration.php: Entered try catch block",0);
    require_once('library.php');
              error_log("Successfully called library.php",0);
              $public_key = '6LeDsNUSAAAAAIoaYuNhGm2zx_qgBECiybUWUkt6';
              $private_key = '6LeDsNUSAAAAACuvmJrec-_5seLdmhqUMngt8AiU';
              $recaptcha = new Zend_Service_ReCaptcha($public_key, $private_key);
              if(isset($_POST['submit'])) {          // Only execute if form is submitted by user
                error_log("user_registration.php. Submit button pressed by user", 0);
                require_once('Zend/Mail.php');
                $mail = new Zend_Mail('UTF-8');
                if (isset($_POST['name'])) {
                        $val = new Zend_Validate_Regex('/^\p{L}+[-\'\p{L} ]+$/u');
                        if (!$val->isValid($_POST['name'])) {
                          $errors['name'] = "Please enter your name, no numbers permitted";
    error_log("Exit- user_registration.php.", 0);
    library.php
    <?php
    error_log("Enter- library.php. Testing mode $testing", 0);
    if ($testing)  // If true then go to testing mode
              $library = '/Applications/MAMP/htdocs/mgtools-india/ZendFramework/library';
              set_include_path(get_include_path() . PATH_SEPARATOR . $library);
    require_once('Zend/Loader/Autoloader.php');
    try {
    Zend_Loader_Autoloader::getInstance();
    error_log("Exit- library.php. Testing mode $testing", 0);
    phperror.log
    Marker - 12-Oct-2012 10:27:26 AM
    [12-Oct-2012 04:57:33 UTC] Enter- user_registration.php. Testing mode 1
    [12-Oct-2012 04:57:33 UTC] user_registration.php: Entered try catch block
    [12-Oct-2012 04:57:33 UTC] Enter- library.php. Testing mode 1
    [12-Oct-2012 04:57:33 UTC] Exit- library.php. Testing mode 1
    [12-Oct-2012 04:57:33 UTC] Successfully called library.php
    [12-Oct-2012 04:57:36 UTC] Enter- user_registration.php. Testing mode 1
    [12-Oct-2012 04:57:36 UTC] Entered try catch block
    [12-Oct-2012 04:57:36 UTC] Enter- library.php. Testing mode 1
    [12-Oct-2012 04:57:36 UTC] Exit- library.php. Testing mode 1
    [12-Oct-2012 04:57:36 UTC] Successfully called library.php
    [12-Oct-2012 04:58:38 UTC] Enter- user_registration.php. Testing mode 1
    [12-Oct-2012 04:58:38 UTC] Entered try catch block
    [12-Oct-2012 04:58:38 UTC] Enter- library.php. Testing mode 1
    [12-Oct-2012 04:58:38 UTC] Exit- library.php. Testing mode 1
    [12-Oct-2012 04:58:38 UTC] Successfully called library.php
    [12-Oct-2012 04:58:38 UTC] user_registration.php. Submit button pressed by user
    [12-Oct-2012 04:58:39 UTC] user_registration.php, Processing enquiry form
    [12-Oct-2012 04:58:39 UTC] Enter- process_upload.php. Testing mode 1
    [12-Oct-2012 04:59:01 UTC] Exit- user_registration.php.
    I am not able to understand why user_registration.php and library.php are executing again and again.
    I ran this test on local testing server MAMP.
    The results are the same on remote server also.
    Please guide.

    I'm not sure what's happening there. The important question is whether the code is executed successfully.
    Since you're using the Zend Framework, it might be better to ask in a dedicated ZF forum.

  • Validation Event getting called multiple times

    I am saving an eform after entering a wrong percentage in it.On opening the same eform it gives the validate message "Percentage not valid" pop up .This popup should come only once but its coming around 25-26 times.I checked and find that the validate event is getting called multiple times for the same field.Can someone tell why this is happening and how to resolve this

    Hi rupali Sri,
    Our forum here is for questions related to the LiveCycle Collaboration Service product.
    You might want to post your question to the Livecycle Forms forum:
    http://forums.adobe.com/community/livecycle/livecycle_es/forms_es
    If that's not the correct forum, start from here:
    http://forums.adobe.com/index.jspa?view=overview
    Hope this helps.
    Good luck,
    Julien
    LCCS Quality Engineering

  • ValidateEntity getting called multiple times

    Hi,
    There is a parent EO and a child EO. There is a composite association between the parent and child.Association accessors are generated for both source and destination. In the ChildEO's doDML method , the following code is added.
    Long abc = getPArentEO().getAttr1();
    Long xyz = getPArentEO().getAttr2();
    setAttr3(abc);
    setAttr4(xyz);
    super.doDML();
    getParentEO() is the association accessor .
    After the addition of this code, all the method validators of the parent are getting fired more than once. The validateEntity of the parentEO is getting called more than once if I set some attribute of the childEO in childEO's doDML . Is this the expected behaviour?
    Thanks.

    Even on adding the setter in prepareForDML (either in parent or child) , the validateEntity is getting called multiple times. In fact ,validateEntity is getting called once before prepareForDML and again after. One of my method validators fail on the subsequent call giving an error ..Please help.

  • Firefox making same GET call multiple times

    Firefox is making the same AJAX call multiple times for a single event when it should really do it once. Actually, with each single click the number of calls multiplies. I have tested the application using Chromium and Eclipse's internal browser and I have no problems.
    I removed all add-ons and started Firefox in safe-mode, but the problem persists.
    Please advise,
    Arthur Nobrega

    Hi Arthur, do you have a page available that demonstrates this problem? If so, please post a link. Perhaps your test doesn't actually need to make a network request: for example, perhaps it could add a message to the page indicating that the relevant section of code was triggered.
    Since this site focuses on end user support, you might also consider taking this question to a more developer-oriented forum such as the unofficial [http://forums.mozillazine.org/viewforum.php?f=25 mozillaZine Web Development board], or to StackExchange.

  • Problem adding listners(getting called multiple times)??

    Hi
    I got a small doubt,
    If I have two radio buttons, if I implement item listeners on that two radio buttons ,
    Depending on the value I get from the database I set it to be selected , but the question is why is the item listener called many times when I write
    This code is written in one item listener --universal radio button.
    Universalbtn.addItemListener(new ItemListener()
    Public itemStateChange(){
    //Some processing from the database
    if(type=�P�)
    Partialbtn.setSelected(true);
    Else if (type=�S�)
    Sparebtn.setSelected(true);
    )Here�s the exact code �
    objUniversalRadBtn.addItemListener(new ItemListener() {
                                        public void itemStateChanged(ItemEvent iE) {
                                                    arrStoreFamilyList=new ArrayList();
                                                    ArrayList arrResults=null;
                                                    arrStoreFamilyList.add(FLAG_RADIO_BTN);
                                                    try {
                                                                //calling the service, to store the values selected or entered in UI.
                                                                arrResults=(ArrayList)objController.doAction
                                                                                                                ("admininvmgmnt.service", arrStoreFamilyList);
                                                    catch(EnPVException enPV) {
                                                                logger.error("exception"+enPV);
                                                    if(arrResults.get(0).equals(BOOLEAN_VALUE)) {
                                                                objMessageUI=new MessageUI();
                                                                objMessageUI.infoMessage(INVENTORY_CYCLE_INPROGRESS);
                                                                if(strInvType.equals(INVENTORYTYPE_PARTIAL)) {
                                                                            objPartialRadBtn.setSelected(true);
                                                                }else {
                                                                            objSpareRadBtn.setSelected(true);
                                                    }else {
                                                    objAddedFamilyList.setEnabled(false);
                                                    objFamilyName.setEnabled(false);
                                                    objFamilyTxt.setEnabled(false);
                                                    objAddBtn.setEnabled(false);
                                                    objRemoveBtn.setEnabled(false);
                                                    objInvMgmtUI=null;
                            objSpareRadBtn.addItemListener(new ItemListener() {
                                        public void itemStateChanged(ItemEvent iE) {
                                                    arrStoreFamilyList=new ArrayList();
                                                    ArrayList arrResults=null;
                                                    arrStoreFamilyList.add(FLAG_RADIO_BTN);
                                                    try {
                                                                //calling the service, to store the values selected or entered in UI.
                                                                arrResults=(ArrayList)objController.doAction
                                                                                                                ("admininvmgmnt.service", arrStoreFamilyList);
                                                    catch(EnPVException enPV) {
                                                                logger.error("exception"+enPV);
                                                    if(arrResults.get(0).equals(BOOLEAN_VALUE)) {
                                                                objMessageUI=new MessageUI();
                                                                objMessageUI.infoMessage(INVENTORY_CYCLE_INPROGRESS);
                                                                System.out.println(strInvType);
                                                                if(strInvType.equals(INVENTORYTYPE_UNIVERSAL)) {
                                                                            bFlag=false;
                                                                            objUniversalRadBtn.setSelected(true);
                                                                }else if(strInvType.equals(INVENTORYTYPE_PARTIAL)) {
                                                                            objPartialRadBtn.setSelected(true);
                                                    }else {
                                                    objAddedFamilyList.setEnabled(false);
                                                    objFamilyName.setEnabled(false);
                                                    objFamilyTxt.setEnabled(false);
                                                    objAddBtn.setEnabled(false);
                                                    objRemoveBtn.setEnabled(false);
                                                    objInvMgmtUI=null;
                            });Pls kindly , let me know why is this happening , as I had overcomed this problem many times and I changed my code when this happened with the textfields in some cases � (when I wrote focuslost events on textboxes , the same case happened �calling the other listener many times and then the cursor got focused in the textfield)
    thnx & regards
    Neel

    Inside the Method itemStateChanged() dont use
    objPartialRadBtn.setSelected() or objSpareRadBtn.setSelected()
    If you still want to use then do
    objPartialRadBtn.removeItemListener(...);
    objPartialRadBtn.setSelected();
    objPartialRadBtn.addItemListener(...);

  • Action method getting called multiple times.

    Hi All,
    The problem that I am facing is pretty weird.
    The issue is the i have an input field that takes date as input field.
    This field is inside a data taable
    FYI: I tried converter still same problem.
    So when ever I enter wrong data as "asda" inside this date field I get a validation error. which is good. So assume it took me 3 submit clicks to fix all my errors on the page.
    So now when I click the submit for the 4th time.
    The action method gets trigerred 4 times.
    Desperately waiting for a fix.
    Thank you in advance.
                                            <h:dataTable id="disbursementTable"
                                                 value="#{certTemplateBean.disbursements}" var="disbursement"
                                                 binding="#{certTemplateBean.disbursementTable}"
                                                 columnClasses="disburseDate,disburseAmt,disburseAction"
                                                 styleClass="disbursementTable" cellspacing="0" cellpadding="1">
                                                 <h:column >
                                                      <h:inputText id="disburseDate" styleClass="#{certTemplatesListBean.errorHolder.disburseDate} ms" size="10"
                                                                value="#{disbursement.date}">
                                                           <f:validator validatorId="RegExp" />
                                                           <f:attribute name="regexp" value="[0-9]{2}/[0-9]{2}/[0-9]{4}" />                                             
                                                           <f:attribute name="fieldRef" value="Disbursement Date :" />
                                                           <f:attribute name="message" value="Invalid Date" />
                                                           <f:attribute name="bean" value="certTemplatesListBean" />
                                                      </h:inputText>
                                                 </h:column>
                                            </h:dataTable>
                                            <h:commandLink id="addPro"
                                                 action="#{certTemplatesListBean.doAddUpdateCertTemplate}">
                                                 <h:outputText value="Add Profile direct"/>
                                            </h:commandLink>

    Probably got to do with the JSF jar files. I am not sure though. Can you check if the below link is useful?
    http://jira.jboss.com/jira/browse/AJSF-127

  • Validators getting called multiple times?

    I am working on a project where were we have used BackingBean validators for an input text component.
    When I first submit, the validator method getting called once, when I submit again, its getting called twice, and it goes on. After clearing the session, the validator getting called once, then twice, ...
    I don't know why this happens. Can any help me with this? What could be reasons for this weird behavior? What might went wrong in our code.

    An SSCCE please.

  • CommandLink in dataTable rendered method is called multiple times

    I have a dataTable in which one of the columns contains a commandLink. The commandLink has the "rendered" option bound to a backing bean method. When the page is submitted, the backing bean method gets called 8 times for each row in the table if the value returned is "true" and 3 times per row if the value returned is "false". Since the page is designed to "navigate" back to itself, I can understand it getting called more than once, but 8 times??? What's up with that?

    Because you have a bug in your code.
    If you want further help post a Short, Self Contained, Compilable and Executable, Example Program ([url http://homepage1.nifty.com/algafield/sscce.html]SSCCE) that demonstrates the problem.
    And don't forget to use [url http://forum.java.sun.com/help.jspa?sec=formatting]code formatting when posting code.

  • Getter is called multiple times

    Hi All,
    I my JSF page i am using one foreach which will read elements from an ArrayList. ArrayList is present in one PagesFlowSope-Bean.
    I am facing problem that, the getter for ArrayList is called multiple times.I want to restrict that,is there any way for doing this.
    Thanks in advance,

    Your getter gets called every time the component/page gets rendered/refreshed. If you feel that it refreshes too many times, check the partial triggers on that component or its parent. Just a thought, to avoid any logic getting called in your getter multiple times, if possible, put a empty or null check on your attribute and initialize it only if it is null/empty. In that way even if it gets called multiple times your logic to populate your ArrayList doesn't fire everytime.
    Good luck !

  • Oracle Object Type Constructor Called Multiple Times

    I have an object type with a custom constructor. In SQL, when I reference the attributes the constructor is called multiple times in Oracle 11.2.0.4.
    Why is the constructor called multiple times?
    How do I stop it?
    My current work around is to reference the attributes and use the /*+ materialize */ hint.
    Problem Setup
        create or replace type Foo as object
          Bar1 NUMBER,
          Bar2 NUMBER,
          Bar3 NUMBER,
          CONSTRUCTOR FUNCTION Foo(p_Bar1 NUMBER, p_Bar2 NUMBER, p_Bar3 NUMBER)
            RETURN SELF AS RESULT
            DETERMINISTIC
        create or replace type body Foo is
          -- Member procedures and functions
          CONSTRUCTOR FUNCTION Foo(p_Bar1 NUMBER, p_Bar2 NUMBER, p_Bar3 NUMBER)
            RETURN SELF AS RESULT
            DETERMINISTIC
          AS
          BEGIN
            SELF.Bar1 := p_Bar1;
            SELF.Bar2 := p_Bar2;
            SELF.Bar3 := p_Bar3;
            dbms_output.put_line('Foo Constructor Called');
            RETURN;
          END;
        end;
    Problem
        -- Constructor is called 6 times!
        -- Once for each column and once for each predicate in the where clause.
        SELECT x.f.bar1 AS bar1, x.f.bar2 AS bar2, x.f.bar3 AS bar3, f
        FROM (
          SELECT foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3) f
          FROM dual d
        ) x
        WHERE x.f.bar1 = x.f.bar1 AND x.f.bar2 = x.f.bar2
    Output
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Foo Constructor Called
    Workaround
        -- Work Around
        -- Constructor is called 3 times
        -- Once for each column in the inline view.
        -- Note, I removed column f (the object type) because it's not compatible with the materialize hint.
        WITH y AS (
          SELECT /*+ materialize */ x.f.bar1 AS bar1, x.f.bar2 AS bar2, x.f.bar3 AS bar3
          FROM (
            SELECT foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3) f
            FROM dual d
          ) x
        SELECT y.bar1, y.bar2, y.bar3
        FROM y
        WHERE y.bar1 = y.bar1 AND y.bar2 = y.bar2

    Another work-around is described in this thread... Accessing fields of a custom object type... which makes use of a collection type combined with the TABLE operator, like so...
    create or replace type FooTable as table of Foo;
    SELECT x.bar1 AS bar1, x.bar2 AS bar2, x.bar3 AS bar3, value(x) f
        FROM table(FooTable(
          foo(p_Bar1 => 1, p_Bar2 => 2, p_Bar3 => 3)
        )) x
        WHERE x.bar1 = x.bar1 AND x.bar2 = x.bar2
    BAR1 BAR2 BAR2 F
    1    2    3    (1, 2, 3)
    Foo Constructor Called
    Hope that helps...
    Gerard

  • ADF Faces Tree - getChildren() called multiple times

    Hi,
    I have a simple tree based on the demo's 'tree.jspx'. Each time I click on a node in this tree, I see that TreeNodeImpl.getChildren() gets called multiple times for each node. This is not an issue in tree.jspx where the tree is static. However in a case where tree is constructed dynamically based on the back end state, it is going to hurt performance. Each getChildren() call then invokes backend methods which could be remote. So multiple getChildren() will invoke backend methods multiple times.
    Is this behavior of calling getChildren() multiple times per node a bug? Is there any way for me to avoid it?

    this is expected behaviour.
    Your tree model should cache data and prevent the multiple calls to the back end.

  • JDK 6:  requestPasswordAuthentication called multiple times

    Hi...
    Has anyone else noticed that 'requestPasswordAuthentication' gets called multiple times from HTTPURLConnection in JDK 6? If I create an HTTPURLConnection, and it returns successfully from 'openConnection', if I then do something simple like query for its contentType via 'getContentType', a call to my authenticator requesting password authentication is made MULTIPLE times...
    In JDK 1.5, it was only made once in the same scenario.
    Have there been changes in the recent release that would require me to make changes to my authenticator or to supply more information?
    Thanks!
    Kelly

    We had a problem with NTLM authentication in 1.5 and Java SE 6, which may be the problem that you are seeing. There were actually two bugs in the same area that were fixed, 6520665 and 6357133.
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6520665
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6357133
    Both these bugs were fixed in the following releases:
    jdk 7 b12
    jdk 6 u3 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=2148156
    jdk 5u13 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=2149272
    I know that none of these releases are available yet except for jdk7. There is an early access version available from http://download.java.net/jdk7/binaries/ . Maybe you could install it an see if it resolves your problem.

  • IPhone - Sybase RFC called multiple times

    Hi,
    I have an RFC that is adding some data in the system. This works, how ever it gets called multiple times with the same data. Every time a synchronization is done it adds a new row with all the same data. (even with 1 entry so it's not because of the loop).
    This is how my save function looks, newEntriesMBO is an array with Synchronization parameters. Should I do anything more than [sync delete]?
            for (TimeSheets_EnterTimeDataSynchronizationParameters *sync in newEntriesMBO)
                [sync save];
                while ([TimeSheets_TimeSheetsDB hasPendingOperations])
                    [NSThread sleepForTimeInterval:0.2];
                [sync delete];
    Edited by: PJ Deraedt on Sep 19, 2011 11:06 AM

    Hi
    Once the personalization parameters are set ,you should call [pp save];
    the next step would be to check for pending operations
    while (TimeSheets_TimeSheetsDB hasPendingOperations)
    NSThread sleepForTimeInterval:0.2;
    Thats it no more code. sync delete etc is all not  required. The reason why u get multiple calls is because pp save function is called multiple times.
    Thanks
    Pradeep

Maybe you are looking for

  • Why can't I search a contact?

    When I search for this one particular contact.my skype crash and restart itself. What does this mean? How do I know if someone blocked me?

  • Is it possible to create web services for classes and bol objects?

    i am new to crm web channel,can any one  please ,help me.... thank u in advance, kiran.

  • Regions & contextual events

    Hi, I am trying to rebuild an 10g webcenter application that used portlets and inter-portlet communication. The use case I have is: - one task flow where we have a bpel task list. User can click a task to select it - selecting the task should transmi

  • KeyLocation.LEFT / .RIGHT won't work on a Mac keyboard

    I want to differentiate the LEFT SHIFT key on the keyboard from the RIGHT SHIFT key. The code below will do that on my PC Laptop but not on my Macbook Pro. Someone knows a workaround or the reason why? Thanks! -Marek PS: the sample  code below is not

  • Opening a Modal window from another Modal window

    Hi All, I am opening a Modal window from a Modal window which has applets in it. But when the child modal window opens up from parent modal window, the applets on the child modal window are not loading properly. But when I change the child modal wind