Instant textbox - cursor moves and input is not accepted

asked 2019-06-25 15:33:13 +0800

cgrill gravatar image cgrill


I am using version I have a instant textbox with an onChange listener inside the auxheader of a grid. Sometimes, when I change the value of the textbox I am missing the input. Also the cursor is moved one char back unrequested.

<grid height="600px" width="1002px" model="@load(vm.scheduleList.scheduleObjectList)" emptyMessage="No Schedules found"
                            mold="paging" pageSize="11">
                            <auxheader colspan="1">
                                <span sclass="z-icon-filter"/>
                                <textbox instant="true" width="100px" onChange="@command('changeLineFilter', filter=event.value)"/>
                            <auxheader colspan="1">
                                <span sclass="z-icon-filter"/>
                                <textbox instant="true" width="100px" onChange="@command('changeEndFilter', filter=event.value)"/>
                            <auxheader colspan="1">
                                <span sclass="z-icon-filter"/>
                                <textbox instant="true" width="150px" onChange="@command('changeZoneFilter', filter=event.value)"/>
                            <auxheader colspan="3">
                            <column ...

Here the implementation of the model.

public void changeLineFilter(@BindingParam("filter") String lineFilter) {
    logger.error("Start changed LineFilter:"+lineFilter);
    logger.error("Finished changed LineFilter:"+lineFilter);

public void changeEndFilter(@BindingParam("filter") String endFilter) {
    logger.error("Start changed EndFilter:"+endFilter);
    logger.error("Finished changed EndFilter:"+endFilter);

public void changeZoneFilter(@BindingParam("filter") String zoneFilter) {
    logger.error("Start changed ZoneFilter:"+zoneFilter);
    logger.error("Finished changed ZoneFilter:"+zoneFilter);

In the output of the logger I see that some chars entered into the textboxes are sometimes not accepted. Sometimes the cursor moves one position back and the input is taken on the wrong position.

Does anyone have the same problem? Is there something how I can fix that?

Best regards,


delete flag offensive retag edit


The issue can be reproduces on the online demo under https://www.zkoss.org/zkdemo/grid/data_filter Enter "12" several times in "Top Nutrients" and sometimes the "2" is not accepted.

cgrill ( 2019-06-25 16:19:38 +0800 )edit

1 Answer

Sort by » oldest newest most voted

answered 2019-06-26 10:54:29 +0800

cor3000 gravatar image cor3000
5262 2 7
ZK Team

updated 2019-06-26 10:55:58 +0800

This is the default behavior in grid, and listbox, if the model is replaced @NotifyChange("scheduleList") and more than 10 items change the whole grid, listbox is invalidated and re-rendered, including the headers and potentially included filter text boxes.


You can override the default invalidation threshold by setting the library property org.zkoss.zul.invalidateThreshold or custom-attribute.

e.g. in your zul:

<grid ...>
  <custom-attributes org.zkoss.zul.invalidateThreshold="1000"/>

Since replacing the rows one by one might be slower, please also observe the potential performance impact to your application.

Also please consider using a ListModelList and replace the contents in the model instead of replacing the whole model for each change. This is especially beneficial, in case only a few elements are added or removed.

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




Asked: 2019-06-25 15:33:13 +0800

Seen: 7 times

Last updated: Jun 26 '19

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