0

Scrollbar in Listbox moves to last selected item

asked av亚洲天堂2017无码av岛国无码Av免费观看利率之争白热化 土耳其央行行长遭埃尔多安解职

發布時間︰

此舉簡直像拿破侖的戰役一樣大膽,也像拿破侖的戰役一樣危險。然而機緣 巧合總樂于為冒險的賭徒助一臂之力。連卡尼茲自己也沒有預料到的一種情 況,悄悄地為他鋪平了道路,這就是那個非常殘酷可是又極其自然的事實︰ 這個可憐的女繼承人在她到達她繼承到的這個府邸的最初幾小時里已經受了 那麼多屈辱,遇到那麼多仇恨,以致她自己只有惟一的願望,那就是︰離去, 趕快離去!奴顏婢膝之徒看到他們的鄰人好像駕著天使的翅膀從同樣沉重的 徭役中脫身出來,于是滿懷嫉恨,再也沒有比這表現得更卑劣的了︰渺小的 心靈容易原諒一個君王獲得令人頭暈目眩的財富,卻不容易原諒和他們受到 同樣重壓的同命運的難友獲得微不足道的一點自由。開克斯法爾伐府邸里的 僕役看到,恰巧是這個北德的女人如今突然之間要做開克斯法爾伐莊園的主 人,從而也將成為他們的女主人,實在難壓心頭的怒火。他們清清楚楚地記 “這是受害者辭別屠夫的場面。可是卡尼茲卻覺得,他這一斧子砍下去 是打在他自己頭上。他迷迷糊糊地站了幾分鐘,眼楮直勾勾地瞪著空曠無人 的飯店大廳。最後,街上熙來攘往的人流把他裹走,他不知道身往何處。從 來沒有一個人這樣看過他,目光里充滿了人情,充滿了感激。從來沒有一個 人這樣跟他說過話。他的耳邊不由得又響起了‘我非常感謝您’這句話的聲 音;可是他恰好把這個人搶了,正好把這個人欺騙了!他一再停下腳步,拭 去額上沁出的汗水。他像夢游似的沿克爾特納大街踉踉蹌蹌地走著,步履蹣 跚,漫無目的;突然在街上的那家規模很大的玻璃商店前,在櫥窗的鏡子里 迎面看到了他自己的臉,他目不轉楮地凝視自己,就像人家仔細端詳登在報 上的一個罪犯的照片,想看出來,在這個人的面部輪廓里那種罪犯的特征究 竟在哪里,是在那翹起來的下巴上,凶惡的嘴唇上,還是在冷酷的眼楮里。av “然而她還是感激地抬起眼來看他。不知是鮮花的反光還是涌起的熱血亚洲天堂2017无码av 在養馬場,我們當然受到特別的歡迎。附近的小伙子顯然已經听到我們 突然他停住腳步。“我干脆把實話說給您听吧——我根本沒有取得什麼 實質性的進展,沒有取得決定性的成效,問題的關鍵不就是在這兒嗎!我在 她身上來回試驗,來回折騰,活像個澡堂里的按摩師,漫無目的,徒勞無功。 到現在為止,我毫無進展。”岛国无码Av免费观看 狠狠地罵他一聲。接著她突然跳起來,跑出房去。 “這是我們的朋友一生中最可怕的瞬問。直到現在他才懂得他于了件傻 2019-07-29 16:02:29 +0800

anvibb gravatar image anvibb
3 1

Hi, guys! I have some trouble with scrollbar in the Listbox component - when I set the model to it and selecting several listitems, the scrollbar moves down to the last selected item, but I need to keep it on top. We've used simple zul as a view:

<zk>
<window xmlns="http: //www.zkoss.org/2005/zul" xmlns:xsi="http: //www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http: //www.zkoss.org/2005/zul http: //www.zkoss.org/2005/zul/zul.xsd"
        use="com.otr.sufd.zkossforms.table.SetDocColumnsView"
        closable="true" border="normal" title="Customize columns" ctrlKeys="" height="400px" width="300px">
    <borderlayout width="100%" height="100%">
        <center>
            <listbox id="table" checkmark="true" vflex="true" fixedLayout="true" multiple="true" width="100%">
                <listhead>
                    <listheader align="left">Column title</listheader>
                </listhead>
            </listbox>
        </center>

        <south size="36" autoscroll="true">
            <toolbar align="end">
                <button label="OK" id="okButton" height="24px" width="75px" mold="os"/>
                <button label="Reset" id="resetButton" height="24px" width="75px"/>
                <button label="Cancel" id="cancelButton" height="24px" width="75px" mold="os"/>
            </toolbar>
        </south>
    </borderlayout>
