Skip to Content
0

Problem passing value from view to dialog

May 16 at 09:33 PM

48

avatar image

Hi, i have some time trying to pass a value from my view to my dialog

this is my view element

<Input width="100%" placeholder="XXXXXXXX-X" id="irut"/>

and this is my dialog view:

<Dialog
      id="dialogCrear"
      title="{i18n>TituloDialogUsuario}">


	      <f:SimpleForm 	id="formCrear"
				editable="false"
				layout="ResponsiveGridLayout"
				title="Prospecto"
				labelSpanXL="3"
				labelSpanL="3"
				labelSpanM="3"
				labelSpanS="12"
				adjustLabelSpan="false"
				emptySpanXL="4"
				emptySpanL="4"
				emptySpanM="4"
				emptySpanS="0"
				columnsXL="1"
				columnsL="1"
				columnsM="1"
				singleContainerFullSize="false">
	<f:content>
																
<Label text="Rut"/>
<Input width="100%" placeholder="XXXXXXXX-X" id="crearRut" editable="false"/>

my controller

		onAbrirCrear : function() {
	         var oView = this.getView();
	         var oDialog = oView.byId("dialogCrear");
	         var previewRut	= oView.byId("irut").getValue();
			 var rut = this.byId("crearRut");
			 		 
			 rut.setValue(oDatos.rut)
	         
	         // create dialog lazily
	         if (!oDialog) { // create dialog via fragment factory
	            oDialog = sap.ui.xmlfragment(oView.getId(), "crm.prospecto.view.crearProspecto", this);
	            oView.addDependent(oDialog);
	         }
	         oDialog.open();
		},

so when i open my dialog should take the value from my view and set to my dialog input but instead i get an error

Uncaught TypeError: oDatos.pais.setValue is not a function

what am i doing wrong ????

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Sharath M G May 17 at 03:42 AM
0

use the model to pass the value. Then the value stays in model from wherever you access it.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

thanks! Sharath M G i created a model in my component and send to my view a put both view and dialog values the same

0

is this a kind of binding ?

0

Yes. Dara binding and data mapping

0