Skip to Content
avatar image
Former Member

Why is my data not getting displayed in the second field after selecting any item in dialog box

I am completely new to SAPUI5. I have two input fields which have got dialog box. I have also created a fragment. For the first input field,data is getting displayed after selecting from the dialog box. But for the second field the dialog box is not getting opened.

Below is the code for my controller.js

onInit: function() {
this.Json = new sap.ui.model.json.JSONModel("model/list.json");//getting the json file
this.getView().setModel(this.Json);//setting model to controller

onPress : function (oEvent) {
// create value help dialog
this.dialog.setModel(this.Json);//binding the list to the dialog box;


var oProject=this.getView().byId("sorg").setValue(evt.oSource.mAggregations._dialog.mAggregations.content[1].getSelectedItem().getTitle());


var cProject=this.getView().byId("dc").setValue(evt.oSource.mAggregations._dialog.mAggregations.content[1].getSelectedItem().getTitle());

Below is the code for my xml view:

<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m" controllerName="project.task1" xmlns:html=""
xmlns:l="sap.ui.layout" xmlns:f="sap.ui.layout.form">
<Page title="Title">
<f:SimpleForm layout="ResponsiveGridLayout" editable="true"
labelSpanXL="3" labelSpanL="3" labelSpanM="3" labelSpanS="10"
adjustLabelSpan="false" emptySpanXL="2" emptySpanL="2" emptySpanM="2"
emptySpanS="0" columnsXL="2" columnsL="2" columnsM="2">

<Label text="Sales Organization" labelFor="sorg" />
<Input id="sorg" showValueHelp="true" valueHelpRequest="onPress"
showSuggestion="true" suggestionItems="{/Collection}">
<core:Item text="{Name}" />
<Label text="Distribution Channel" labelFor="dc" />
<Input id="dc" showValueHelp="true" valueHelpRequest="onPresscc"
showSuggestion="true" />

<Label text="Division" />
<Input id="div" />
<Label text="Sales Group" showValueHelp="true"
valueHelpRequest="onPress" showSuggestion="true" />
<Input id="sg" />

<Label text="Plant" showValueHelp="true" valueHelpRequest="onPress"
showSuggestion="true" />
<Input id="plant" />
<Label text="Sales Office" />
<Input id="soff" showValueHelp="true" valueHelpRequest="onPress"
showSuggestion="true" />
<Label text="Sold to party" />
<Input id="stp" />
<Label text="Material Number" showValueHelp="true"
valueHelpRequest="onPress" showSuggestion="true" />
<Input id="id" />

Below is my code for fragment.xml:

description="{Designation}" />

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 24, 2017 at 08:07 AM

    Hi Kshitij,

    For Distribution Channel input box which has the id "dc" there is an event defined as onPresscc, however this event is not found in controller.js hence there is no SelectDialog box which is rendered.

    If this is not the issue, please provide the id of the input filed to investigate it further.



    Add comment
    10|10000 characters needed characters exceeded