0

select all checkbox in listbox header in zk

asked 2013-11-07 08:20:40 +0800

susu gravatar image susu
11 2

hye all..my problem is i want the option for user to select all the data in listbox. But the problem is my select all checkbox does not appear in my listbox header even i put multiple="true" checkmark="true" in the header.

delete flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted
2

answered 2013-11-07 08:55:58 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

In your afterCompose method add below line of code

model.setMultiple(true);
link publish delete flag offensive edit

Comments

hye sjoshi, thanks for reply...however, the result still the same, no select all checkbox in my listbox header.

susu ( 2013-11-07 09:33:22 +0800 )edit

Can you share your ode how u did it in View Model

sjoshi ( 2013-11-07 09:42:07 +0800 )edit

this is my zul file....

susu ( 2013-11-07 09:58:19 +0800 )edit
0

answered 2013-11-07 10:02:54 +0800

susu gravatar image susu
11 2

updated 2013-11-07 10:05:33 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

dear sjoshi..

<listbox id="lbxSdata" fixedLayout="true" multiple="false" checkmark="false" sizedByContent="false" span='true'  
            emptyMessage="${lbl:name('No items match your search')}">

                <listhead sizable="true" >
                <listheader hflex="4" label="${lbl:name('Action')}" align="left" />
                <listheader hflex="10" sort="auto(LOCK_TABLE)" label="${lbl:name('Table')}" align="left" />
                <listheader hflex="10" sort="auto(LAST_OPR_DATE)" label="${lbl:name('Last Date')}" align="left" />
                <listheader hflex="5" sort="auto(LOCK_KEY1)" label="${lbl:name('Key 1')}" align="left" />
                <listheader hflex="5" sort="auto(LOCK_KEY2)" label="${lbl:name('Key 2')}" align="left" />
                <listheader hflex="5" sort="auto(LOCK_KEY3)" label="${lbl:name('Key 3')}" align="left" />
                <listheader hflex="5" sort="auto(LOCK_KEY4)" label="${lbl:name('Key 4')}" align="left" />
                <listheader hflex="5" sort="auto(LOCK_KEY5)" label="${lbl:name('Key 5')}" align="left" />
                <listheader hflex="15" sort="auto(LOCK_REMARK)" label="${lbl:name('Remarks')}" align="left" />
</listhead>

this is my search controller where i put model.setMultiple(true)

private void refreshModel(int _startPageNumber, HParam _scriteria)
    {
        int pageSize = PageUtil.getLinesPerPage();
        sdataPaging.setPageSize(pageSize);

        if (_startPageNumber == 0) // first page
            sdataPaging.setActivePage(0); // reset it

        model = new LockmstSearchPagingListModel(pageSize);
        model.getPageData(_startPageNumber, _scriteria);
        sdataPaging.setTotalSize(model.getTotalSize());
        model.setMultiple(true);
        lbxSdata.setModel(model);
    }
link publish delete flag offensive edit

Comments

Why u added multiple="false" checkmark="false" in Listbox make them true

sjoshi ( 2013-11-07 10:05:55 +0800 )edit

oh..my bad..this is my edited zul file, where i built the check box using java..so back to my question , i already the multiple="true" checkmark="true" but the select all check box still did not appear in my listbox header.

susu ( 2013-11-08 00:51:24 +0800 )edit

Did u added setMultiple(true) i afterCompose() or some where else. Please try one meore thing try to create a demo sample and do same thing and let me knw the results

sjoshi ( 2013-11-08 04:39:57 +0800 )edit

hi sjoshi, i put the setMultiple(true) in my refreshModel and the result is still same, no select all check box in my listbox header. So i try to test my zul file without connect it to java and the checkbox appear in my listbox header. i dont know why it happen like that?

susu ( 2013-11-15 07:41:22 +0800 )edit

Which version of ZK u r using?

sjoshi ( 2013-11-26 09:46:44 +0800 )edit
0

answered 2013-11-26 05:52:35 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

Hi

The selected All checkbox spec has been changed since ZK 5.0.11:

http://books.zkoss.org/wiki/ZKComponentReference/Data/Listbox#Version_History

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: 2013-11-07 08:20:40 +0800

Seen: 57 times

Last updated: Nov 26 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More