Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8106709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:32:45+00:00 2026-06-06T00:32:45+00:00

I am using a grid and a class of java to render the data

  • 0

I am using a grid and a class of java to render the data to the rows, and everything works OK, the data is displayed into the grid, but the problem is when you click for second time the button that render the data to the grid, the data still there and the new data is added in the rows. I’m using Jboss 4.2

This is the RowRender Java Class:

import org.zkoss.zul.Label;
import org.zkoss.zul.Row;
import org.zkoss.zul.RowRenderer;

public class MyRowRenderer implements RowRenderer<Object> {
    @Override
    public void render(final Row row, final java.lang.Object data, int arg2)
            throws Exception {
        String[] ary = (String[]) data;
        for(int i=0;i<ary.length;i++){
            new Label(ary[i]).setParent(row);
        }
    }
}

This is the Part of the Java Class Listener:

public void onClick$generar(Event e) {
        try {
            if(fecha.getValue()==null){
                Messagebox.show("Ingresa una fecha valida MM-yyyy", "Error", Messagebox.OK, Messagebox.ERROR);
            }else{
                SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
                ffecha = formato.format(fecha.getValue()).substring(0, 7);
                String Order = orderby.getSelectedItem().getValue().toString();
                String Modo = modo.getSelectedItem().getValue().toString();
                inboxGrid.setModel(new ListModelList(getUpdatedData(ffecha, Order, Modo)));
            }
        } catch (ClassNotFoundException e1) {
            e1.printStackTrace();
        }
    }

This is the GRID in the index.zul

<grid id="inboxGrid" mold="paging" pageSize="15"
                rowRenderer="com.app.reports.MyRowRenderer"
                emptyMessage="Sin Registros!">
                <auxhead>
                    <auxheader colspan="5" class="topic">
                        REPORTE MENSUAL
                    </auxheader>
                </auxhead>
                <columns>
                    <column width="100px" label="CLAVE" align="center" />
                    <column label="SUCURSAL" align="center" />
                    <column width="100px" label="PAGINAS"
                        align="center" />
                    <column width="100px" label="EDO CUENTA"
                        align="center" />
                    <column width="100px" label="IMPRESION"
                        align="center" />
                    <column width="100px" label="MENSAJERIA"
                        align="center" />
                    <column width="100px" label="TOTAL" align="center" />
                </columns>
            </grid>

The first time showed 4 records, thats correct, only 4 records are in the database, the second time that the button “generar” is pressed showed 8 records(4×2), I try to put inboxGrid.getRows().getChildren().clear() on the button; but still showing the same behavior.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:32:46+00:00Added an answer on June 6, 2026 at 12:32 am

    It must be within your getUpdatedData(ffecha, Order, Modo)) function. This is nothing to do with ZK.

    Please check the number of items that getUpdatedData(ffecha, Order, Modo)) returns, my guess is that function will return 8 items the second time. Once you set the model ZK will only output the number of items in the list passed to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using grid bag layout for my Java application, but the problem is,
I'm using struts2-jquery grid. gridmodel in my action class is getting updated correctly. But,
I am using following class to show a grid like appearance with pagination on
My goal is to inline edit cells in a data grid using JQuery and
I have this sample MVC project using jQuery grid. There is only one problem
I am trying to do data binding in WPF on a data grid using
Trying to make a Grid Like this using java and I'm assuming a 2d
We're using Infragistics grid (most probably, we'll have 8.2 version at the end) and
i am using devexpress grid with edit functioality to update the records in the
I'm trying to create a dynamic grid using ExtJS. The grid is built and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.