-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4563404
By: yuzexu_zk
how to auto scroll listbox scrolling bottom
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4563430
By: alexdusty
I've a similar problem (at least I suppose): I'm dinamically adding rows to a grid and when the visible part is full the scrollbar appears on the grid but I'm unable to programmatically show the last row. i.e.: I always see the first N rows and I have to scroll down manually to see the new ones added.
Is the problem solvable?
Is there a programmatic way to bring the last row in the grid visible?
Thanks.
you can try
index.zul
<window border="normal" apply="ctrl.MyCtrl"> <grid height="50px"> <rows id="rows" /> </grid> <button label="add" id="addBtn" /> </window>
package ctrl; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.util.Clients; import org.zkoss.zk.ui.util.GenericForwardComposer; import org.zkoss.zul.*; public class MyCtrl extends GenericForwardComposer { private Rows rows; private static int count=0; @Override public void doAfterCompose(Component comp) throws Exception { // TODO Auto-generated method stub super.doAfterCompose(comp); } public void onClick$addBtn(){ count++; Row row =new Row(); row.appendChild(new Label("new"+count)); row.setParent(rows); Clients.scrollIntoView(row); } }
Thank you, Jimmy. It works great! :)
Ciao Jimmy,
Clients.scrollIntoView() seems does not work properly with Google Chrome (my test is with version 16.0.912.75 m).
My VBOX does not scroll down after that a new item was added.
Instead on Firefox,Opera and Explorer everything's gone ok.
Any suggestion is appreciated!
thanks
fds
Hi fds,
can you post your sample?
Ciao Jimmy,
... I want to thank you for your disponibility... but maybe I found the solution ... I have read in forum that with zk ver 5.0.4 has been introduced the "vlayout" element ... maybe it's the solution. I currently use a vbox with zk ver 5.0.1
grazie
fds
Ciao Jimmy,
during activity porting from zk ver 5.0.1 to zk ver 5.0.10
I had to intervene on all layout element (window etc) because they have changed shape and size.
why? I've done something wrong?
how can i avoid this extra-effort?
grazie
fds
Asked: 2007-10-11 09:42:14 +0800
Seen: 2,217 times
Last updated: Mar 27 '12