cancel
Showing results for 
Search instead for 
Did you mean: 

Created CURD operation example in ui5 get fragment id but didn't get fragment input id

krushii
Explorer
0 Kudos

created curd operation examle in ui5 , when click on add button fragment goes open successfully

but when i fill add form fields and click on save button nothing goes happen. want to display data intered in fragment on main screen

xml code:

<Table items="">

<headerToolbar>

<Toolbar>

<Text text="CURD Operation's Example under process" />

<ToolbarSpacer></ToolbarSpacer>

<Button icon="sap-icon://add" text="Add Student" press="addStudent" />

</Toolbar>

</headerToolbar>

<columns>

<Column>

<Text text="Name"/>

</Column>

<Column>

<Text text="Gender"/>

</Column>

<Column>

<Text text="Date of Birth"/>

</Column>

<Column hAlign="Center">

<Text text="Father Nane"/>

</Column>

<Column hAlign="Right">

<Text text="Contact Number"/>

</Column>

<Column hAlign="Right">

<Text text="Action"/>

</Column>

</columns>

<items>

<ColumnListItem>

<cells>

<ObjectIdentifier title=""/>

<Text text=""/>

<Text text=""/>

<Text text=""/>

<Text text=""/>

<HBox justifyContent="End">

<Button icon="sap-icon://edit" press="EditStudent"></Button>

<Button icon="sap-icon://delete" press="DeleteStudent"></Button>

</HBox>

</cells>

</ColumnListItem>

</items>

</Table>

here is my fragment:

<Dialog>

<f:SimpleForm>

<f:content>

<core:Title text="Basic Information"/>

<Label id="idname" text="Name"/>

<Input id="fragmentinput" placeholder="First Name" />

<Input placeholder="Middle Name">

<layoutData>

<l:GridData span="L3 M3 S4" />

</layoutData>

</Input>

<Input value="" placeholder="Last Name">

<layoutData>

<l:GridData span="L3 M3 S4"/>

</layoutData>

</Input>

<core:Icon src="sap-icon://person-placeholder" size="3rem" />

<Label id="idgen" text="Gender"/>

<RadioButton text="Female"/>

<RadioButton text="Male"/>

<Label id="iddob" text="Date of Birth"/>

<!--<DatePicker value="">

<layoutData>

<l:GridData/>

</layoutData>

</DatePicker>-->

<DatePicker value=""/>

<Label id="idfname" text="Father Name"/>

<Input value="" placeholder="Enter Father Name">

<layoutData>

<l:GridData/>

</layoutData>

</Input>

<Label id="idphone" text="Contact No"/>

<Input value="" placeholder="Enter Contact Number">

<layoutData>

<l:GridData/>

</layoutData>

</Input>

<Label text=""/>

<Button text="Save" type="Accept" press="saveBtnPress"/>

<Button text="Cancel" type="Reject" press="cancelBtnPress"/>

</f:content>

</f:SimpleForm>

</Dialog>

here is my controller code

onInit: function() {},

addStudent: function(oEvent) {

Fragment.load({

name: "root.fragments.form",

id: "fragmentid",

controller: this

}).then(function name(oFragment) {

this._oValueHelpDialog = oFragment;

this._oValueHelpDialog.open();

}.bind(this));

},

cancelBtnPress: function() {

this._oValueHelpDialog.close();

},

saveBtnPress: function(oEvent) {/*

var fragment = this.getView().createId("idfra");

var oInput = this.byId(fragment,"fragmentinput");*/

}

Accepted Solutions (0)

Answers (1)

Answers (1)

priteshpatel65
Active Participant
0 Kudos

Hi krushii

Please try below code for get input value.

this.getView().byId("fragmentinput").getValue();
sap.ui.getCore().byId("fragmentinput").getValue()