How to clear input field value on back

Hi All,
I have developed an application, in which user put sales order on first page and press a button then its detail display on second page using restAPI. Now when I press back button on second page then it takes me to first page with holding previous sales order value in input field. And when I change its value and press that button again then it shows me previous sales order detail.
Please suggest me, how to refresh cache and input fields value on back button?
Thanks & Regards
Shubhanshu

Hi Viren,
My code is,
First view
sap.ui.jsview("uitest2.first", {
  getControllerName : function() {
  return "uitest2.first";
  createContent : function(oController) {
  var text = new sap.m.Label({
        text: 'Dealer Code',
       layoutData: new sap.m.FlexItemData({alignSelf: sap.m.FlexAlignSelf.Center })
  var input =  new sap.m.Input("CUSTOMER",{
        type: sap.m.InputType.Text,
      placeholder: 'Enter Dealer code...',
      layoutData: new sap.m.FlexItemData({growFactor: 1, alignSelf: sap.m.FlexAlignSelf.Center}) 
  var Dealer = new sap.m.HBox({ 
            items:[  text,input
//                   new sap.m.Label({
//                   text: 'Dealer Code'
//                   new sap.m.Input("CUSTOMER",{
//                   type: sap.m.InputType.Text,
//                   placeholder: 'Enter Dealer code...'
                   height : "6em"
      var button = new sap.m.Button({
           text: "Submit",
           press: function(oEvent) {
              oController.loadData();
              app = sap.ui.getCore().byId("myApp");
              app.to("idsecond1");//, sap.ui.getCore().byId("CUSTOMER").getValue());
           layoutData: new sap.m.FlexItemData({alignSelf: sap.m.FlexAlignSelf.Center}) 
      return new sap.m.Page({
     title: "Sales Dealer Info",
     content: [ Dealer,button
First controller
sap.ui.controller("uitest2.first", {
    loadData: function() {      
        var oParameters = ({
        "CUSTOMER" : sap.ui.getCore().getElementById('CUSTOMER').getValue(),    
         console.log(oParameters);
         var url = "http://###########:8000/sap/bc/zrst_customer?sap-client=800/";
         var oModel = new sap.ui.model.json.JSONModel();
         $.ajax({             
         url : url ,
         dataType : "jsonp",
         type : "POST",
         data: oParameters,
         success: function(data,textStatus,jqXHR) {
         data = JSON.parse(data);
                 console.log(data);   
                 oModel.setData(data);
         sap.ui.getCore().setModel(oModel);
Second View
sap.ui.jsview("uitest2.second", {
  getControllerName : function() {
  return "uitest2.second";
  createContent : function(oController) {
  var oTable = new sap.m.Table("table",{
       headerText: "Dealer data",
       columns: [
         new sap.m.Column({
           header: new sap.m.Label({text: "NAME"}),
  demandPopin  : true,
  minScreenWidth : "Tablet",
         new sap.m.Column({
           header: new sap.m.Label({text: "CITY"}),
  demandPopin  : true,
  minScreenWidth : "Tablet",
         new sap.m.Column({
           header: new sap.m.Label({text: "COUNTRY"}),
  demandPopin  : true,
  minScreenWidth : "Tablet",
         new sap.m.Column({
           header: new sap.m.Label({text: "COUNTRYISO"}),
  demandPopin  : true,
  minScreenWidth : "Tablet",
         new sap.m.Column({
          header: new sap.m.Label({text: "STREET"}),
  demandPopin  : true,
  minScreenWidth : "Tablet",
         new sap.m.Column({
          header: new sap.m.Label({text: "PST_CODE"}),
  demandPopin  : true,
  minScreenWidth : "Tablet",
         new sap.m.Column({
          header: new sap.m.Label({text: "TELEPHONE"}),
  demandPopin  : true,
  minScreenWidth : "Tablet",
         new sap.m.Column({
          header: new sap.m.Label({text: "EMAIL"}),
  demandPopin  : true,
  minScreenWidth : "Tablet",
       items: {
       path: "/KEY",
       template: new sap.m.ColumnListItem({
       cells: [
               new sap.m.Text({                              //new sap.m.ObjectIdentifier
               text: "{NAME}"
               new sap.m.Text({
               text: "{CITY}"
               new sap.m.Text({
               text: "{COUNTRY}"
               new sap.m.Text({
               text: "{COUNTRYISO}"
               new sap.m.Text({
               text: "{STREET}"
               new sap.m.Text({
               text: "{PST_CODE}"
               new sap.m.Text({
               text: "{TELPHONE}"
               new sap.m.Text({
               text: "{EMAIL}"
  return new sap.m.Page({
  title: "Dealer Info",
  showNavButton: true, 
  navButtonTap:function(){ 
  app = sap.ui.getCore().byId("myApp"); 
  app.to("idfirst1"); 
  sap.ui.getCore().getElementById('CUSTOMER').setValue("");
  oModel.refresh();
  content: [ oTable
Index.htm
<!DOCTYPE HTML>
<html>
  <head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <script src="resources/sap-ui-core.js"
  id="sap-ui-bootstrap"
  data-sap-ui-libs="sap.m,sap.ui.commons"
  data-sap-ui-theme="sap_bluecrystal">
  </script>
  <!-- only load the mobile lib "sap.m" and the "sap_mvi" theme -->
  <script>
  sap.ui.localResources("uitest2");
  var app = new sap.m.App("myApp",{initialPage:"idfirst1"});
  var page = sap.ui.view({id:"idfirst1", viewName:"uitest2.first", type:sap.ui.core.mvc.ViewType.JS});
  var page1 = sap.ui.view({id:"idsecond1", viewName:"uitest2.second", type:sap.ui.core.mvc.ViewType.JS});
  app.addPage(page).addPage(page1);
  app.placeAt("content");
  </script>
  </head>
  <body class="sapUiBody" role="application">
  <div id="content"></div>
  </body>
</html>
Thanks
Shubhanshu

Similar Messages

  • How to get Input field value?

    Hi All,
    I have some problem in getting of input value from View to customcontroller.
    My problem is I have created a Input field in the view and if Iam giving the value to that field I can capture the value from View to customcontroller and send it as BAPI input.But My input filed is in the view Context.
    How can i capture InputFiled value from View to CustomController.
    Advance thanks
    Nageswara.
    Message was edited by: nageswar mandapati

    Thanks for your response Patrick,
    In my customcontrollerView all my BAPI mathods instances and execute methods are declared.All the attributes directly getting from model class.
    But I have two views , in first view I created a input field(for that i created valueAttribute in that context).
    Here I want give the conditions If  the input field is empty then directly call the execute method of BAPI.
    Otherwise give any input to the inputfiled then capture that value and send it input to BAPI from view to BAPI.
    In my customcontroller
    BAPI b = new BAPI();
    b.Param1();
    b.param2();
    and
    execute BAPI()
    I done like this.
    How can i capture the view input value how to send as a b.parama();
    Please guide me .
    Any snippests appriciate.
    Thanks
    nageswara.

  • How to pass input field value from one region to another ?

    What I am trying to do :
    I have one page with 1 region with one text field and an apply button and a report region.
    I want to be able to enter a value in the text field, click on apply and exploit this value in the source of the report region.
    Of course, I want the the value in the text field remains after the click on the apply button.
    What I cannot control with my try :
    1 the text field is always wiped off after the push on the apply button, no matter what kind of "do not clear the cache" setting I have found, and no matter the "take this value for this parameter" setting I have done every where I have found it.
    2 (but I think that this is related to 1) I cannot get working the conditional display of the report region on a NOT NULL condition of the above region text field.
    I have tried the code of the page 23 of the customertracking demo packaged apps, but the button properties shown are not the same than what I can find in my apps : I guess this is a difference in apex version normal feature.
    I think that what I am trying to achieve must be terribly simple but I cannot see it.

    Ok I have found out that it was now an interactive report that has to be done for this kind of situation, and that in my case, I needed to enable a detailled report.
    Now I have another question : one of my field is rich text : how to render it in my detailled report ?

  • How to verify input field value at run time

    Hi all,
    I have a input text field (username) on my jsf page and while entring username i have to verify that input provided by me is correct or not.
    For example-
    I started entering Test in username and error message occurs at the same time after validating from db.
    Can any body provide me the code snippet for the same.
    Thanks much,

    Hi,
    If I understood you correctly, you can set autosubmit="true" on af:inputText, and bind valueChangeListener to the method in backing bean where you can check whatever you need to check. That way, when inputText looses focus (or you press enter), the value will be submited to the server, where you can validate it.
    Pedja

  • How to get readonly text field value in backing bean?

    Below is my code in JSF.
    <h:inputText id="prodLine" value="#{fbackingBean.value}" required="true" styleClass="readOnlyField" readonly="true"/>
    This is a readonly field, and the value will been pass in by a pop up window. after the value had been passed in, i try to store the data which i had selected, but the value in readonly field (which show in above) return a null value.
    May i noe how can i get the readonly field value in backing bean? thanks!

    Why not keep track of the value in the backing bean? If it's a read only value set from a backing bean it should be simple to retrieve from a backing bean.
    I'm new to JSF, but one thing that I have figured out is to try to put everything in the backing beans possible and to do as little as possible within the JFS web page components.

  • How to refresh the input text value in backing bean

    hi all
    i want to know
    how to refresh the input text value in backing bean?
    i have tried this code ,but it doesnt work
    public void click(ActionEvent actionEvent) {
    tempConId.setValue("111111111111111");
    AdfFacesContext.getCurrentInstance().addPartialTarget(tempConId);
    sb know?
    Edited by: Joe Zou on 2012-4-6 下午9:11

    The code looks good.
    Here is a sample based on your use-case:
    InputTextSample.jspx:
    <af:form id="f1">
            <af:panelFormLayout id="pfl1">
              <f:facet name="footer">
                <af:commandButton text="Ok" id="cb1" partialSubmit="true"
                                  actionListener="#{InputTextSampleBean.onClick}"/>
              </f:facet>
              <af:inputText label="InputText" id="it1"
                            binding="#{InputTextSampleBean.myInputText}"/>
            </af:panelFormLayout>
          </af:form>
    InputTextSampleBean.java:
    import javax.faces.event.ActionEvent;
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    import oracle.adf.view.rich.context.AdfFacesContext;
    public class InputTextSampleBean {
        private RichInputText myInputText;
        public InputTextSampleBean() {
        public void setMyInputText(RichInputText myInputText) {
            this.myInputText = myInputText;
        public RichInputText getMyInputText() {
            return myInputText;
        public void onClick(ActionEvent actionEvent) {
            this.myInputText.setValue("1234");
            AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
            adfFacesContext.addPartialTarget(this.myInputText);
    }

  • Unable to capture Input field value on BSP page

    Hi
    I have copied ROS (SRM) standard application ROS_PRESCREEN3 into custom and added one input field .
    Now when user enters some value in it , i am not able to get that value in my back-hand code.
    I have treid the availble code on Fourm , its not working .
    Regards
    Raul

    Hi ,
    I am getting the input field values in my back hand using MVC .
    Regards
    Raul

  • Bind input field value to a variable fails

    Business need : The user wants to re-evaluate lines by a percentage value which he fills via his BI-IP screen.
    I created an INPUT FIELD in WAD and I am trying to link a variable value (initially created in BI-IP through transaction RSPLAN)
    to this INPUT FIELD.
    Whenever I fill the input field with a value, the value is not being transferred to the variable.
    Please help how to bind an INPUT field value to a variable to be transmitted to a planning function.
    I have made many trials but in vain.
    Please help.

    Hi.
    I will present my scenario (it works in my system). From this scenario you may "cut" implementation for your scenario.
    Lets sat I have an input fileld item and I want to read value (in my case numeric value) and pass this value to any planning sequence.
    1. Create in Bex variable (in my case it is formula variable) lets say Z_INPUT_VAR
    2. In WAD, when you executin planning sequence (lets say by pressing button execute) in command EXEC_PLANNING_SEQUENCE_SIMPLE define data binding.
    When you clicked data binding->variable input MANUALY your variable name (Z_INPUT_VAR) in popup window.
    3. In variable type select (ITEM_INPUT) type
    4. In web item select your input field item.
    This way you will pass inputed value to vaariable and planning sequence.
    Then in planning function you also may use VARV() to read value of Z_INPUT_VAR variable.
    Regards.

  • How can I pass field value betwen view in ICWC?

    Hi experts,
    I am new to this BSP programming. I have some requirements to modify standard ICWC in CRM 5.0
    Hope can get some advices and helps here.
    I have added a new field called <status> to context note SEARCHCUSTOMER in BupaSearchB2B view and also the same field name to context note CUSTOMER in BupaCreate view.
    I have added the field into both the HTM views and able to execute thru WebClient. However, I have one problem in passing the <status> value from BupaSearchB2B view  to the BupaCreate view when I click on the 'create' button.
    I do search and saw this thread How can I pass field value beetwen view in IC Web Client? , but i cant figure out how it works.
    Do I need to create the field <status> to context note CUSTOMER in BupaSearchB2B? Currently the context note does not have any attributes.
    Really appreciate for any help.
    Edited by: mervyn tay on Apr 7, 2009 11:42 AM

    solved by myself...
    code in the CREATE_ACCOUNT method.
            ev_entity->set_property( iv_attr_name = 'ZZICNO'
                                     iv_value = lv_icnum1 ).

  • How to take a field value in an array?

    how to take a field value in an array? its urgent........

    yaa... i know,  but actually we need to  multiply that number with some digit.
    take it this is way, if  i push it into another array, we have an array of digits but what i need is a all digit to be together to be multiplied to a number
    for example -
    if i push the numbers into new array say arr[];
    so i will have something like this. arr[1,2,3,4,5,6.......]  
    but i need  the new varaible should have value as 12345........   all concatenated.
    if i perform operation on array each digit will be multiplied individually.
    hope u got what m trying to sayy....
    Thanks for the prompt response..........

  • How to clear the variable value in session store?

    I'll try to build form for search. There are LOV and
    search button on form. When user don't select anything then push
    search button, I'd like the report to show query everything. I
    mean the report will show like condition where id like '%'.
    And I send variable between form to report by using session
    store.
    I select nothing in LOV but value that return by LOV is
    not null. It's in stead of old value of LOV.
    Please tell me.. How to clear the variable value in
    session store? I'd like to set it to null. If you have greater
    way to do like this, please tell me.
    Thank you.

    Please suggest on this..
    Thanks.

  • How to Assign a Field value to a Variable??

    Dear All,
    Kindly let me know, if <b>"HOW TO ASSIGN A FIELD VALUE TO A VARIABLE????"</b>
    Situation is, we have a Field (OBJK-TASER) in which 2 tables (SER01 & SER03) are stored. And we want to access names of the Tables which are there in the field(TASER) in  (OBJK) table  to a variable and then passing that variable to the sql query as a table name to get data accessed dynamicaly.

    try this
    select TASER from OBJK into table it_table.
    loop at it_table.
    select field1 field2 from (it_table-table) into table it_fields.
    endloop

  • To Display Input Field Value in Pop Up

    hii guys i want to display a input field value in a pop up dialog box.
    For this i have taken a input field, a pop up component and a button.
    In the dialog box of pop up element i have taken an output text which will display the value of input field.
    Everything seems to be work fine if i am giving the value to input filed at design time.
    But when i want to display the input field value entered at run time, the dialog box of pop up displays nothing..!!!

    Thank you so much Arun for your help.
    I did as you told me to do.
    But somehow i think i am not getting it right.
    I created a private String variable named value in my Bean Class and then i created its accessors..
    setValue and getValue..
    Then i set the value property of both input text and output text as #{package.BeanClass.value},
    but its not working...!!!
    Can you help me out with problem..!!

  • How to clear the selected values in the JCombobox

    Hi All,
    Can you please tell - how to clear the selected values in the JCombobox
    I have four dropdowns in my application, When I click "CLEAR" button, what ever the values selected in the four drop downs should go off and view as "SELECT" in all the dropdowns.

    In addition to the above you should also check out [Combo Box Prompt|http://www.camick.com/java/blog.html?name=combo-box-prompt] which makes it easy to display the default prompt.

  • How to validate input fields as the user is filling up a form with jQuery?

    Hello EA friends.
    Someone has experimented on how to validate input fields as the user is filling up a form with jQuery?, if the field is numeric and insert an A for example, an alert appears showing "insert a number" or not allowed to enter anything until a number is entered.
    Thanks and regards.
    Fer

    Hi Sudeshna.
    Sorry for not responding on time, how can I be included in this code?
    sym.setVariable("typeActivity", "input")
    var Element_1=document.createElement(typeActivity);
    $(Element_1).css({"text-align": "center"});
    //Answer
    sym.setVariable("Answer_1", "4");
    sym.$("box_1").append(Element_1)
    This code is on my creationComplete and it works fine.
    Would greatly appreciate your help.
    Regards.
    Fer García

Maybe you are looking for

  • Alternative database

    Is there anyonewho can help me to install the wli on a different database then those who are certified. For instance an informix or mysql database. We already imported the schema from an oracle to an mysql. The server boots but i get an sql exception

  • Applet + remote database + newbie

    Hi, Tired of microsoft randomly dumping the market making me rewrite applications each time they publish updated os,language etc...i finally (and really happily) surrender to java.... Here is my point : i'd like to create applet-based application tha

  • Web Premium CS4

    How could I download web premium CS4? I reinstall my operating system and I want to install CS4 again, but there is no link on Adobe website.

  • HT1349 how to remove apple id for imessage

    how to remove apple id for imessage

  • Exchange 2013 - High CPU utilization for the RpcClientAccess service

    Hi, I have a Exchange 2013 CU5 that is having extremely high CPU usage, mostly in the morning (logon time). If I restart the RpcClientAccess service it goes back to normal. Are there any of you guys having the same issue?