cancel
Showing results for 
Search instead for 
Did you mean: 

Problem passing value from view to dialog

naotoxxx
Participant
0 Kudos

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 ????

Accepted Solutions (1)

Accepted Solutions (1)

Sharathmg
Active Contributor
0 Kudos

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

naotoxxx
Participant
0 Kudos

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

naotoxxx
Participant
0 Kudos

is this a kind of binding ?

Sharathmg
Active Contributor
0 Kudos

Yes. Dara binding and data mapping

Answers (0)