Skip to Content
0

sapui5 : Set value textfield in a new detail page

Aug 20, 2017 at 08:50 AM

41

avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Irfan Gokak Aug 22, 2017 at 03:19 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded