Value  set in constructor is not getting saved in button  Action method

Hi All,
I am not understanding why the value set ( On Condition )in constructor is not hold in the button actoin method.
Could any body explain me on that
for this I will try to explain with sample example
I have taken a button and add a integer property in session bean.
now if session bean's property is even then I am trying to set the button value to bidNow other wise Accept Invitation.
Till this opstion everything is OK
but once I click on Button,
Constructor is doing the right job only. But I do not understand why in button action I am getting the First Value only.
public Page1() {
        // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
        try {
            if (getSessionBean1().getIntValue()%2==0)
                button1.setValue("BidNow");
            else
                button1.setValue("Accept Invitation");
            getSessionBean1().setIntValue(getSessionBean1().getIntValue()+1);
            log("In Constructor Button Value : "+button1.getValue());
        } catch (Exception e) {
            log("Page1 Initialization Failure", e);
            throw e instanceof javax.faces.FacesException ? (FacesException) e: new FacesException(e);
        // </editor-fold>
        // Additional user provided initialization code
    public String button1_action() {
        // TODO Replace with your code
        log("In Action Button Value : "+button1.getValue());
        return null;
    }and here is the log
[#|2005-07-19T11:55:17.859+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
[#|2005-07-19T11:55:17.859+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:18.359+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
[#|2005-07-19T11:55:18.359+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:18.843+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
[#|2005-07-19T11:55:18.843+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:19.312+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
[#|2005-07-19T11:55:19.312+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:19.828+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
[#|2005-07-19T11:55:19.828+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:20.234+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
[#|2005-07-19T11:55:20.250+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:20.828+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
[#|2005-07-19T11:55:20.828+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:21.328+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
[#|2005-07-19T11:55:21.328+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:35.437+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
[#|2005-07-19T11:55:35.437+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:35.906+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
[#|2005-07-19T11:55:35.921+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:36.265+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
[#|2005-07-19T11:55:36.265+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:36.890+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
[#|2005-07-19T11:55:36.890+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:37.171+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : BidNow|#]
[#|2005-07-19T11:55:37.171+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]
[#|2005-07-19T11:55:37.468+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Constructor Button Value : Accept Invitation|#]
[#|2005-07-19T11:55:37.468+0530|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WebModule[/webapplication12]In Action Button Value : BidNow|#]As per this log every time I am getting Bid Now only in action, though the value is changed in Construtcor
Can u explain the reason for this

Hi Sudhakar,
Please try the following and you will get an idea as to what is happening:
1. Drag and drop a button, 2 outputText components
2. Add a property to the session bean called intValue of type int. Customize it to set it's initial value to 0
3. Add the following lines of code to the constructor
outputText1.setValue("" + getSessionBean1().getIntValue());
getSessionBean1().setIntValue(getSessionBean1().getIntValue()+1);
4. Double click on the button component to go to the button action method.
5. Add the following line of code
outputText2.setValue("" + etSessionBean1().getIntValue());
6. Save and run the application
7. Watch the values of outputText1 and outputText2 with each click of the button
Also, try the application with the following code block in the button action method:
if(getSessionBean1().getIntValue()%2==0){
button1.setValue("Bid Now");
} else{
button1.setValue("Accept Invitation");
getSessionBean1().setIntValue(getSessionBean1().getIntValue()+1);
outputText1.setValue(button1.getValue());
outputText2.setValue("" + getSessionBean1().getIntValue());
When the above code block is in the button action method the values set to button are as expected.
Hope that helps
Cheers
Giri :-)

Similar Messages

  • MessageRadioButton Value is not getting saved

    Hi All,
    I am facing an issue with Radio Button data.
    When the page loads all the "No" buttons will be selected by default.When I select "Yes" radio buttton and click on "Save", all the radio buttons will get reset to "No" and same value will get passed further. Value of "Yes" button will not get saved.
    Please help me in resolving this issue.
    Thanks,
    Akshata

    Give it a shot by trying this. Hope this helps you.
    OAMessageRadioButtonBean personButton =(OAMessageRadioButtonBean)webBean.findChildRecursive("Person");
    personButton.setName("partyTypeGroup");
    personButton.setValue("PERSON");
    personButton.setSelected(true);
    OAMessageRadioButtonBean orgButton = (OAMessageRadioButtonBean)webBean.findChildRecursive("Org");
    orgButton.setName("partyTypeGroup");
    orgButton.setValue("ORGANIZATION");
    To retrieve the value of the Radio button, which is selected use the below
    System.out.println("Radio Button Value : "+ pageContext.getParameter("partyTypeGroup"));
    Also, if on click of button, you should once again set the radio button by calling setSelected() to retain the same look n feel, else, the selection wud jump to the other radio button.
    Basically, developer guide says, that you cannot assign the group name or checked/unchecked value to the Radio button declaratively). For more information read
    Radio Group / Buttons in Developer guide.
    Thanks
    Saurabh
    Edited by: SaurabhAg on Mar 22, 2012 12:58 AM

  • While Creation Of SaleOrder Char Values are not getting saved.(V C)

    Hi SAP gurus,
    One of my client can able to create a saleorder but when we go and see in VA03 Display mode,we found Charactrestic values getting miised out.What could be the probale reasons.
    Note: I Have stimulate the required combination as per my client requirement in CU50,here i can able to indentify the Green Sign,but While Creation Of SaleOrder Char Values are not getting saved.
    Awaiting for your valuable reply.
    Cheers,
    Kumar.S

    Kumar ,
    If you assign values in classification view or configuration profile  they will become default for the product, and it willnot be changed in sales order.
    another thing if the item category is incorrect you will not get the configuration pop up at all .
    problem what i understand from your thred is at the time of sales ordeer creation there is some inconsistances in the configuration , may be some condition is not fullfilling.
    If in CU50 the result shown are error free, same configuration should owrk properly in sales configuration process, please again try to create it in sales order with same value assignment also check all the messages.
    see the result of configuration before saving the sales order , i hoep it will work for you.
    I am assuming all the things from SD are properly configured ie item catageory, varient pricing etc.
    Check and revert back.
    Regards
    Ritesh

  • Load remote images in html mail setting does not get saved. I have to turn it off every time I log in. Is this a bug?

    Load remote images in html mail setting does not get saved. I have to turn it off every time I log in. Is this a bug?

    Plug your phone into the wall charger for at least 30 minutes...make sure you have a sim card in the phone...then:
    Leave the USB cable connected to your computer, but NOT your phone, iTunes running, press & hold the home button while connecting the USB cable to your dock connector, continue holding the home button until you see “Connect to iTunes” on the screen. You may now release the home button. iTunes should now display that it has detected your phone in recovery mode, if not quit and reopen iTunes. If you still don’t see the recovery message repeat these steps again. iTunes will give you the option to restore from a backup or set up as new.
    Make sure you have no anti-virus software running or any firewalls...turn all of that stuff off.

  • ESS Leave request not getting Saved to Infotype

    Hai All,
    I created a Leave Workflow wherein there are 5 levels of Approval. After the final approver approves, the Workflow will be Completed but, the data is not getting saved to the Infotype. I ran the reports required, but still it is not getting saved.
    I have created a User Decision Step and the type of that is: BOR -> Decision -> Process. I think, the BOR is not returning the Value Approve or Reject correctly. I haven't made any changes to the BOR. So, it has to return the Status correctly right? Please correct me if I am wrong.
    According to Outputs of the above step (Aprove, Reject or Obselete), further steps are designed. But, on Final Check for Approved (where the status is checked for Approval), it returns False as the Status is set as SENT  (?).( I checked the Workflow Log and the status there seems to be SENT, instead of Approved) I think, due to this status, the Infotye is not getting Saved.
    Please help me on this.
    Regards,
    Jubish

    Hi ,
           How did you resolved it. Can you please provide solution for it.
    regards,
    kishore

  • Output type not getting saved in the PO

    Hello Team
    we are facing one issue where output type is not getting saved in the PO.
    we give one output type and than save it , after going back to the PO we see that it is not there.and no output issued
    the PO is released properly and there is no issue , any idea what could be the reason for it

    Hi,
    Check in SU3 t.code, did check box selected u201CDelete After Outputu201D in Spool Control segment in Default TAB
    Also check Partner Function VN maintained in Default values TAB in NACR--- > EF Application for your output type
    Cross check partners {VN, PI, GS) are assigned to your PO output type in Partner Roles per Message Type
    Regards,
    Biju K

  • Added new fields in vendor master in xk01 but data is not getting saved

    Hi experts,
    To add new fields in vendor master i have followed the following steps :
    1.) Appended a structure ZRTGS in LFA1 table with required fields and activated
    2.) Added new button in xk01( vendor master ) using spro -> logistics-general -> business partner -> vendors ->
    control ->adoption of customer's owaster data fields -> prepare modification free-enhancement of vendor master record
    Created a screen group ZR and defined label tab pages with function code ZRTGS and saved entries
    3.) Created a implementation for BADIs VENDOR_ADD_DATA and VENDOR_ADD_DATA_CS.
    4.) Created a program with my own subscreen for the required fields
    The button is getting displayed in XK01, XK02 and XK03 respectively. Whenever the button is clicked the subscreen with
    the fields is also displayed. But whenever i try to save the data in either XK01 or XK02 it is not getting saved in to the
    database table LFA1.
    Request your help in this regard.
    Thanks in Advance.

    Hi,
    You may need to check this include .
    EXIT_SAPMM06E_008  -->Import Data from Customer Subscreen for Purchasing Document
    Thanks,
    vamshi

  • File not getting Saved on Application Server

    Hello All,
    We created a file in "Automatic Payment Transactions (F110 Transaction)" and are able to save the text file on Local drive. But for our e-banking requirement we need to store this file on our application server. The configuration settings in OBPM4 are already done and now system is picking the default application server path while saving file in "Payment Medium - > DME Administration" transaction. The problem is - although the system is picking the required path of application server but file is not getting saved. The error coming is: File <path> could not be opened (Message Number: FZ231).
    We have checked for 777 authorisations (OS authorisations) for the folder.
    Please suggest that what can be done to resolve th issue.
    Regards,

    What exactly we need to check in Payment program? We are not able to save the file on application server. There is no problem while saving the same in local drive.
    Regards,

  • Inbound Idoc - Date fields not getting saved

    Hello,
    I have created inbound idoc scenario in SAP. I receive Idoc from non SAP system to SAP system.
    then data from IDoc is saved into different tables, for that I have written one function module (attached to process code)
    One of the segments in IDoc type has date as a field. It is of type sy-datum.
    When I receive Idoc in SAP only date fields are not getting saved in tables.
    Is anything specific need to be done for date fields? please advice.

    check which format you are getting into sap and make sure you are coverting in into required format.

  • Billing document not getting saved

    Hi Gurus,
            I am facing a problem with th billing doument. When I try to save the Billing through VF01, it is going to the screen and showing the line items in it. And when we save, it is generating a billing document number.But it is not getting saved.And when go and see in VF02
    it is showing a message <b>Express document "Update was terminated" received from Author----
    "</b>.
    How to resolve this.PLS help me out in this.
    Thanks in Advance
    Regards
    VASU

    Hi Vasu
    Check whether number range assignment has done.  Most probably, you would not have done that.
    Incidentally, I had also faced similar problem sometime back and after lot of study, I could come to a conclusion that it is because of non assignment of number range.
    Thanks and dont forget to reward if this helps you.
    G. Lakshmipathi

  • Workflow message modifications not getting saved into database

    Hello Friends,
    I am working on iProcurement module (11i) and have a requirement to remove the 'View' & 'Edit' links which appear in notification/Emails in Requisition Approval Workflow.
    I found a metalink note "How to Remove Related Application Links From Approval Notifications for AME [ID 1100805.1]" for the same.
    We have to delete some attributes from the workflow message to remove the links but the same is not getting saved in database.
    I am uploading the wft file through Workflow Definition Loader program with the 'force' option. And to check the changes , i am again downloading the file but i could not see the changes.
    Can't attributes be deleted from the message?
    Any suggestions ?
    Thanks...
    Regards,
    Amit

    Hi Hussein,
    Thanks.
    Here are the details :
    RDBMS : 11.2.0.2.0
    Oracle Applications : 11.5.10.2
    OS : Windows XP
    Log :
    Concurrent request completed successfully
    Current system time is 01-DEC-2011 08:29:12
    Oracle Workflow Definition Loader 2.6.4.0.
    Access level: 20, Mode: FORCE
    Uploaded 3 ITEM_TYPE record(s) to database.
    Uploaded 55 LOOKUP_TYPE record(s) to database.
    Uploaded 32 MESSAGE record(s) to database.
    Uploaded 182 ACTIVITY record(s) to database.
    Uploaded 0 ROLE record(s) to database.
    Regards,
    Amit

  • Document type created not getting saved

    Hi all,
    In DC10 I created document type and saved but its not getting saved?
    I gave document type as CD and description as COREL DRAW and tried to save it, but its not getting saved and asking to fill the required fields so I filled
    Version no. Inc as   1
    class Type  as      017
    and class  as     cl0001
    and in Field selection:
    Class data as display
    document status as *Display and then tried to save but the save option is in hide mode.
    what is a characteristic and why do we require and how to give the naming convention or numbering to it?
    Because I cant see the previously created chars?
    Please answer
    Thx

    Thanks Aby for answering
    how to name the class and class type ?
    I can see the class types but not class, is it a number or any other name ?
    How to create character and what is the naming convention?
    if I created a class and class type and character for a document type in DC10 then will they be shown in display screen CV03N?
    Thx

  • Adobe form - Text field not getting saved.

    Hi All,
    We created an application in which user will enter the data and submit it . The details entered in the screen will be saved in the Ztable.
    Our problem is when the user enters the data in the TextField UI of the adobe form it is not getting saved in the table. In development its working fine.
    In production for few users it is getting saved and for few users it is not getting saved.
    We are not able to find out the root cause of the problem.
    Any help will be appreciated
    Best Wishes
    Idhaya R

    Hi Idhaya,
    As you said it is working for few users,
    Then you need to check Adobe reader installed for users who are having problem.
    Hope it helps.
    Regards,
    Arun

  • Bom item data - Document assignment not getting saved in table STPO

    Dear All,
                  As per out customer requirement, they want to display assigned drawing documents of Bom items in CS11. But it is not reflecting in cs11 eventhough we have assigned documents in Bom item detail overview Document assignment tab page. Moreover this is not getting saved in table STPO.
                   Waiting for solutions
    Thanks & Regards
    Dhananjay Kulkarni

    Please understand my customers requirement,
                               Presently they are assigning drawing document of each mat in material master. And if they want to see the drawing of each component of bom through Bom maintenance then they double click on component in bom, goes to mat master then additional data then document data and then drawing. In this way they need to open minimim 5 windows, which they want to make minimum 2 windows.
              In bom they are having more than 300 components. This is not possible to define document as component with item category D of so many components. One more idea I given to them is to club all drawings in one document and define that document as component with item category D, but in this way they can't identify  the individual drawing with part name.
              One more idea I given to them is to assign drawing document of individual component in item overview - Document assignment tab page from where they can open the drawing but it needs to open minimum 3 windows. So they are ready to assign drawing document in item overview - Document assignment tab page but they want, it should reflect in CS11 document column, from where they can easily open the drawing document.
              One more thing I observed that, assigned document to item overview - Document assignment tab page is not getting saved in Table STPO. I can't see this field content in STPO, which may be the reason that it is not reflecting in CS11.
             Is anything missing from Document management system?
    Please think and reply friends it's Urgent.
    Thanks & Warm Regards
    Dhananjay Kulkarni

  • Changes in Texts in custom editor not getting saved in QM02 tcode

    Hi Expert,
    I am working on a screen exit in QM01. I have created a editor box(like the description box under Description tab in QM01) using class cl_gui_custom_container and cl_gui_textedit. I am able to create and display the text I type in the box alongwith other standard changes but if I try to change and save the text only in the custom text box, it is not getting saved. I debugged and found out that the standard does not recognize any change in the custom controller box.
    Please suggest.
    Thanks in advance,
    Sangeeta.

    Hi Sangeeta,
    After doing changes which method are you using to capture the text in the text editor ?
    There is a method GET_TEXT_AS_R3TABLE in class CL_GUI_TEXTEDIT . in that pass 'X' to ONLY_WHEN_MODIFIED parameter,
    Hope these may resolve your issue.
    Regards,
    Kumar M.

Maybe you are looking for