0

Scrollbar in Listbox moves to last selected item

asked 97伦理电影在线不卡av丝袜亚洲在线亚洲在线xoxo日本在线允许从俄全境进口 大豆贸易正成“大三角”战略?

發布時間︰

  “海哥,我估算過,刨去那些給支票的大戶,剩余按一千人、平均每人兩千算,至少有兩百萬現金紅包。我們只要九十萬還債,剩下的全歸你。” 上校開了門鎖。我們走進他的房間。房間布置是斯巴達式的簡樸,看上 去更像一間大學生的寓所︰一張行軍鐵床——他不願意自己睡的床比弗朗 茨?約瑟夫皇帝在皇宮里睡的床更加講究——牆上掛著兩幅彩色畫像,右邊 一幅是皇帝的肖像,左邊一幅是皇後的肖像,另外還有四五張放在便宜的鏡 框里的紀念照片,拍的是軍官退伍和團隊晚會的場面,兩把交叉的佩刀和兩 把土耳其手槍——這便是全部陳設。沒有舒服的安樂椅,沒有書籍,只有四 把草墊軟椅放在一張做工粗糙、空無一物的桌子四周。97伦理电影在线不卡 市政廳廣場被寒冰一樣皎潔清冷的月光照得雪亮,鬼氣森森,鋪路石塊 的每一道邊都照得輪廓分明,屋子的每一道線都可以延伸上去,直到屋頂和 屋脊。我自己內心也像冰塊一樣清晰明澈。我從來也沒有像在這一瞬間思考 問題時這樣的頭腦清楚,仿佛萬里晴空,雲翳全無︰我知道我于了什麼事情, 知道現在該做什麼才是我的本分。我在晚上十點鐘訂了婚,三小時以後又怯 懦地否認了這個婚約。當著七個證人的面,我們團里的一名騎兵上尉,兩名 中尉,一名團隊軍醫,兩名少尉和見習士官,我手指上戴著訂婚戒指,還讓 人家因為我撒的卑鄙謊言而贊揚我。我陰險地陷害了一個熱戀我的姑娘,一 個正在受罪、無力自衛、渾然無知的少女。我听任別人辱罵她的父親而不提 出抗議。我發了偽誓,听任人家把一個說了實話的陌生人稱做騙子手。明天 全團都會知道我的恥辱,那時候全都完了。那些今天像兄弟一樣拍我肩膀的 人,明天將拒絕和我握手,拒絕和我打招呼。被人揭露出來我撒了謊,我就 不能再在部隊里混下去。可是被我出賣、受我誣蔑的那些人那里,我也回不 去了,甚至對于巴林凱來說,我這人也報銷了。這三分鐘的懦怯,毀了我的 一生︰我除了開槍自殺再無別的選擇。av丝袜亚洲在线 五十七   但猜遍世界無敵手的我,最近遇上了難題。不用我說,你們也能猜到,我的煩惱之源,便是出自小最君的銀都傳媒院線大電影《邊緣線》。既然出自小最君,身為編輯,當然有獲悉劇透的福利。我按照慣常思維,先是鎖定了A是凶手,然後被迅速打臉,再猜測B的手法,又沒猜對,隨後我又覺得C這人不簡單,結果……C只是一個打醬油的角色!亚洲在线xoxo日本在线 可是我拒絕了。我不願意再錯過一次電話。我一分鐘也不願浪費。我必 須知道出了什麼事,因為我已經感覺到,多少里路之外已經出事了。打電話 來的只可能是康多爾和鄉下那一家子。只有康多爾才可能把我旅館的地址告 訴他們。反正準是要緊的事情,緊急的事情,要不然不會半夜三更把我從床 上叫起來的。我全身的神經都在顫抖︰人家需要我,迫切地需要我!有人有 什麼事求我。有人有些舉足輕重的話要對我說,事關生死存亡。不,我不能 走,我必須留在我的崗位上。一分鐘也不能錯過。 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