Jsf and getter call

hi
I made a jsf page with a selectOneMenu component. here is the code:
<h:form>
<f:view>               
     <h:selectOneMenu id="pippo" immediate="true">     
         <f:selectItems value="#{user.items}" />               
     </h:selectOneMenu>               
</f:view>
</h:form>the getter method for 'items' add "select" to the menu
here is the code
public SelectItem[] getItems() {
     System.out.println("getItems");
     items[0] = new SelectItem("-1", "select");
     System.out.println("end getItems");
     return items;
}but if I check the log i can see 2 calls for getItems method
and these 2 calls are in the same fase (render response)
for example while loading the page:
[cut]
09:36:01,046 INFO [STDOUT] BeforePhase: RENDER_RESPONSE 6
09:36:02,953 INFO [STDOUT] getItems
09:36:02,953 INFO [STDOUT] end getItems
09:36:02,953 INFO [STDOUT] getItems
09:36:02,953 INFO [STDOUT] end getItems
09:36:02,968 INFO [STDOUT] AfterPhase: RENDER_RESPONSE 6
[cut]
why 2 calls?
i really don't understand.
what if I have an heavy getter with db connection and so on ?
thansk a lot!

giunad wrote:
even if I don't figure why I have 2 calls in the same phase (the link you sent me talks about several calls during several phases..) ,
where should I put the logic code?Definitely not in the getter. Or you must introduce lazy loading in there. Usual places are the constructor or initialization block of the bean.
for example 2 selectOneMenu on cascade where the content of the second menu is function of the first selection ?
ie country and state, parent and son, category and subcategory.. and so on.In this case, you may find this article useful: [http://balusc.blogspot.com/2007/10/populate-child-menus.html]

Similar Messages

  • How do I make and get calls with my US Phone in another country?

    Do I just dial the local number or do I have to dial international stuff?
    Same question for getting calls from the US. How to people there call me?
    Sorry if this is a dumb question.......
    Oh the place in Asia is on the countries list for the Iphone.

    http://www.wireless.att.com/learn/international/roaming/affordable-world-package s.jsp
    You would be roaming. International roaming is very expensive and must be activated by AT&T.
    You can sign up for international packages that lower the cost substantially. When you call or others call you, the country code would need to be added to the phone number.
    http://www.wireless.att.com/learn/international/roaming/affordable-world-package s.jsp

  • JSF and GET parameters

    Hi,
    This might be an age old question - but I can't seem to find a nice elegant solution - is there any support in JSF for GET parameters? Are there any plans for this to be included? What can I do in the meantime?

    Use the #{param.name} syntax as the value of a property in your managed-bean declaration in the faces-config. Then load from the database in a @PostConstruct method. Then just reference the managed bean normally in your JSP/view. When the first reference occurs the implementation will instantiate the bean, set the property and invoke the @PostConstruct method.

  • How to save a image with JSF and get your URL

    Hi
    I need to save a image to my file system and get your URL. I�m working with JSF.
    Ex.:
    1� Save a image Cup.jpg on the server
    2� Get your URL
    result: http://www.mysite.com/images/Cup.jpg
    Thanks!!!

    I don't understand what's the problem? Can you please elaborate? Show some code snippets and tell where you stucks on.

  • What happens when a Stored procedure shared by two jobs and get called at same time ?

    Hi All, 
    Not sure its the right way to do it , I wrote a MASTER SP which calls three different SP using variables passed to MASTER SP.
    MASTER SP calls the three SP using EXECUTE IMMEDIATE COMMAND, My question imagine two jobs (Job1) and (Job2) running same time and calling MASTER SP but passing different varaibles what happens here does Job2 wait for Job1 to complete or does SQL Server
    or any database engine clever enough to create two copies of MASTER SP to exeucte the varaibles passed by Job1 and Job2 so it can run in parallel.
    Thanks
    sri 
    Sri.Tummala

    Its Oracle so you need to post it in Oracle forums like
    https://community.oracle.com/community/database/oracle-database-options/sql_and_pl_sql
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • JSF and bean getter functions

    Hi,
    I'm using a JSP page (say page1.jsp) in which I'm binding the values for some inputTexts to the properties of a Bean (say Bean1).
    <af:inputText id="name" required="true"
                                              showRequired="false"
                                               value="#{Bean1.name}">
               and so on.........Now the first time I call this JSP page (page1.jsp), it calls the get functions of the bean and display the correct value for each InputText.
    However, If I update the values of Bean properties (using some other page) and then again call my first JSP page, the JSP page display some InputText with new values and some with old values..
    I can see that It calls some of the get functions in bean and not calling others, instead using the old values.
    The scope of the bean is - Session
    What can be the possible problem, I'm new to the JSF and not very familiar with it, Is there any way I can force the JSP to call the get function every time for every property in the Bean, I'm using in the page so as to get the current value.

    I'm using Jdeveloper 10.1.3 , and I believe with version 1.1 of JSF

  • I keep getting calls from a block caller id and it's some dude speaking arabian what do i do? How do i stop this?

    I keep getting calls from a block caller id and it's some dude speaking arabian what do i do? How do i stop this?

    Stop answering calls with blocked numbers. If it's someone who really wants to talk to you, they'll leave you a message and you can call them back.

  • Submit report in background and get result into calling program

    Hi,
    I want to call the standard SAP program from Zprogram to create invoice using Submit. here the code
    SUBMIT RV60SBT1  TO SAP-SPOOL
                        SPOOL PARAMETERS print_parameters
                        WITHOUT SPOOL DYNPRO
                        VIA JOB name NUMBER number
                        WITH VKOR1 eq TVKO-VKORG
                        with X_VBELN eq gv_vbeln_so
                        with ALLEA eq 'X'
                        with ALLEL eq ''
                        AND RETURN.
    the standard SAP program creates invoice (billing document number). I want to get the billing document number which created using the above statement into the calling program.  ......could anyone pls tell me how to do this? ie how to read the billing document number in the calling program.
    Regrds
    shan
    Edited by: Shankar Raju Devadoss on Mar 21, 2011 9:00 AM

    Hi Shankar,
    You can try it in both ways.
    1.   By using the parameter ID VF. (GET PARAMETE ID)
    2.   Select the invoice numbers from the table VBRK for the current date (SY-DATUM) and
           sort it by time and get the latest invoice.
    Regards
    Hareesh Menon

  • I'm using same icloud and same apple ID on two iphones. Now i get calls from same number on both iphones at the same time. How to turn off that?

    I'm using same icloud and same apple ID on two iphones. Now i get calls from same number on both iphones at the same time. How to turn off that?

    Apple ID's are not device specific, so when you changed it on the iPad 2 it changed it on the iPhone 4 as well, since it's the same account still. What you need to do is create a second Apple ID (so you'll have two accounts, one for iPhone 4 and a seperate one for iPad 2).
    To create a new Apple ID on your iPad 2:
    1) Go into Settings > Store.
    2) If you are already signed in, tap your Apple ID on the screen and you will be given a few options, one of which is to sign out of your account.
    3) After you sign out, now click the "Sign in" button.
    4) Tap "Create New Apple ID" and follow the instructions on-screen.

  • Iam using iphone 4s and Iphone 5s with same apple ID but my network is different and whenever Iam getting call in i5s and in my both handset same calls are coming. Please provide me solutions

    Iam using iphone 4s and Iphone 5s with same apple ID but my network is different and whenever Iam getting call in i5s and in my both handset same calls are coming. Please provide me solutions

    On both devices, go to Settings>Facetime and turn off cellular calls.
    ~Lyssa

  • 3 iphones in household.All use same apple ID.But all contacts get mixed between phones and facetime calls come in from other contacts.Ho can we change this so our phone information isn't visible to each other?

    3 iphones in household.All use same apple ID.But all contacts get mixed between phones and facetime calls come in from other contacts.How can we change this so our phone information isn't visible to each other?

    Use separate Apple IDs for each family member and use Family Sharing features of those things (if any) that you do want to share. https://www.apple.com/ios/whats-new/family-sharing/

  • My iphone 6 connects to the car via bluetooth, the music works good, but the phone calles does not work.  It looks like it is working but doesn't.  I have tried in my Hyundai and a Dodge rent car and get the same results.  I updated the last 8.0.2.

    My iphone 6 connects to the car via bluetooth, the music works good, but the phone calls does not work.  It looks like it is working but doesn't.  I have tried in my Hyundai Sonata and a Dodge Dart rent car and get the same results.  I updated the last 8.0.2.  It worked the first day i had the phone, and then i updated to Ios 8.0.2 and it quit working.
    Now when i get in the car, it acts like it is connected and makes the same call it was on after syncing to bluetooth, but it really isn't on a call.  This is happening on both cars.
    Does anyone know if this is the phone and i need to take it to Apple or if there is an issue that Apple is working on getting a fix for?
    My son in law has the exact same phone as me, we both got the on 10/6, he had a Dodge Dart and his is working via bluetooth.
    Someone HELP please, as i consider this a safety issue by not having my calls go to bluetooth.

    We had the same problem, but figure out the solution.
    You MUST have at least 1 song added to your ITUNE!  After you add a free song, then everything else should work as normal!
    Hope this helps!

  • I've bought an app called WhatsApp but I was not told that app doesn't work for ipod. So I would like to know how to turn back and get my money back.

    I've bought an app called WhatsApp but I was not told that app doesn't work for ipod. So I would like to know how to turn back and get my money back.

    Did you fail to look at the requirements before purchasing?
    All sales are final.  You can try contacting itunes support and asking for an exception

  • How to call an Oracle Procedure and get a return value in Php

    Hi Everyone,
    Has anyone tried calling an Oracle procedure from Php using the ora functions and getting the return value ? I need to use the ora funtions (no oci)because of compatibility and oracle 7.x as the database.
    The reason why I post this here is because the ora_exec funtion is returning FALSE but the error code displayes is good. Is this a bug in the ora_exec funtion ?
    My code after the connection call is as follows:
    $cur = ora_open($this->conn);
    ora_commitoff($this->conn);
    $requestid = '144937';
    echo $requestid;
    $rc = ora_parse($cur, "begin p_ins_gsdata2
    (:requestid, :returnval); end;");
    if ($rc == true) {
    echo " Parse was successful ";
    $rc2 = ora_bind ($cur, "requestid", ":requestid", 32, 1);
    if ($rc2 == true) echo " Requestid Bind Successful ";
    $rc3 = ora_bind ($cur, "returnval", ":returnval", 32, 2);
    if ($rc3 == true) echo " Returnval Bind Successful ";
    $returnval = "0";
    $rc4 = ora_exec($cur);
    echo " Result = ".$returnval." ";
    if ($rc4 == false) {
    echo " Exec Returned FALSE ";
    echo " Error = ".ora_error($cur);
    echo " ";
    echo "ErrorCode = ".ora_errorcode($cur);
    echo "Error Executing";
    ora_close ($cur);
    The Oracle procedure has a select count from a table and it returns the number of records in that table. It's defined as:
    CREATE OR REPLACE procedure p_ins_gsdata2 (
    p_requestid IN varchar2 default null,
    p_retcode OUT varchar2)
    as
    BEGIN
    SELECT COUNT (*) INTO p_retcode
    FROM S_GSMRY_DATA_SURVEY
    WHERE request_id = p_requestid ;
    COMMIT;
    RETURN;
    END;
    Nothing much there. I want to do an insert into a table,
    from the procedure later, but I figured that I start with a select count since it's simpler.
    When I ran the Php code, I get the following:
    144937
    Parse was successful
    Requestid Bind Successful
    Returnval Bind Successful
    Result = 0
    Exec Returned FALSE
    Error = ORA-00000: normal, successful completion -- while
    processing OCI function OBNDRA
    ErrorCode = 0
    Error Executing
    I listed the messages on separate lines for clarity. I don't understand why it parses and binds o.k. but the exec returns false.
    Thanks again in advance for your help. Have a great day.
    Regards,
    Rudi

    retcode=`echo $?`is a bit convoluted. Just use:
    retcode=$?I see no EOF line terminating your input. Your flavour of Unix might not like that - it might ignore the command, though I'd be surprised (AIX doesn't).
    replace the EXEC line with :
    select 'hello' from dual;
    and see if you get some output - then you know if sqlplus commands are being called from your script. You didn't mentioned whether you see the banner for sqlplus. Copy/paste the output that you get, it will give us much more of an idea.

  • Can we call a transaction in background and get the list in report?

    I want to call the standard T-Code MC.9 from a report in background using Call Transaction and get the list in the report.There are some enhancement done to its base program RMCB0300 due to which if I use Submit ... exporting to memory and then import the list from memory, the result doesnt match to the values given by T-Code MC.9.
    The option apparently for me is to use Call Transaction method, but if I use Call transaction method, how do I make the report to be executed in background and then get the resultant list in the report?

    Copy the program in Z and than modify it saving the list on memory on database table.

Maybe you are looking for

  • DMS Configuration/Blue Print

    HI, We are inprocess of implementing the DMS in our organization, Pls any body can share the configuration/blue print document to mail id [email protected] Pls guide us to proceed further. if its useful, awards will be provided. Thanks in advance. Ma

  • Simple swap image, CS6, HTML 5, unexpected results.

    Validated well, and checked paths numerous times. Must be missing something simple. Large image appears instead of nav image, but directory path correct. Page located at: http://www.satgraphics.com/_photo_gallery/index.htm# Thanks in advance. Joe Sat

  • Nuances of the Scanner Class

    I'm having trouble with the Scanner class... here is a snippet of code from a program I am writing. ========== 1 System.out.print("Enter the name of the new passenger-> "); 2      String passengerName = scan.nextLine(); 3      System.out.println(pass

  • CS6 Master Collection invalid registration

    After registering and using the CS6 Master Collection (Mac) for most of a year, today it thinks it's a trial version and needs a valid serial number. But, it isn't accepting the serial number I originally registered with. It says it's an invalid numb

  • Photoshop CS1 activation crack

    I have spoken with tech support numerous times regarding this problem, but have never received an actual response. .. The issue is with Photoshop CS1 not having the same ability as every other version of Photoshop to either backup the activation info