0

Scrollbar in Listbox moves to last selected item

asked 黄色片7738x色情网免费的看真人视频一一级毛片_FreeXXXPorn中国女人千亿增量资金在路上 扎堆消费、科技股的概率较大

發布時間︰

現在我心里輕松多了。我急急趕回軍營,一口灌下我的咖啡,好歹熬過 了訓話時間,也許比平時更加心煩意亂,更加精神渙散。不過在部隊里若有 個少尉早上萎靡不振地跑來值班,這並不特別令人感到奇怪。有多少軍官在 維也納荒唐了一夜,精疲力竭地返回軍營,眼楮都睜不開,在馬匹快步小跑 的時候竟然會在馬上睡著。其實我覺得這段時間里得不斷地發出口令,檢查 隊形、騎馬奔馳,對我真是求之不得。因為值勤多少驅散了我內心的不安, 當然,我的兩個太陽穴里,使人極不自在的回憶一直在翻騰,我的嗓子眼里 總有挺大的一團什麼東西像苦味的海綿似的堵在那兒。 我走向那張桌子,旁邊響起陣陣樂聲。我鞠了一躬,彬彬有禮地表示邀 舞。一雙驚愕的眼楮抬起來深表意外地直瞪著我,嘴唇半開,只字不吐。可 是她一動不動,絲毫沒有跟我同去的樣子。莫非她沒有明白我的意思?我再 一次向她鞠躬,腳上的刺馬針輕輕一踫︰“小姐,我可以邀您同舞嗎?”黄色片 7738x色情网免费的 他告訴我,開克斯法爾伐是這一帶的首富。干脆說吧,什麼都是他的產 業,遠不止那座開克斯法爾伐府邪呢。——“您想必知道這座府邸,從練兵 場上就可以望見,就是公路左邊那座擁有一個平頂塔樓的黃色府邸,四周是 座古老的花園,面積很大。”坐落在通往 R 去的大道旁那個大制糖廠,開在 勃魯克的鋸木廠,還有 M 地方的養馬場,所有這一切全都為他所有,另外在 布達佩斯和維也納還有六七幢房子,“可不是,大家簡直不能相信,在我們 這幾還有這種家財萬貫的大富翁,這人可真會像個真正的達官貴人那樣過日 子。冬天在雅爾金巷小巧玲瓏的維也納宮過冬,夏天在各個療養地消夏,在 本地他只是春天住這麼幾個月,可是住的這所房子,我的老天爺,是什麼樣 的氣派啊!從維也納來的四重奏樂隊,香檳酒和法國的各色葡萄酒,全是百 里挑一,千里挑一的珍品!”他說,如果我有興趣,他將樂于為我引見,因 為——他做了一個滿意的手勢——他和封?開克斯法爾伐先生?是朋友,早年 和他有很多商業上的交往,深知他一向樂于結交軍官;他只消說一句話,我 就會受到邀請。 突然她臉漲得通紅,順從地喃喃低語︰ “好吧,好吧,我這就去,雖然一點意思也沒有,毫無意義。請原諒,看真人视频一一级毛片_FreeXXXPorn中国女人 突然她臉漲得通紅,順從地喃喃低語︰ “好吧,好吧,我這就去,雖然一點意思也沒有,毫無意義。請原諒, 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