-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
My form.zul has a listbox that load data from db using AnnotateDataBinder and works perfectly.
This form has also a new button that opens a new zul (execution.createComponents("/desempeno.zul", win, map);)
In desempeno.zul i add a new record to my db and when the record is saved i call the onClose() event.
how can i update the listbox in the form.zul when i call the onClose() event in the desempeno.zul window?
Thanks
Luis Alberto Vélez
Hi Luis.
You could refresh the model programatically, here just a way to do it...
in your form.zul for example...
... <listbox id="listaexperiencias" model="@{experiencias, load-after='btnrefresh.onClick'}" rows="5" width="268px" height="99px"> <listhead sizable="true"> <listheader label="Puesto" /> <listheader label="Empresa"/> </listhead> <listitem self="@{each=experiencia}" value="@{experiencia}"> <listcell label="experienciaselected" value="@{experiencia.experienciaPK.idexperiencia}" visible="false"/> <listcell label="@{experiencia.puesto}"/> <listcell label="@{experiencia.empresa}"/> </listitem> </listbox> ... <!-- btnrefresh just to catch a refresh event (onClick really) form modal child window --> <button id="btnrefresh" label="refrescar" visible="false"/> ...
... public void onClick$btnterminar(){ //or in your case the onClose() action //at parent window reload listaexperiencias box sending onclick event to the btnrefresh button, then detach the child window... Events.sendEvent(new Event("onClick", (Button)((Window)ligarWin.getParent()).getFellow("btnrefresh") )); ligarWin.detach(); } ...
that should do the trick.
Mike Lara
Mike, gracias por tu ayuda.
Veo que eres hispano, si es posible me gustaria contar con tu apoyo en alguno temillas de ZK, claro si es posible.
Por cierto, sería bueno iniciar un foro en español, que te parece?
Nuevamente, gracias.
Luis Velez
De nada Luis,
Saludos y pues solo estaba tratando en algún rato libre de regresar un poco de la ayuda que también he recibido en el foro.
Si. Sería bueno iniciar un foro en español, si te interesa también hay un grupo en linkedin en esta liga donde puedes compartir comentarios respecto al framework. Suerte y estamos en contacto.
Mike Lara
Hola, soy luiggi hispano, si existe un foro en español, les agradecería mucho que me indiquen.
En el tema anterior intentaba decir que tengo una pantalla.zul para subir una imagen y el código antes mencionado funciona correctamente si lo pruebo en mi maquina local, pero al publicarlo al mundo en un servidor tomcat con debian server, al subir la imagen me retorna un error como si no localizara la imagen.
mensaje al subir la foto: Not an image asdf.jpg
Hallo, wie geht es euch? Ich könnte auch auf Deutsch antworten, mach ich aber nicht :)
As long as there is no spanish forum it would be nice to keep it english, since otherwise only a limited group of persons can help you :)
You could add an Refresh - Eventlistener to form.zul
myWindow.addEventListener("onRefresh", new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {
refresh();
}
});
and on desempeno.zul
Events.postEvent("onRefresh", this.self, null);
this.self.detach();
Asked: 2011-05-09 10:18:36 +0800
Seen: 633 times
Last updated: Aug 26 '16