Google App Engine - Window Freezes
If you outComment this line:
// ((WinMediumBasico) getFellow("Pesquisa").getParent()).
setMedium(MediumDAO.getInstance().
findById(((Medium) lbMedium.getSelectedItem().getValue()).getId()));
does the window closes?
PS: It's important to know what zk version do you use.
Hi terrytornado,
I´m using ZK 5, the setMedium is a method from parent window, to update parent window with selected record.
I did
//((WinMediumBasico) getFellow("Pesquisa").
((WinMediumBasico) getParent()).setMedium(MediumDAO.getInstance().
findById(((Medium) lbMedium.getSelectedItem().getValue()).getId()));
this.onClose();
it didn´t close anyway
Hi
may I ask, everything works fine in eclipse, do you mean when you run ZK with GAE on local, it work, but when you put online, it fail to close dialog ??
it's strange, if you run ZK and GAE correctly on local, it should be the same when you put online.
That is what happens. samchuang
Different JAVA versions?
@norberto108
Hi, that's very strange. the local environment that GAE provide should be the same.
And we could debug on local GAE environment, if this's what happened, I don't have a clue, maybe you could post on GAE's forum?
It seems that the modal window is not receiving any events. I´ve tried some
btOk.addEventListener("onClick", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
log.info("btOk.onClick");
}
});
this.addEventListener("onClick", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
log.info("Pesquisa.onClick");
}
});it never fires. When i put onClose at onCreate event it works. On Create On Close.
@norberto108
does this fails on local too, or just on GAE server??
Just on GAE server. I´d put into GAE forum too.
This Warning appear after pesquisa.doModal
/zkau java.lang.RuntimeException: java.io.NotSerializableException: br.org.valedoamanhecer.comum.Pesquisa$1 at com.google.apphosting.runtime.jetty.SessionManager.serialize(SessionManager.java:361) at com.google.apphosting.runtime.jetty.SessionManager.createEntityForSession(SessionManager.java:341) at com.google.apphosting.runtime.jetty.SessionManager$AppEngineSession.save(SessionManager.java:162) at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:41) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) ...
java.io.NotSerializableException: br.org.valedoamanhecer.comum.Pesquisa$1
Look at this class and add the Serializable Interface.
Yes, i did it before, now i am working in ZK.3.6.3
public class Pesquisa extends Window implements AfterCompose, Serializable {
The code inside window class uses a ListitemRenderer class i´ve modified it and the error has changed
public void onCreate$Pesquisa() {
List<Medium> list = (List<Medium>) params.get("model");
list.size();
lbMedium.setModel( new ListModelSet(list));
if( list.size()>0) lbMedium.setSelectedIndex(0);
lbMedium.setItemRenderer(new MediumListitemRenderer());
}
public class MediumListitemRenderer implements ListitemRenderer, Serializable {
@Override
public void render(Listitem listItem, Object data) throws Exception {
Medium medium = (Medium) data;
new Listcell(medium.getNome()).setParent(listItem);
new Listcell(medium.getMediunidade()).setParent(listItem);
new Listcell(medium.getNomeMae()).setParent(listItem);
listItem.setValue(medium);
}
}
now looks like some problem in list datastore entities
java.lang.RuntimeException: java.io.NotSerializableException: org.datanucleus.store.appengine.query.DatastoreQuery$2 at com.google.apphosting.runtime.jetty.SessionManager.serialize(SessionManager.java:361)
Does your Medium Pojo implements the Serializable Interface?
Yes, it does
@PersistenceCapable(identityType=IdentityType.APPLICATION, detachable="true")
public class Medium implements Serializable {
public Medium() {
UserService userService = UserServiceFactory.getUserService();;
User user = userService.getCurrentUser();
setQuemDigitou(user.getNickname());
}
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;
@Persistent
private String cod;
@Persistent
private String codNovo;
@Persistent
private String nomeTemplo;
@Persistent
private String nomeAdjunto;
@Persistent
private String nome;
@Persistent
private String nomeLowerCase;
@Persistent
private String quemDigitou;
@Persistent
private String mediunidade;
@Persistent
private String sexo;
@Persistent
private String nomePai;
@Persistent
private String nomeMae;
@Persistent
private Date dataNascimento;
@Persistent
private String natural;
@Persistent
private String ufNatural;
public String getUfNatural() {
return ufNatural;
}
public void setUfNatural(String ufNatural) {
this.ufNatural = ufNatural;
}
@Persistent
private String estadoCivil;
@Persistent
private String profissao;
@Persistent
private String endereco;
@Persistent
private String cidade;
@Persistent
private String ufEndereco;
public String getUfEndereco() {
return ufEndereco;
}
public void setUfEndereco(String ufEndereco) {
this.ufEndereco = ufEndereco;
}
@Persistent
private String cep;
@Persistent
private String telefone;
@Persistent
private String mentor;
@Persistent
private String princesa;
@Persistent
private Date dataIngresso;
@Persistent
private Date dataEmplacamento;
@Persistent
private Date dataIniciacao;
@Persistent
private Date dataElevacao;@terrytornado
@samchuang
I fixed the problem. I was trying to pass a list as a map parameter to Executions.createComponent. Just stoped to do this and it works.
I think it should be possible in the future, or am i doing something still wrong ?
Thanks for your help
Have a try with overhanding the whole controller as object in your map.
Read them back and have control over his components/properties.
best
Stephan
PS: In our Zksample2 app we overhanded controlers or a single listbox very well. But it's not tested on GAE.
Have you a download link to GAE for local testing?
ZK - Open Source Ajax Java Framework
Hello,
I am creating a search window with this code, everything works fine in eclipse, but when i put it online
Window pesquisa = (Window) Executions.createComponents("/principal/comum/pesquisa.zul",winMain, map); pesquisa.setParent(this); pesquisa.doModal();pesquisa.zul uses a listbox for browse records,
when i finally click on OK button
((WinMediumBasico) getFellow("Pesquisa").getParent()). setMedium(MediumDAO.getInstance(). findById(((Medium) lbMedium.getSelectedItem().getValue()).getId())); this.onClose();it don´t close the modal dialog.
public Medium findById(Key id) { PersistenceManager pm = PMF.get().getPersistenceManager(); Medium medium = null; try { medium = pm.getObjectById(Medium.class,id); } catch (NoResultException nr) { nr.printStackTrace(); } catch (Exception ex) { ex.printStackTrace(); } finally { pm.close(); } return medium; }I am not able to debug it, does someone can help ?