</window>

</zk>

In SetDocColumnsView I filled Listbox by model and make some AfterCompose actions:

public void configureView(List<? extends HeaderElement> columns, Set<String> hiddenIds) {
    setSizable(true);

    final ListModelList tableModel = new ListModelList(columns);
    tableModel.setMultiple(true);
    table.setModel(tableModel);
    table.renderAll();
    for (int i = 0; i < columns.size(); i++) {
        final HeaderElement column = columns.get(i);
        if (column != null) {
            final Listitem listitem = table.getItemAtIndex(i);
            listitem.setLabel(column.getLabel());
            final String columnId = column.getId();
            listitem.setValue(columnId);
            listitem.setSelected(!hiddenIds.contains(columnId));
        }
    }
}
@Override
public void afterCompose() {
    table = (Listbox) getFellow("table");
    final Button okButton = (Button) getFellow("okButton");
    //adds some listeners to buttons
    addForward(Events.ON_OK, okButton, Events.ON_CLICK);
    addForward(Events.ON_CANCEL, cancelButton, Events.ON_CLICK);
    okButton.setFocus(true);
}

And then I show the dialog window by this code:

final SetDocColumnsView dialog = UIUtils.loadComponent(SetDocColumnsView.getUrl());
dialog.configureView(columnList, hiddenIds);
dialog.setPage(getPage());
dialog.doHighlighted();

I've tried to use some advice given in other threads, such as:

Clients.scrollIntoView(table.getItemAtIndex(0))

or call JS function inside my configureView method:

Clients.evalJavaScript("zk.Widget.$('" + dialog.table.getUuid() + "')._scrollToIndex(0);")

or keep all listitems what I need to select in a different Set and post to setSelectedItems method of Listbox, but everything is without success. Also, I've tried to debug a JS function _doScroll in Listbox.js but I don't figure out from where it has been called :(

I will be very appreciated if someone can help me with this problem.

Best regards, Roman

delete flag offensive retag edit

Comments

if your example is simple, please paste it into http://zkfiddle.org/ so that anyone can have a look directly, this increases your chances of getting a response quickly

cor3000 ( 2019-07-29 18:30:05 +0800 )edit

Yeah, I made simple zkfiddle example - http://zkfiddle.org/sample/1a44bo/1-scrollbar-in-listbox-moves-to-last-selected-item which reproduces the problem

anvibb ( 2019-07-30 21:16:58 +0800 )edit

4 Answers

0

answered 2019-08-01 09:12:39 +0800

hawk gravatar image hawk
2415 1 5
http://hawkphoenix.blogsp... ZK Team

Thanks for the zkfiddle example. Remove renderAll() can solve scrolling position issue. Listbox by default will render necessary Listitem for visible range, you don't need to call renderAll() which will enforce rendering all Listitems which is unnecessary for most cases. Please refer to http://zkfiddle.org/sample/1a44bo/2-scrollbar-in-listbox-moves-to-last-selected-item#source-2

link publish delete flag offensive edit
0
link publish delete flag offensive edit
0

answered 2019-07-31 21:05:33 +0800

anvibb gravatar image anvibb
3 1

updated 2019-08-01 09:01:48 +0800

hawk gravatar image hawk
2415 1 5
http://hawkphoenix.blogsp... ZK Team

Thank you for the response, hawk!

I tried to change the selection of items as you advised, but it doesn't solve my problem - when I select several items via ListModeList.setSelection, the scrollbar moves down to the last item. I made an example of that behavior in zkfiddle - http://zkfiddle.org/sample/1a44bo/1-scrollbar-in-listbox-moves-to-last-selected-item

link publish delete flag offensive edit
0

answered 2019-08-01 17:45:43 +0800

anvibb gravatar image anvibb
3 1

Removing renderAll() is helped!

Thank you so much!

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

Follow
1 follower

RSS

Stats

Asked: 2019-07-29 16:02:29 +0800

Seen: 12 times

Last updated: Aug 01

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