0

Scrollbar in Listbox moves to last selected item

asked 大香蕉一本道久在线一本道久久综合久久爱一级A做爰片国信证券:从美、日经验看中国垃圾焚烧行业的未来

發布時間︰

聰︰是是是,有有!技術水平、音樂天賦都有。中國人的音樂感比任何一個國家的人都強。有音樂感只不過是初步的感性,真要做學問的話,必須要提高到理性上來,然後再回到感性,又再回到理性,不知道經過多少回復、復歸,才有一天可能成為音樂家。中國人搞音樂到做學問的水平還沒有,其實音樂是一門最玄妙的學問。 大香蕉一本道久在线 阿聰前年回國探親,鐘書正在國外訪問。阿聰對我說︰“啊呀!我們真愛听錢伯伯說話呀!”去年他到我家來,不復是頑童偷听,而是做座上客“听錢伯伯說話”,高興得哈哈大笑。可是他立即記起他嚴厲的爸爸,淒然回憶往事,慨嘆說︰“唉那時候我們就愛听錢伯伯說話。”他當然知道爸爸打他狠,正因為愛他深,他告訴我︰“爸爸打得我真痛啊!”梅馥曾為此對我落淚,又說阿聰的脾氣和爸爸有相似之處。她也告訴我傅雷的媽媽怎樣批評傅雷。性情急躁是不由自主的,感情沖動下的所作所為,沉靜下來會自己責怪,又增添自己的苦痛。梅馥不怨傅雷的脾氣,只為此憐他而為他擔憂;更因為阿聰和爸爸脾氣有點兒相似,她既不願看到兒子拂逆爸爸,也為兒子的前途擔憂。“丈化大革命”開始時,阿聰從海外好不容易和家里掛通了長途電話。阿聰只叫得一聲“姆媽”,媽媽只叫得一聲“阿聰”,彼此失聲痛哭,到便咽著勉強能說話的時候,電話早斷了。這是母子末一次通話話,盡在不言中,因為梅馥深知傅雷的性格,已經看到他們夫婦難逃的命運。有人說傅雷“孤傲如雲間鶴”;傅雷卻不止一次在鐘書和我面前自比為“牆洞里的小老鼠”是否因為莫羅阿曾把服爾德比作“一頭躲在窟中的野兔”呢?傅雷的自比,乍听未免滑稽。梅馥稱傅雷為“老傅”;我回家常和鐘書講究︰那是“老傅”還是“老虎”,因為據他們的鄉音,“傅”和“虎”沒有分別,而我覺得傅雷在家里有點兒老虎似的。他卻自比為“小老鼠”!但傅雷這話不是矯情,也不是謙虛。我想他只是道出了自己的真實心情。他對所有的朋友都一片至誠。但眾多的朋友里,難免夾雜些不夠朋友的人。誤會、偏見、忌刻、驕矜,會造成人事上無數矛盾和傾軋。傅雷曾告訴我們︰某某“朋友”昨天還在他家吃飯,今天卻在報紙上罵他。這種事不止一遭。傅雷講起的時候,雖然眼楮里帶些氣憤,嘴角上掛著譏誚,總不免感嘆人心叵測、世情險惡,覺得自己老實得可憐,孤弱得無以自衛。他滿頭稜角,動不動會觸犯人;又加脾氣急躁,制不住要沖撞人。他知道自己不善在世途上圓轉周旋,他可以安身的“洞穴”,只有自己的書齋;他也像老鼠那樣,只在洞口窺望外面的大世界。他並不像天上的鶴,翹首雲外,不屑顧視地下的泥淖。傅雷對國計民生念念不忘,可是他也許遵循《剛第特》的教訓吧?只潛身書齋,作他的翻譯工作。一本道久久综合久久爱 我和傅雷的友誼,只能說開始于解放以後,那時他已遷居江甦路安定坊,住的是宋春舫家的屋子。我住在鄰近,轉一個彎就到他家。五十年代初,他在譯巴爾扎克,我在譯伐佐夫、顯克微支和尼克索。這樣,我們就成為翻譯外國文學的同道,因此,在這幾年中,我常去他家里聊天,有時也借用他的各種辭典查幾個字。一级A做爰片 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