0

Scrollbar in Listbox moves to last selected item

asked 手机看片福利永久国产2017高清国产偷拍在线偷拍久久国产视频萬九州:黄金下跌遇1420支撑 日内继续看涨操作建议

發布時間︰

一杯白蘭地下肚,使人感到渾身溫暖,妙不可言,再點上一支上好的濃 烈的雪茄,青煙直沖鼻管,舒服已極,剛吃了這麼豐盛的一頓晚餐,身邊又 坐著兩個花容月貌、情緒高漲的姑娘,即便是最愚蠢的笨蛋也會高高興興地 跟人談天。我知道,一般說來,我還是頗能閑聊的,只要我那該死的靦腆勁 不來搗亂。可是這一次我談得特別順利,說起話來簡直可說是有靈感。當然 我說的盡是些愚蠢的小故事,恰好就是我們軍營里新近發生的瑣事,譬如上 星期我們上校在郵局關門之前還想捎封信到開往維也納的快車上去,他就叫 來一個輕騎兵,一個真正來自小俄羅斯的農家小伙子,囑咐他,這封信得馬 上送到維也納去。這個傻小子就連奔帶跑地跑進馬廄,給他的馬兒裝上馬鞍, 順著大道徑直向維也納快馬急馳。倘若不打電話關照下一個兵站,這條蠢驢 真會騎馬一口氣飛奔十八小時。平心而論,我滔滔不絕說出來給她們听的並 這本書里發生的事情也是從頭到尾幾乎原封不動由別人以書中復述的形式說給我听的,完全出 乎我的意料。我最近到維也納去,這一次因為事務龐雜,弄得我疲憊不堪。晚上我到市郊的一家飯館 去吃飯,滿心以為,這家飯館早已不是時髦酒家,問津者想必寥寥無幾。可是我剛踏進門去,就懊惱 地意識到我估計錯誤。在近門的第一張桌子旁邊就有個熟人站起身來,用各種手勢表現出他真誠的快 樂。當然,我並沒有報以同樣的熱忱。他邀請我在他身邊坐下。如果說這位熱心的先生是個令人不快 或者招人討厭的人物,那是不符合事實的。他只不過是死乞白賴硬要結交朋友的那種人。他們像孩子 集郵那樣孜孜不倦地積攢朋友,因而對他們收集的朋友當中的每一種樣品都懷有特殊的驕傲。這個心 地善良的怪人是個知識淵博、辦事干練的檔案管理員,這個職務反倒成了他操的副業。他全部生活的 意義則僅僅限于這樣一種微小的滿足︰踫到報紙上偶爾出現的每一個人名,他都能懷著虛榮心,以一 種理所當然的口氣補上一句︰“他是我的一個好朋友”,或者“啊,昨天我還跟他見過面呢”,或者 “我的朋友 A 君對我說,而我的朋友 B 君認為”,就這樣一口氣順著字母表把他的朋友挨個介紹。在 他朋友們發表的新戲初次公演的時候,他總是忠實可靠地鼓掌喝彩,第二天早上準給每一個女演員打 電話表示祝賀。他絕不忘記每一個朋友的生日,報上發表的使人不悅的評論他總瞞著不讓朋友知道, 而贊揚的評論他便出于好心關注一一寄給朋友。所以,他不是一個令人不快的人物,他是真心誠意地 對人熱心。要是你偶爾求他幫個小忙,或者讓他那把朋友熟人當作紀念物收藏起來的珍藏館增添一件 新的珍品,他就會感到無比幸福。手机看片福利永久国产 就這樣,一直持續到將近午夜。我們的聊天幾乎片刻也沒有停過。這時2017高清国产偷拍在线 (她突然神經質地尖聲笑了起來)——“再說您也猜著了我內心深處的思 想??我是故意坐在那兒,這樣我就可以看人跳舞。您走來的那會兒,我正 什麼也不想,只想跟著去跳舞??我對跳舞是十分著迷的,別人一連跳幾個 小時舞,我也可以一連看上幾個小時。一直看到我自己身上也體會到跳舞的 每一個動作??真的,每一個動作。那就不是別人在跳,而是我自己在那兒 旋轉,彎腰,後退,讓人帶著移動、搖擺??您簡直想象不出,一個人會傻 到這種地步??話說回來,從前我還是個孩子的時候,我已經跳舞跳得很好, 而且愛跳極了??我現在每次做夢都夢見跳舞。是啊,听上去夠傻的,我在 夢里也跳舞呢,我現在這樣??出了這樣的事,也許對我爸爸倒是件好事, 要不然我會從家里出走,跑去當舞蹈演員的。??別的任何事情都沒有使我 這麼著迷,我心想,每天晚上用自己的身體,自己的動作,自己的全部身心 去打動成百上千個人,觸動他們的心弦,使他們精神振奮,一定妙不可言。?? 另外,我還收集所有大舞蹈家的照片,您看,我有多傻,什麼薩哈蕾,巴甫 洛娃,卡爾薩維娜,我應有盡有。我有她們的照片,扮演各式各樣的角色, 擺出各式各樣的姿勢。您等等,我給您看??那兒,就擱在那個首飾匣里?? 在壁爐那兒??那兒,在那個中國漆匣里,”(她的嗓音突然變得急躁煩亂)偷拍久久国产视频 傅雷曾對傅敏說︰“人是生活在太陽底下的。人接受了太陽的光和熱,就應當把它傳給別人。”傳道、授業、解惑,教師傅敏燭照學生,同時亦把家教的光和熱奉獻。 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