Displaying ArrayList of Google Datastore entities using Zk MVVM => bad output

asked 2018-03-19 23:49:11 +0800

cheikhhassancisse gravatar image cheikhhassancisse
11 1

updated 2018-03-21 15:08:17 +0800

cor3000 gravatar image cor3000
4466 2 7
ZK Team

I'm stuck with a problem for a couple of days now and I would need some help please.

I'm using:

Google App Engine with Google Datastore Zk 8.5 with the MVVM design I’m having an issue trying to display an arrayList in a grid like this:

<grid model="@load(vm.clientResultList)" >
    <template name="model">
        <row >

            <label value="@load(each.nom)"/>


It will display for each row something in this format : com.mypackage.entity.Client@3c3f784e

My Entity:

public class Client implements Serializable{

    private static final long serialVersionUID = -6603526588403725762L;
    private Long id;

    private String nom;
    private Sexe sexe;
    private Contact contact;

    private Ref<Mesures> mesures;

    public Client() {
        contact = new Contact();


    public Long getId() {
        return id;
    public void setId(Long id) {
        this.id = id;
    public String getNom() {
        return nom;
    public void setNom(String nom) {
        this.nom = nom;
    public Sexe getSexe() {
        return sexe;
    public void setSexe(Sexe sexe) {
        this.sexe = sexe;
    public Contact getContact() {
        return contact;
    public void setContact(Contact contact) {
        this.contact = contact;
    public Mesures getMesures() {
        return mesures.get();
    public void setMesures(Mesures mesures) {
        this.mesures = Ref.create(mesures);

My Service:

public List<client> getAll() { return ofy().consistency(Consistency.STRONG).load().type(Client.class).order("nom").list(); } My ViewModel:

public class RepertoireViewModel extends PageViewModel implements Serializable {

    private static final long serialVersionUID = -3656947251943967000L;

    private ListModelList<Client> clientListModel;

    private List<Client> clients;

    private List<Client> clientResultList;

    private String rechercheNom ="";

    private String rechercheTelephone="";

    public void init() {
        clients = ClientService.getInstance().getAll();
        clientResultList = clients;
        clientListModel = new ListModelList<>(clients);

    public void filter() {      
        clientResultList = clients.stream()  
                .filter(client -> (Strings.isBlank(rechercheNom) || (!Strings.isBlank(client.getNom()) && (client.getNom().toLowerCase().startsWith(rechercheNom.toLowerCase()) ||  client.getNom().toLowerCase().contains(" " + rechercheNom.toLowerCase())))) 
                && (Strings.isBlank(rechercheTelephone) || (!Strings.isBlank(client.getContact().getTelephone()) && client.getContact().getTelephone().toLowerCase().startsWith(rechercheTelephone.toLowerCase())))) 

    public ListModelList<Client> getClientListModel() {
        return clientListModel;

    public void setClientListModel(ListModelList<Client> clientListModel) {
        this.clientListModel = clientListModel;

    public List<Client> getClients() {
        return clients;

    public void setClients(List<Client> clients) {
        this.clients = clients;

    public List<Client> getClientResultList() {
        return clientResultList;

    public void setClientResultList(List<Client> clientResultList) {
        this.clientResultList = clientResultList;

    public String getRechercheNom() {
        return rechercheNom;

    public void setRechercheNom(String rechercheNom) {
        this.rechercheNom = rechercheNom;

    public String getRechercheTelephone() {
        return rechercheTelephone;

    public void setRechercheTelephone(String rechercheTelephone) {
        this.rechercheTelephone = rechercheTelephone;
delete flag offensive retag edit

2 Answers

Sort by » oldest newest most voted

answered 2018-03-22 17:42:42 +0800

cheikhhassancisse gravatar image cheikhhassancisse
11 1

Chill suggested me to proceed by elimination to find the bug.

I found out that the problem was from the use of xmlns="native" xmlns:u="zul" xmlns:x="xhtml" in grid element. After I have removed it, it works fine.

Thank you Chill for the support.

Best regards

link publish delete flag offensive edit

answered 2018-03-20 15:35:22 +0800

chillworld gravatar image chillworld flag of Belgium
5337 4 9

As your output show, ZK is calling the toString of the class Client.

Now for the fix, Possible it's copied code from somewhere and I suggest removing the line of the label and retype the line by yourself.
I had in the past also issue with copy/paste where everything looks correct but after doing a full retype it works.

If the problem still exist after this, please try to provide a fiddle example.


link publish delete flag offensive edit
Your answer
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

1 follower



Asked: 2018-03-19 23:49:11 +0800

Seen: 11 times

Last updated: Mar 22 '18

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