cancel
Showing results for 
Search instead for 
Did you mean: 

I Have Created table in fragment it's Open fine but not Close?

S0024873964
Explorer
0 Kudos

Dear Developers,

i Have created fragment, it's open fine but close button for event is not trigger please suggestion me.

i wrote this code.

  	if (!this._parentoDialog) {
					// var that = this;
						this._parentoDialog = sap.ui.xmlfragment("hrapplication.view.createfinalpos", this);
					parent.oviw.addDependent(this._parentoDialog);
				}
					var oJsonModel = new sap.ui.model.json.JSONModel(parent.oviw.arry);
				var	table=sap.ui.getCore().byId("idProductsTablefinalposition");
					table.setModel(oJsonModel);
	 
				// toggle compact style
				jQuery.sap.syncStyleClass("sapUiSizeCompact", parent.oviw, this._parentoDialog);
				this._parentoDialog.open();    
View Entire Topic
0 Kudos

Hi,

Please check the below code and link for Opening and Closing of Fragment.

onOpenDialog : function () {	
		var oView = this.getView();	
		var oDialog = oView.byId("helloDialog");			// create dialog lazily			
                if (!oDialog) {				// create dialog via fragment factory				
                oDialog = sap.ui.xmlfragment(oView.getId(), "sap.ui.demo.wt.view.HelloDialog", this);				// connect dialog to view (models, lifecycle)	
	oView.addDependent(oDialog);			
} 	
	oDialog.open();		
}, 		

onCloseDialog : function () {			
this.getView().byId("helloDialog").close();	
}

Please let me know if you are getting any error.

Regards,

Somesh

S0024873964
Explorer
0 Kudos
Dear Somesh Thank you for quick response. i have already tried onCloseDialog is Not Trigger

fragment.xml
	<beginButton>
	<Button text="Close" press="onCloseDialog" />
	</beginButton>


Controller.js

 onCloseDialog: function() {
	debugger;
this.approvalDialog.close();
  },