Skip to Content

sapui5 : Set value textfield in a new detail page

Hi all,

i have a problem when i try to set a value for a TextField navigating from second page to third page (details).

In second page i set a variable "idLabelBp" (defined in third page), but in third page i'm not able to set the value selected (ex.0000002000) for label "Business Partner".

I see the value always empty, but in debugger i got it correctly.

Attached javascript code of second and third pages.

Is it possible to save the value selected in a local json model and get it in the third page?

oModelBpDetails = new sap.ui.model.json.JSONModel();

oModelBpDetails.setData(Line);

sap.ui.getCore().setModel(oModelBpDetails,"bpdetails");second-page.jpgthird-page.jpg

Could you help me please?

Thanks in advance.

Dario.

second-page.jpg (95.4 kB)
third-page.jpg (384.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 22, 2017 at 03:19 PM

    Hi Dario,

    Below code will resolve your issue.

    // In Second View
    var data = {value: "12345"};
    sap.ui.getCore().setModel(data,"bpdetails");
    
    // In Third View
    var data = sap.ui.getCore().getModel("bpdetails");
    this.getView("yourTextFldId").setValue(data.value);
    
    

    Regards,

    Irfan G.

    Add comment
    10|10000 characters needed characters exceeded