0

Scrollbar in Listbox moves to last selected item

asked 伊人在线电影俺去啦图片caoporn成人免费视频爱泼斯坦岛上豪宅曝光 克林顿也曾参与岛上狂欢?

發布時間︰

“少尉先生,也許我告訴您的事情已經太多了——反正比我原來打算告 訴您的要多。但是,希望您不至于誤會我。我把開克斯法爾伐當時對這個一 無所知的女人耍的這個花招老老實實地告訴您,決不是為了讓您對他產生反 感。這個可憐的老人,今天留我們在他家吃了晚飯,我們看見,他身患心髒 病,惶惶不安,他把他的女兒托付給我。為了治好這可憐的姑娘,他會拿出 他財產中的最後一個銅子,這個人早已不再做那種不干不淨的買賣,我是絕 不會在今天來控告他的。恰好在現在,他在絕望之中的確需要幫助的時候, 我覺得重要的是,您從我這兒听到真實情況而不是從別人那兒听到惡意的風 言風語。所以請您堅持一點——開克斯法爾伐(或者不如說卡尼茲,當時他 還叫這個名字呢!)那天到開克斯法爾代莊園去並不是抱著從這個不諳世事 的女人手里憑著花言巧語便宜地買下這個莊園的目的。他只是想順便做一筆 他常做的那種小買賣,並無其他奢望。那個驚人的機會簡直可說是向他突然 襲來的,他要是不充分利用這個機會,也就不成其為他了。但是您馬上就會 看到,接著事態便多少有了些變化。 可是康多爾好像已經料到我心里在想什麼,就彎身向我湊過來。他那只 柔軟的小手真像大夫的手那樣踫踫我的手,表示安慰。伊人在线电影 “我不回去,我冒一次險吧,”我答道。俺去啦图片 “她坐在那里,背朝著他。即使沒有看見她的臉,僅從這瘦小的女子孤 零零地坐在一張桌子旁的那種謙遜、文靜的樣子,他就感到有種楚楚動人的 東西,不由自主地使他內心深受感動。他怯生生地走過去,很快地把糖果和 鮮花放在桌上︰‘為您的旅途準備的一點小意思。’ 使人難堪的敬意,他和新郎的父親、新郎,以及幾位當地士紳親切地挨個握 手,請求他們不要因為我們的緣故而中斷這美好的慶典。年輕人應該繼續盡 情地跳舞,再也沒有比他們無拘無束地繼續歡慶婚禮更使我們快活的了。說 話的同時,他招手把樂隊的隊長叫到跟前來,樂隊長右胳臂底下夾著一把小 提琴,哈著腰,好像全身僵了似的,等在平台前面。開克斯法爾伐扔給他一 張鈔票,示意他開始奏樂。這張鈔票想必票面很大,因為這個哈腰諂媚的小 子像觸了電似的,蹦了起來,三腳兩步沖回他的平台,向樂師眨眨眼楮。隔 一會兒,這四個小伙子就開始奏樂,的確只有匈牙利人和吉卜賽人才能這樣。 第一聲鐃鈸就敲得迅猛有力,打消了大伙的拘謹。霎時間,男男女女,成雙 成對,踏著舞步,跳起舞來,比先前跳得更加狂野,更加感情奔放,因為所 有的小伙子和姑娘們,不知不覺都雄心勃勃,要讓我們看看,真正的匈牙利 人多麼善于跳舞。年輕的身體在搖擺,在跳躍,在頓足,不出一分鐘,剛才 還充滿敬意、寂靜無聲的大廳已經化為一股熾熱的旋風。青年人興高采烈, 跳得那樣起勁,那樣狂熱,每跳一步都震得平台上的酒杯叮當亂響。caoporn成人免费视频 我這個科班出身的騎兵在那兒可看的東西簡直多得目不暇接。相反,他 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