0

Scrollbar in Listbox moves to last selected item

asked 千人斩经典 色偷拍亚洲偷自拍视频亚洲偷偷自拍高清无码知名基金经理调仓换股 关注核心资产交易拥挤

發布時間︰

終于門背後有一只還看不見的手把兩扇滑動門左右推開。向我迎面走來 千人斩经典 出乎意料的是,我竟用不著自己作出決定,因為三天之後有一封開克斯色偷拍亚洲偷自拍视频 康地、無拘無束地、如醉如痴地縱馬奔馳感到羞愧。這種過分的肉體的幸福 我看成是上天很不適宜的優待,我為此感到羞愧。我讓我那些大夫所望的小 伙子跟在我身後邁著沉重的步伐慢吞吞地跑過草地。我沒有看他們,但是我 感覺到,他們正等我發出口令,讓他們重新振奮起來,然而他們白等了一會。 當然,就在我感到心里有這種特別的障礙的同時,我也已經清楚地知道, 這種苦修磨煉是愚蠢而無用的。我知道,因為別人不能得到某種享受,所以 下讓自己獲得這種享受,因為別人不幸,所以不許自己幸福,這是毫無意義 的。我知道,每一秒鐘,正當我們嘻笑戲謔之際,不知什麼地方有一個人正 在病床上痰喘,死去,在千萬扇窗戶後面正躲藏著貧困,人們正在挨餓;正 當我們嘻笑戲謔之際,世界上還有許多醫院、采石場和礦井,在醫院、機關 和監獄里,無數的人正時刻被迫從事沉重的苦役,即使有人在無謂地折磨自 己,別人誰也不會在自己的苦難之中感到輕松一些。我心里很明白,只要有 人開始設想,在同一時間內,世上有什麼樣的苦難,那他定會感到窒息,徹 夜不眠,嘴角笑意頓消。然而使人驚慌失措、心灰意懶的並不總是那臆想出 來的、想象中的苦難;只有人的心靈以同情的眼楮親眼目睹的苦難才能真正 震憾人的心靈。正在我興高采烈、情緒高漲之際,我似乎驀然看到了那張蒼 白的、痛苦得變了形的臉,它是那樣近,那樣真,像在幻覺之中。我看到她 拄著拐杖拖著腳步慢慢地走過大廳,同時听見拐杖擊地的篤篤篤篤的聲音和 在她病殘的足踝上暗藏的機簧發出的叮叮當當、嘰嘰軋軋的聲音。我不假思 索,考慮也沒有考慮,就一把拉住韁繩,仿佛吃了一驚。現在時過境遷,我 對自己說,當時你不去令人鼓舞。使人振奮地縱馬疾馳,卻讓戰馬這樣愚蠢 地踏著沉重的步伐一路慢跑,又能幫得了誰的忙?然而,這一擊卻打中了我 心里的某一處,就在良心的附近;我再也沒有勇氣,力量充沛地,自由自在 地,身心健康地享受我肉體的歡樂。我們慢騰騰地、無精打采地騎著馬一直 走到通向練兵場的橫馬路上。一直等到完全看不見那座府邸了,我才振作起 來,自語道︰“胡扯!別來這些愚蠢的感傷情緒!”發出口令︰“快步前進!” 他告訴我,開克斯法爾伐是這一帶的首富。干脆說吧,什麼都是他的產 業,遠不止那座開克斯法爾伐府邪呢。——“您想必知道這座府邸,從練兵 場上就可以望見,就是公路左邊那座擁有一個平頂塔樓的黃色府邸,四周是 座古老的花園,面積很大。”坐落在通往 R 去的大道旁那個大制糖廠,開在 勃魯克的鋸木廠,還有 M 地方的養馬場,所有這一切全都為他所有,另外在 布達佩斯和維也納還有六七幢房子,“可不是,大家簡直不能相信,在我們 這幾還有這種家財萬貫的大富翁,這人可真會像個真正的達官貴人那樣過日 子。冬天在雅爾金巷小巧玲瓏的維也納宮過冬,夏天在各個療養地消夏,在 本地他只是春天住這麼幾個月,可是住的這所房子,我的老天爺,是什麼樣 的氣派啊!從維也納來的四重奏樂隊,香檳酒和法國的各色葡萄酒,全是百 里挑一,千里挑一的珍品!”他說,如果我有興趣,他將樂于為我引見,因 為——他做了一個滿意的手勢——他和封?開克斯法爾伐先生?是朋友,早年 和他有很多商業上的交往,深知他一向樂于結交軍官;他只消說一句話,我 就會受到邀請。亚洲偷偷自拍高清无码 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