Skip to Content
0

Bind model to objectheader

Apr 19 at 02:08 PM

23

avatar image

Hi,

i try to do this

oDataModel.read("/DetallesSet?$filter=Sucursal eq " + "'" + sucursal + "'", {
	success: function(oData, response) {
	var oResults = oData.results;
	oModel.setData(oData.results);
	sap.ui.getCore().setModel(oModel, "Modelo");
	}
 });

this the result

this is my view:

<ObjectHeader title="Detalles de Cita"/>
	<Panel>
		<ObjectHeader
			id="header_info"
			title="{Modelo>/0/Cli_nombre}"
			number="{
				path: 'timestamp',
				formatter: '.formatter.fecha_f'
			}"
			numberUnit="{path: 'timestamp',
							formatter: '.formatter.hora_f'}" >
			<statuses>
				<ObjectStatus
					text="Observación: {Esp_servicio}"
					state="Success" />
				<ObjectStatus
					text="Sucursal: {Sucursal}"
					state="Success" />
			</statuses>
			<attributes>
				<ObjectAttribute text="Datos de Vehículo:  {DbmLicext}" />
			</attributes>
		</ObjectHeader>
		<Text text="{Cli_nombre}" />
	</Panel>

do i forgot something ? or miss ?

model.png (32.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

saurabh vakil Apr 23 at 09:38 AM
1

Your data binding does not contain the model name "Modelo". Change the below lines to include the model name.

text="Observación: {Modelo>Esp_servicio}"

text="Sucursal: {Modelo>Sucursal}"

<ObjectAttribute text="Datos de Vehículo:  {Modelo>DbmLicext}" />
<Text text="{Modelo>Cli_nombre}" />
Share
10 |10000 characters needed characters left characters exceeded