-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have this zk item
<listitem
id="listitemsolicitudtransporte"
self="@{each=solicitudtransporte}"
value="@{solicitudtransporte}">
<custom-attributes solicitudtransporte="@{solicitudtransporte}"
xmlns:n="native" />
<listcell id="idsolicitudtransporte">
<label
value="@{solicitudtransporte.idSolicitud}" />
</listcell>
<listcell>
<label
value="@{solicitudtransporte.claveExterna}" />
</listcell>
<listcell>
<label
value="@{solicitudtransporte.fechaSolicitud}" />
</listcell>
<listcell>
<label
value="@{solicitudtransporte.motivoSolicitud}" />
</listcell>
<listcell>
<label
value="@{solicitudtransporte.peticionario}" />
</listcell>
<listcell>
<button id="boton_detalle"
sclass="btn-ecg-primary" iconSclass="fa fa-search"
style="margin-top:5px;margin-bottom:5px;font-size:15px;"
label="Detalle Solicitud" />
</listcell>
</listitem>
When i execute the application, the table has values in every row, but when i try to access to the content of the first cell, the listcell with id="idsolicitudtransporte" has label=null, but in my screen there is a number. I need to manipulate that number and i don't find how to obtain it.
In my controller the listcell has the @Wire anotation.
the zul code ...
<listcell id="idsolicitudtransporte">
<label value="@{solicitudtransporte.idSolicitud}" />
</listcell>
will create a listcell with a <label/>
child component
In this case listcell.getLabel()
is still null.
If you don't want to change your zul code you can access the label value via ((Label)listcell.getFirstChild()).getValue();
Or if you can change the zul code use the label property on listcell directly:
<listcell id="idsolicitudtransporte" label="@{solicitudtransporte.idSolicitud}" />
Then listcell.getLabel()
has a value to return.
Closing recommendation: since you are using data-binding I'd suggest to just access the value at your original java object by calling solicitudtransporte.getIdSolicitud()
... there's no need to access the zk components directly if you can get the data directly of your original object. Doing so the UI can change but your code accessing your data will still work -> decoupling model from presentation which is the goal of data binding.
Asked: 2018-09-24 16:59:01 +0800
Seen: 11 times
Last updated: Sep 26 '18
How to do ${c:l(@load(vm.name)} correctly?
how to specify line break in label. [closed]
Label text does not wrap in a "scrollview"
How to include a single special utf-8 character in a treecol label string?
Placeholder with phonemasking in IE11 Browser not working
how to change the style of portion of Label's value
How to get a label value for all the different international label file?