Skip to Content
0
Former Member
Jun 14, 2016 at 08:28 AM

How to take local data in a dialog box

22 Views

Hi Expert,

i have to take local data in a dialog box, after that i have to insert these dialog box data in a table

View Part

<l:Grid defaultSpan="L12 M12 S12" width="auto">

<l:content>

<f:SimpleForm emptySpanL="4" emptySpanM="4" columnsL="4" columnsM="4" class="editableForm" editable="true" id="SimpleFormChange354"

labelSpanL="3" labelSpanM="3" layout="ResponsiveGridLayout" maxContainerCols="5" minWidth="1024" title="Add New Language">

<f:content>

<Label text="Add New Language" class="sapUiSmallMarginBottom" design="Bold"/>

<Label id="Language" text="Please Select Language"/>

<Input class="sapUiSmallMarginBottom" editable="true" enabled="true" id="idEquipment" placeholder="Please provide valid Language"

showValueHelp="true" type="Text" valueHelpRequest="onOpenDialogEquipment"/>

<Label id="idFileUpload" text="Please select Flag" design="Bold"></Label>

<l:VerticalLayout>

<u:FileUploader id="idfileUploader" name="myFileUpload" tooltip="Upload your file to the local server" uploadComplete="handleUploadComplete"

width="400px"/>

<Button press="handleUploadPress" icon="sap-icon://upload" text="Upload File"/>

</l:VerticalLayout>

<Label id="Active" text="Active" class="sapUiSmallMarginBottom" design="Bold"/>

<CheckBox id="checkbox" text=""/>

</f:content>

</f:SimpleForm>

<Table id="idAttachmentTable" visible="false">

<columns>

<Column>

<Text text="Attachment"/>

</Column>

<Column>

<Text text=""/>

</Column>

</columns>

<items>

<ColumnListItem>

<cells>

<Link emphasized="true" href="" id="idLink" text=""/>

<Button icon="sap-icon://delete" id="idbtDelAtt" press="onDeleteAttachment" text=""/>

</cells>

</ColumnListItem>

</items>

</Table>

</l:content>

</l:Grid>

<footer id="detailFooter">

<Toolbar id="detailToolbar">

<content>

<ToolbarSpacer id="toolbarSpacer"></ToolbarSpacer>

<Button id="idAddLanguage" press="onclickAddLAnguage" text="Add Language" visible="true"/>

</content>

</Toolbar>

</footer>

Fragment Part

<Dialog contentWidth="30rem" title="Are you sure You want to Add Language">

<l:Grid width="100%" hSpacing="2" defaultSpan="L12 M12 S12">

<l:content>

<f:SimpleForm emptySpanL="4" emptySpanM="4" columnsL="4" columnsM="4" class="editableForm" editable="true" labelSpanL="3"

labelSpanM="3" layout="ResponsiveGridLayout" maxContainerCols="5" minWidth="1024" >

<f:content>

<HBox>

<VBox> <Label text="New Language" class="sapUiSmallMarginBottom" design="Bold" /> </VBox>

<VBox> <Label text="Hindi" class="sapUiSmallMarginBottom" design="Bold" /> </VBox>

</HBox>

<HBox>

<VBox><Label text="Flag" class="sapUiSmallMarginBottom" design="Bold" /> </VBox>

<!--<VBox> <Image densityAware="false" src=image/maps/india.png" width="50px" height="30px"/></VBox>-->

<VBox>

<Image densityAware="false" src="image/maps/india.png" width="50px" height="30px">

<layoutData>

<FlexItemData growFactor="0.3"/>

</layoutData>

</Image>

</VBox>

</HBox>

<HBox>

<VBox> <Label text="Active" class="sapUiSmallMarginBottom" design="Bold" /> </VBox>

<VBox> <CheckBox text="" selected="true" /> </VBox>

</HBox>

</f:content>

</f:SimpleForm>

</l:content>

</l:Grid>

<beginButton>

<Button text="Ok" press="onDialogOkButton" />

</beginButton>

<endButton>

<Button text="Close" press="onDialogCloseButton" />

</endButton>

</Dialog>

Controller Part

_getDialog : function (oEvent) {

if (!this._oDialog) {

this._oDialog = sap.ui.xmlfragment("com.borealis.fragments.popoverfragment",this );

this.getView().addDependent(this._oDialog);

}

return this._oDialog;

},

onclickAddLAnguage : function(oEvent){

if(this.getView().byId("idfileUploader").getValue()===""){

jQuery.sap.require("sap.m.MessageBox");

sap.m.MessageBox.show(

"Please enter all the details", {

icon: sap.m.MessageBox.Icon.ERROR,

title: "ERROR",

actions: [sap.m.MessageBox.Action.OK],

onClose: function(oAction) {

}

}

);

}

else

{

this._getDialog().open();

}

},

onDialogOkButton: function(oEvent)

{

this._getDialog().close();

var app = this.getView().getParent();

app.to("idapp--idMaintainLanguages");

},

onDialogCloseButton : function(oEvent)

{

this._getDialog().close();

}

});

Output Screen

Note: inside a dialog box data is hard coded

Many Thanks,

Ayushi

Attachments

l1.png (19.7 kB)
l2.png (12.9 kB)
l3.png (18.1 kB)