Skip to Content

Problem passing value from view to dialog

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 17 at 03:42 AM

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

    Add comment
    10|10000 characters needed characters exceeded