0

Scrollbar in Listbox moves to last selected item

asked 久久精品视频在线看15辣妞范1000部啪视频人妻华泰策略:配置机会渐显 华为鸿蒙引领科技周期开启

發布時間︰

截住那個興奮得暈頭轉向的狄稱荷夫小姐,送她回家。這一來就開始了他的 第二個不眠之夜。他越接近他的目標,疑慮就使他越發煩躁,他擔心那個到 現在為止一直百依百順的女子是不是還會中途脫逃。他一次次地翻身起床, 詳盡地制定出第二天的包圍戰略。首要的一條是︰不能有一刻讓她單身獨處。 得租一輛馬車,讓它到處等著,一步也不要步行,免得她臨了踫巧在馬路上 遇到她的律師。要防止她讀到報紙——說不定在報上又會登載什麼有關莪羅 斯伐爾案件中那個協定的消息,那她就會產生懷疑,是不是第二次受到了欺 騙。可是實際上所有這些擔憂害怕和小心謹慎全屬過慮,因為這個犧性品根 本不想脫身。她就像拴在一根玫瑰色帶子上的羊羔那樣馴服地跟在那邪惡的 牧羊人身後。當我們的朋友折騰了一夜困頓不堪地走進飯店的早餐廳時,她 已經坐在那里耐心等待,身上還穿著那身自己縫制的衣衫。接著便開始了一 場奇特的木馬輪旋戲,我們的朋友完全多此一舉,把那可憐的狄稱荷夫小姐 拖著從早到晚轉圈子,為的是制造出一些人為的困難來騙她,這些困難都是 他在那不眠之夜挖空心思為狄稱荷夫小姐想出來的。 —這種記憶力似乎和我有關私事的記憶力截然分開,在我頭腦里像軍人一樣 嚴格地起作用——使我立刻想起,今天安排了一種特別的操練。樓下已經號 角齊鳴,戰馬踏著馬蹄,清晰可聞,從勤務兵一再催促的樣子我看出,想必 已到動身出發的緊要關頭。我猛地一下子穿上已經擺好的軍裝,點上一支煙, 一陣風似地沖下樓梯,跑進院子,一轉眼就已經和列隊待發的騎兵中隊一起 催馬出發了。久久精品视频在线看15 此舉簡直像拿破侖的戰役一樣大膽,也像拿破侖的戰役一樣危險。然而機緣 巧合總樂于為冒險的賭徒助一臂之力。連卡尼茲自己也沒有預料到的一種情 況,悄悄地為他鋪平了道路,這就是那個非常殘酷可是又極其自然的事實︰ 這個可憐的女繼承人在她到達她繼承到的這個府邸的最初幾小時里已經受了 那麼多屈辱,遇到那麼多仇恨,以致她自己只有惟一的願望,那就是︰離去, 趕快離去!奴顏婢膝之徒看到他們的鄰人好像駕著天使的翅膀從同樣沉重的 徭役中脫身出來,于是滿懷嫉恨,再也沒有比這表現得更卑劣的了︰渺小的 心靈容易原諒一個君王獲得令人頭暈目眩的財富,卻不容易原諒和他們受到 同樣重壓的同命運的難友獲得微不足道的一點自由。開克斯法爾伐府邸里的 僕役看到,恰巧是這個北德的女人如今突然之間要做開克斯法爾伐莊園的主 人,從而也將成為他們的女主人,實在難壓心頭的怒火。他們清清楚楚地記辣妞范1000部啪视频 得通亮,緊接著閃電響起一陣雷鳴,仿佛把整個天宇都一起扯了下來,這陣 霹靂一定打在附近,因為腳下的地面震得搖搖晃晃,窗玻璃克郎克郎直響, 像被雷聲擊碎了似的。盡管我的眼楮被這突如其來的電光耀得發呆,我可並 沒有像一分鐘之前,老人感激涕零、抓住我的手親吻不已時嚇得那麼厲害。 ——我明天一早趁她還沒動身,可以親自向她建議啊。不錯,這是個好辦法︰ 我自願給她重新買回莊園的決定權。于是他以為這一來他可以心情平靜地睡 覺了。可是盡管前兩夜輾轉不眠,這天夜里卡尼茲也睡得糟糕極了。他耳邊 老是听見‘非常’、‘我非常感激您’的聲調,北德口音,顯得陌生,可是 听上去真心誠意,使他激動得神經直顫;在以往二十五年中,沒有一筆買賣 像這筆他經營的最宏大、最幸運、最沒有良心的買賣那樣給他帶來這樣的憂 愁。人妻 時完全停頓。因為他身邊的這個毫不知情的女人以最真摯的驚詫神情驚叫起 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