Skip to Content

Bind model to objectheader

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 23 at 09:38 AM

    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}" />
    
    Add comment
    10|10000 characters needed characters exceeded