0

Scrollbar in Listbox moves to last selected item

asked caoporn超碰在线视频水莓100视频亚洲伦理av人妻在线观看|AV亚洲2018美军舰再过台湾海峡 网友讽:帮蔡英文走私香烟

發布時間︰

不都是十分善良、正派的人嗎,絲毫沒有嫉妒或者惡意。如果他們和我開點 玩笑,也決非出于惡意。caoporn超碰在线视频 幸而已經天亮。走廊里響起腳步聲,樓下小推車從石塊路上隆隆經過, 玻璃窗上映著明亮的天光,人的頭腦思考起來也比關在可惡的黑暗之中要清 醒一些,黑暗是喜歡臆造各式各樣的鬼魅來的。我對自己說,也許一切並不 那麼可怕。說不定根本就沒有人知道這事。當然她是永遠也不會忘懷,永遠 也不會原諒這事的,這可憐的臉色蒼白的姑娘,這患病的癱瘓的姑娘!我的 腦海里猛然閃過一個念頭,很有用處。我急急忙忙梳理了一下我蓬亂的頭發, 套上軍裝,從我那驚詫不已的勤務兵身邊跑過,他使用他那蹩腳的帶小俄羅 斯口音的德語在我背後拚命叫喊︰“少尉先生,少尉先生,咖啡已經煮好了!” 我像一陣風似地沖下營房的樓梯,像支飛箭從那些還沒有穿戴整齊懶洋 洋地站在院子里的輕騎兵身旁一掠而過,他們都來不及向我立正敬禮。我一 口氣飛快地從他們身邊跑過,穿過軍營的大門來到門外。我以不夫少尉身分 所允許的速度徑直跑向市政廳廣場上的那爿花店。早上五點半所有的商店都 還沒有開門,我心里焦急,自然把這層忘得一干二淨。幸而古爾特納太太除 了鮮花之外還兼賣蔬菜;一小車土豆停在門口,已經卸了一半,我使勁猛敲 窗口,听到她已經趿著拖鞋下樓來了。急忙之中我編了個故事︰今天是我好 朋友的命名日,我昨天把這事忘了個一干二淨。過半小時我們就要出發了, 因此我希望能馬上把花送去。所以快把花拿來,趕快,把她店里最美麗的花 拿來!這位身軀肥胖的女店主還穿著睡衣,馬上趿著兩只破了窟窿的拖鞋打 開店門.把她最珍貴的寶藏拿給我看,這是一大蓬長柄玫瑰。她問我要多少。 我說,都要,統統都要!她問我︰就這樣簡單地把花捆在一起還是最好裝在 一個美麗的花籃里?好吧,好吧,來個花籃吧。我這個月剩下的餉銀訂了這 籃美麗的鮮花就全報銷了,這個月最後幾天我就得省下晚飯,不上咖啡館, 要不就得借錢。可是此時此刻我覺得這些全無所謂,甚至可以說,我干的這 件傻事能讓我付出重大代價,我心里反而高興。因為這段時間里,我一直感 到一種惡意的樂趣,要好好懲治一下我這個蠢貨,要讓我為自己干出的雙重水莓100视频 真是一個燈光明亮、聲響悅耳的幸福喜悅的夜晚!我不知道我之所以覺得這 樣心情舒暢、無拘無束是不是因為我左右對面所有的人眼楮都變得閃閃發 光、說話都揚起聲音,是不是因為他們都同樣忘記了矜持作態、故作高雅, 全部爭先恐後七嘴八舌他說起話來——反正,我平素的拘謹神氣一掃而空。 我毫無顧忌地談天說地,同時向鄰座的兩位女士大獻殷勤,舉杯暢飲,縱聲 大笑,看起人來,目光大膽奔放而又輕松瀟灑,我有時多少有些故意地用手 觸摸一下伊羅娜(這就是那個嬌美標致的外甥小姐的名字)赤裸的臂膀。她 似乎對這輕柔的接觸毫不見怪,她自己也和這豐盛筵席上我們所有的人一 樣,輕松愉快,情緒高漲,怡然自得。 實際上我是不想看那座鐘,不想看分針一分鐘一分鐘無情地向前移動。 我覺得我的神經有一種麻麻辣辣的感覺,我的思想不時飄向別處,一個念頭 老是不斷地折磨我︰我是不是還是應該去掛個電話,打聲招呼。我第一次開 始預感到,真正的關心是不可能像電路插銷一樣隨意插上拔下的;凡是關心 別人命運的人,一定要失掉一些自己的自由。亚洲伦理av人妻在线观看|AV亚洲2018 ——“不,不,不,在左首那堆書旁邊??哎,您真不機靈??對了,就是 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