cancel
Showing results for 
Search instead for 
Did you mean: 

sapui5 : Set value textfield in a new detail page

former_member452749
Participant
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

irfan_gokak
Contributor
0 Kudos

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.

Answers (0)