0

Listbox with model but window without id (philosophical?)

asked 2011-12-16 09:26:30 +0800

Marky gravatar image Marky flag of Spain
284 7
http://www.no/havent-doma...

Hi family!
I've got a problem with binder, mayby someone has been in a similar situation.
I have a window without id because I need open a few of these. But in the window I have a listbox with a model. To try wire binder, list and listbox, I put another apply in the panel who contents the listbox. All seems work, but when I load de binder, the listbox shows the empty message.

This is my zul code:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window  width="1250px" height="800px" position="center" sizable="false"  title="Detalle de usuario"  border="normal" closable="true" apply="org.sts.Pyme.PantallasZul.IncidenciasyTareas.Productividad.Detalle">
	<panel id="panelScroll" height="100%" apply="org.sts.Pyme.PantallasZul.IncidenciasyTareas.Productividad.DetalleListbox">
		<panelchildren>
			<listbox id="LBProductividad"  vflex="true" emptyMessage="No se han encontrado coincidencias" autopaging="true" sizedByContent="true"  span="1" mold="paging" pageSize="16" model="@{panelScroll$composer.listaBean}">
				<listhead sizable="true">
					<listheader id="LHCodigo" label="_Codigo" sort="auto(Codigo)" align="left"></listheader>
					<listheader id="LHCodigoMes" label="_CodigoMes" align="left" sort="auto(CodigoMes)"></listheader>
					<listheader id="LHMes" label="_Mes" align="left" sort="auto(LiteralMes)"></listheader>
					<listheader id="LHCodigoCentro" label="_CodigoCentro" align="left" sort="auto(CodigoCentro)"></listheader>
					<listheader id="LHCentro" label="_centro" align="left" sort="auto(LiteralCentro)"></listheader>
					<listheader id="LHCodigoArea" label="_CodigoArea" align="left" sort="auto(CodigoArea)"></listheader>
					<listheader id="LHArea" label="_Area" align="left" sort="auto(LiteralArea)"></listheader>
					<listheader id="LHCodigoSeccion" label="_CodigoSeccion" align="left" sort="auto(CodigoSeccion)"></listheader>
					<listheader id="LHSeccion" label="_Seccion" align="center" sort="auto(LiteralCentro)"></listheader>
					<listheader id="LHCodigoUsuario" label="_CodigoUsuario" align="left" sort="auto(CodigoUsuario)"></listheader>
					<listheader id="LHUsuario" label="_Usuario" align="left" sort="auto(LiteralUsuario)"></listheader>
					<listheader id="LHActividad" label="_Actividad" sort="auto(Actividad)"></listheader>
					<listheader id="LHActividadLiteral" label="_Actividad" align="left" sort="auto(LiteralActividad)"></listheader>
					<listheader id="LHnTareas" label="_nTareas" align="right" sort="auto(Tareas)"></listheader>
					<listheader id="LHUnidades" label="_Unidades" align="right"  sort="auto(Unidades)"></listheader>
					<listheader id="LHHorasRealizadas" label="_HorasRealizadas" align="right" sort="auto(HorasReales)"></listheader>
					<listheader id="LHHorasRealizadasFH" label="_HorasRealizadas(FH)" align="right" sort="auto(HorasReales)"></listheader>
					<listheader id="LHCoste" label="_Coste" align="right"  sort="auto(CosteReal)"></listheader>
					<listheader id="LHHorasPrev" label="_HorasPrevistas" align="right"  sort="auto(HorasPrevistas)"></listheader>
					<listheader id="LHCostePrev" label="_CostePrev"  align="right"  sort="auto(Costeprevisto)"></listheader>
				</listhead>
				<listitem  id="fila" self="@{each=ProductividadBean}">
					<listcell  label="@{ProductividadBean.Codigo}" ></listcell>
					<listcell label="@{ProductividadBean.CodigoMes}"></listcell>
					<listcell label="@{ProductividadBean.LiteralMes}"></listcell>
					<listcell label="@{ProductividadBean.CodigoCentro}"></listcell>
					<listcell label="@{ProductividadBean.LiteralCentro}"></listcell>
					<listcell label="@{ProductividadBean.CodigoArea}"></listcell>
					<listcell label="@{ProductividadBean.LiteralArea}"></listcell>
					<listcell label="@{ProductividadBean.CodigoSeccion}"></listcell>
					<listcell label="@{ProductividadBean.LiteralSeccion}"></listcell>
					<listcell label="@{ProductividadBean.CodigoUsuario}"></listcell>
					<listcell label="@{ProductividadBean.LiteralUsuario}"></listcell>
					<listcell label="@{ProductividadBean.Actividad}" ></listcell>
					<listcell label="@{ProductividadBean.LiteralActividad}" ></listcell>
					<listcell label="@{ProductividadBean.Tareas}" ></listcell>
					<listcell label="@{ProductividadBean.Unidades}"></listcell>
					<listcell label="@{ProductividadBean.HorasReales}" tooltiptext="@{ProductividadBean.HorasRealesFH}" ></listcell>
					<listcell label="@{ProductividadBean.HorasRealesFH}"></listcell>
					<listcell id="lcCosteReal"  label="@{ProductividadBean.CosteReal}" ></listcell>
					<listcell label="@{ProductividadBean.HorasPrevistas}" tooltiptext="@{ProductividadBean.HorasPrevistasFH}"></listcell>
					<listcell id="lcCostePrevisto"  label="@{ProductividadBean.Costeprevisto}" ></listcell>
				</listitem>
			</listbox>
		</panelchildren>
	</panel>
</window>
</zk> 

And this is the java code:

public class DetalleListbox extends GenericForwardComposer {
	private static final long serialVersionUID = 1L;
	private List<ProductividadBean> listaBean;
	private AnnotateDataBinder binder;
	
	public void doAfterCompose(Component comp) throws Exception{
		super.doAfterCompose(comp);
		binder = new AnnotateDataBinder(comp);
		listaBean = new ArrayList<ProductividadBean>();
		listaBean.addAll((List<ProductividadBean>) Executions.getCurrent().getDesktop().getAttribute("lista"));
		binder.loadAll();
	}
	
	public List<ProductividadBean> getListaBean(){
		System.out.println("We are binding list-->" + listaBean.size());
		return listaBean;
	}

well, if someone has any idea I will be greatfull for a long time :)
(other approach will be welcomed too)

thanks for all!
Regards, Marky

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2011-12-19 17:06:39 +0800

Marky gravatar image Marky flag of Spain
284 7
http://www.no/havent-doma...

updated 2011-12-20 07:53:47 +0800

Any suggestion? Any idea? All are welcomed.

Thanks, Marky.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-12-16 09:26:30 +0800

Seen: 155 times

Last updated: Dec 19 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More