How to reset the value in valueChangeListener

I would like to reset the value in a component to its earlier value in the valueChangeListener.
Here is an example method in the bean:
public void valueChangeListener(ValueChangeEvent valueChangeEvent) {
Date oldDate = (Date)valueChangeEvent.getOldValue();
Date newDate = (Date)valueChangeEvent.getNewValue();
if(newDate > sysdate) {
//valueChangeEvent.getComponent().WHATEVER.setValue(oldDate)
} else {
valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
Please suggest the code that I need to put in comments.
Note: One way to achieve this is to bind the component to the bean and do a setValue. I do not want to do this(I have master-detail tables with many rows to edit. So, this resetting should be done at row level by fetching the current row on the selected table and set).

public void firstNameChanged(ValueChangeEvent event)
System.out.println("FirstName changed");
System.out.println("old value = " + event.getOldValue());
System.out.println("new value = " + event.getNewValue());
String oldValue = (String) event.getOldValue();
String newValue = (String) event.getNewValue();
RichInputText firstname = (RichInputText) event.getComponent();
RichInputText lastname = (RichInputText) JSFUtils.findComponentInRoot("EmployeesLastName");
firstname.setSubmittedValue(oldValue);
firstname.setValue(oldValue);
lastname.setSubmittedValue("lastname");
lastname.setValue("lastname");
AdfFacesContext.getCurrentInstance().addPartialTarget(firstname);
AdfFacesContext.getCurrentInstance().addPartialTarget(lastname);
}

Similar Messages

  • Report With Multiple Radio Button ,How to reset the values of when selected

    Reaching out to the experts here. I have a report which i created a radio group which saves the value rownum when the radio buton is selected to a hidden item based on an on click event. There are currently 3 radio button , i need to be able to "reset" the value of the other items when more than of the button are selected .I.E. There are 3 buttons, user clicks button one , but then decides they need to click button two , then realizes they really wanted to perform button 3 , I want to be able to "reset" the value of the 1st two hidden items so the only value populated is the 3rd hidden item. I am new to working with these features and scenarios so any and help would be appreciated.
    Here is the report
    SELECT APEX_ITEM.RADIOGROUP(1, ROWNUM, NULL,NULL,'onclick="javascript:$x(''P5_HIDDEN1'').value=' || ROWNUM|| '"') UPDATE_RECORD
    ,APEX_ITEM.RADIOGROUP(1, ROWNUM, NULL,NULL,'onclick="javascript:$x(''P5_HIDDEN2'').value=' || ROWNUM|| '"') DELETE_RECORD
    ,APEX_ITEM.RADIOGROUP(1, ROWNUM, NULL,NULL,'onclick="javascript:$x(''P5_HIDDEN3'').value=' || ROWNUM|| '"') SET_PRIMARY
    ,papf.first_name
    ,papf.last_name
    ,hl.meaning
    ,pp.phone_number
    ,case when phone_type is not null then (select meaning from hr_lookups where lookup_type ='PHONE_TYPE' and pp.phone_type=lookup_code)
    end as phone_type
    ,emrg.primary_contact_flag
    from hr.per_all_people_f papf
    ,apps.hr_lookups hl
    ,apps.per_contact_relationships pcr
    ,apps.per_phones pp
    ,(select contact_person_id,primary_contact_flag
    from apps.per_contact_relationships pcr
    where pcr.person_id = :P5_PERSON_ID
    and contact_type = 'EMRG') emrg
    where pcr.contact_person_id in emrg.contact_person_id
    and pcr.personal_flag='Y'
    and contact_type <> 'EMRG'
    and trunc(sysdate) between date_start and NVL(date_end,'31-DEC-4712')
    and pcr.contact_type = hl.lookup_code
    and hl.lookup_type='CONTACT'
    and pcr.contact_person_id = papf.person_id
    and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
    and pcr.contact_person_id = pp.parent_id
    and pp.phone_type in (select lookup_code from hr_lookups where lookup_type ='PHONE_TYPE')

    Related thread here How to Pass values from SQL Report into TEXT ITEM ?
    Regards,

  • How to reset the value of a static attribute in a class (in SAP CRM)

    Following the documentation in  "C04_BB_ConfigGuide_EN_DE.doc".
    I created a logical link for a remote ERP transaction from CRM7.0  
    The link to this file is http://help.sap.com/bp_crmv12007/CRM_DE/HTML/index.htm then Technical Information --> Building Block Library.
    I made a mistake in the defining MappedLogSys name for the remote ERP system in Tcode CRMS_IC_CROSS_SYS.
    Later I deleted the wrong entry using tcode CRMS_IC_CROSS_SYS and created the correct entry for the remote ERP system.
    But whenever I try to create a new Link for ERP transaction in the CRM system using the wizard, (tcode CRMC_UI_ACTIONWZ), the wizard pickes up the deleted logsys name.
    Using  tcode SE24  & the Test icon (F8) I ran a test for the class CL_ERP_TX_MMBE and the value of the attribute "GV_MAPPEDLOGSYS" is set to the old deleted value.
    How Can I fix this issue and make the class pickup the correct MappedLogSys value.

    I basically deleted the transaction launcher link and recreated a new one.

  • How to reset the value of drill down - Chart

    Hi gurus. I have a problem related with drilldown.
    is there any way I can reset the drill down value?,of course, except for using reset button
    (in  this case "reset" means "make the cell blank of certain value")
    I tried using "push button" and the cell is reset.
    However, even though the cell is reset, the cell is set to the drill down value in one second.
    ex. Drill down destination : a --> "" --> a
    (a is drill down value)
    Is there a way to reset the drilldown value?
    Thanks in advance.

    Thanks for your help , Sonja
    I used push button but it can not refresh(reset) drill down cell
    because the destination cell of the chart remains drill down value
    I tried like below way
    a : drill down value
    Goal : make drill down cell turn to blank after i used drill down once.
    1ST.
    when i click the chart and use drii down, a is entered into drill down cell
    2ND
    by using "push button", i tried to reset drill down cell
    but unfortunately it does not work.
    Although drill down cell changes instantly to blank after just one second, it changes to a, drill down value
    drill down cell changes like this
    1 ->   2   ->  3
    a -> blank ->  a
    i have to eliminate (2->3) phase or find another way to refresh drill down cell.
    Regards
    Kwon

  • How to reset the military usage value in GTS Business partner

    Hello Experts,
    Does anyone know how to reset the Military usage value='2' to blank on the Business partner within GTS?
    I tried putting a blank there, clicking on the accept entries button followed by  saving the Business partner.
    It does not seem to work this way.
    Does anyone know if it's SAP bug for not having blank as one of the allowable values for the usage except when it's that way while newly created?
    The GTS implementation details are as follows:
    Any help with regard to this will be much appreciated......
    Thanks,
    Prashant.

    Prashant,
    As I already informed you, it is not possible to re-set the indicator to <blank>.
    From the program code, I can see that the usage indicator is only transferred from the feeder system during the creation of a customer partner.  The value in GTS is set either to '1' or '2' during creation, and cannot be changed by any subsequent data transfer from the feeder system.
    I think that logic is related to the fact that usage records may be created for multiple Legal Regulations, and those records may then be changed individually by the user in GTS.  On that basis, it would not be reasonable to over-write the values by re-transferring the customer from the feeder system.
    Regards,
    Dave

  • How can I reset the value of an array?

    How can I reset the value of an array at the beginning of my program?

    There is a option in LV,
    "Edit --> Make current value defult"
    Every time you reopen your VI, it will set to your custom default value.
    There are many ways of doing this.
    Another way of doing this is, You can use "sequence structure and property node". Make the property node of your array and choose "value". Then mark it to write. See attach.
    When you feel sad, laugh
    Attachments:
    x.GIF ‏4 KB

  • How to delete the values from TKOMV at runtime after creating PO

    Hi,
      How to delete the values from TKOMV at runtime after creating PO from IDOC. I am creating PO through IDOC, subsequently need to create Sales order and again need to create 2nd PO with reference of Purchase Requestion(created with sales order). At the time creation of 2nd PO the Header conditions are appearing twice and net price value is appearing wrong.
    Thanks in advance.

    Hi Padma
    Can you do this activity once the company code is in to production. I guess you can not do this activity, if the company code is already in to live. Setting or resetting of the recon accounts will hinder the previous actitivity. Infact resetting of the company code is also not a good option.
    Any how, thanks for the inputs. Please let me know whether i can do this activity only at the subledger level which will not impact other modules. The one solution i can figured out is , reverse all the transactions for the corresponding asset in the year of takeover and pass the entries again in the same year correctly which will have effect in Subledger and also in general ledger. But the business people will not allow this, since for a big client it will require lot of authorizations and approvals. Infact the vendor also, is cleared. So we have to reverse the cleared documents as well which is again a task and require approvals as well.
    Thanks and regards
    Seshu.

  • How to set the value of process variables/payload using a managed bean?

    Hello,
    Someone can give me an example about how to set the values of a process payload in a managed bean?
    thank you!

    Try this:
    jsf page:
    <af:selectOneChoice label="Select Suburb"
    requiredMessageDetail="Select a suburb"
    valueChangeListener="#{selectOneChoiceBean.onValueChanged}"
    validator="#{selectOneChoiceBean.validate}"
    unselectedLabel="None" autoSubmit="true"
    binding="#{selectOneChoiceBean.selectOneChoice}"
    value="#{selectOneChoiceBean.value}">
    <f:selectItems value="#{selectOneChoiceBean.selectionList}"/>
    </af:selectOneChoice>
    backing bean:
    public class SelectChoiceBean {
    private List<SelectItem> selectionList;
    private String value = "B";
    private RichSelectOneChoice selectOneChoice;
    public SelectChoiceBean() {
    initSelectionList();
    public void setSelectionList(List<SelectItem> selectionList) {
    this.selectionList = selectionList;
    public List<SelectItem> getSelectionList() {
    return selectionList;
    public void onValueChanged(ValueChangeEvent valueChangeEvent) {
    System.out.println(valueChangeEvent.getNewValue());
    // Add event code here...
    public void validate(FacesContext facesContext, UIComponent uIComponent,
    Object object) {
    // Add event code here...
    private void initSelectionList() {
    selectionList = new ArrayList<SelectItem>();
    selectionList.add(new SelectItem("A", "A label"));
    selectionList.add(new SelectItem("B", "B label"));
    selectionList.add(new SelectItem("C", "C label"));
    public void setValue(String value) {
    this.value = value;
    public String getValue() {
    return value;
    public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
    this.selectOneChoice = selectOneChoice;
    public RichSelectOneChoice getSelectOneChoice() {
    return selectOneChoice;
    }

  • How to zero the values that are greater than 0 at time 0?

    Hello, New user,
    I would like to know how to zero values that are greater than 0 at time 0.  I am totalizing gas flow and understand how not to add the negative numbers but am unsure about the positive numbers at 0 flow.  I hope I have explained this good enough.
    Thank you,
    Lisa

    I don't understand why the value which should be 0 is actually greater than 0.
    How do you determine that the value should be 0, such as no flow, even if the value is greater than 0?
    Ryan Shi
    Hello Ryan,
    The system itself may have an offset of 0.1 V which in the program is related to flow.  I do not wish to add this .1 as flow.  I want to beable to reset the values to 0 and then when there is flow, to add the flow.   If you purchase a program from some vendors you can zero the channel, that is my goal.  I want this to be automatic when a switch is pressed.  Such as:  for 20 seconds, average channel, and use that value as 0 flow then add flow??   I was told averaging may work??
    Thank you again,
    Lisa Williamson

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • How to find the value of a variable in other program

    How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
    Regards
    Vin

    Hi Vinayak,
         you will be having your first program values in internal table or some variables,
        when you are calling the second program you wii use like this,
        SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
                           WITH s_emp(second program select-options)   IN t_emp(first program variables)
                           WITH p_chk   EQ t_chk
                           WITH p_r1    EQ t_r1
                           WITH p_month EQ t_month
                           WITH s_cust1 IN t_cust1
                           WITH p_r2    EQ t_r2
                           WITH s_cust2 IN t_cust2
                           WITH s_week  IN t_week
                           AND RETURN.
    you have pas like this to get your first program details.

  • The HP C4480 all in one series PRINTER that I got free with my i-Mac is printing TINY print despite that my computer is set at 13 font Helvetica. How to reset the printer to normal print?

    The HP C4480 all in one series PRINTER that I got free with my i-Mac is printing TINY print despite that my computer is set at 13 font Helvetica. How to reset the printer to normal print?

    Is the Paper Size: set to US Letter and Scale: set to 100%
    Dennis

  • Does anyone know how to reset the fan on a MacBook Pro 13-inch (Late 2011) to it's factory setting speed (Maybe Terminal may help?)

    I have a late-2011 13-inch MacBook Pro running OS X Yosemite. (Standard configuration).
    My problem is that I downloaded a fan control application and it worked perfectly, but it started to get annoying so I deleted it.
    Does anyone know how to reset the fan speed back to factory settings (Maybe a command in terminal?)

    Hello damo1177,
    It should help to reset your system's SMC and NVRAM.
    Intel-based Macs: Resetting the System Management Controller (SMC)
    http://support.apple.com/kb/HT3964
    About NVRAM and PRAM
    http://support.apple.com/kb/HT1379
    Cheers,
    Allen

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • How to get the value from databank

    Hi,
    How to get the value from databank? and how to set the same value to visual script object?
    thanks,
    ra

    Hi,
    You can use GetDatabankValue(HeaderName, Value) to get the value from databank and SetDataBankValue(HeaderName, Value) to set the value to databank.
    You can refer to the API Reference to see list of associated functions and techniques we can use with related to Data Bank.
    This is the for OFT but if you are using Open Script then you have direct access for getting the databank value but when it comes to setting a value you have to use File operation and write you own methods to do the set operation.
    Thanks
    Edited by: Openscript User 100 on Nov 13, 2009 7:01 AM

Maybe you are looking for

  • Labview and KDE 2.0.1

    I'm working on Labview since version 3.0. During this year I started to worke with Labview on my Linux box and every things was going well until I installed KDE 2.0.1. I'm using Red Hat 6.2. On the shell I read: X Error of failed request: BadDrawable

  • Read cluster PCL4 .. takes lot of time

    Hi guys,   Though I Know this is a functional related forum, i would want to post  techincal question related HR ABAP. I have a report that needs to read data from PCL4 cluster and display master data changes for an employee. Developed a big program

  • How to make the "place"key active??

    If I want to open an image from a map, the "place" key appears not te be active...how come???

  • Validation Select works on FF not on IE

    Hi guys! Made a few tweaks on the site today, and I just realized that my Validation Select Widget was not working on IE 7 (!). I'm completely puzzled. It works fine on Firefox, as always... could someone shed some light? Here's the page: http://www.

  • HT4623 I  don't have that option in my settings I only have a generation 4 iPod?

    I am loosing programs cause I can't update my iPod. It does not have IOS. In settings there is no where that I can update by pushing a button. How do I update it?