0

Select all checkbox in Listbox header?

asked 2013-10-11 09:04:41 +0800

susu gravatar image susu
11 2

updated 2013-10-11 10:27:31 +0800

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

why my select all checkbox doesnot appear in my listbox header?

........this is my zul file........

<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" />

.......this is my java .............

public void render(Listitem item, Object data) throws Exception
    {


        @SuppressWarnings("unchecked")
        Map<String, String> map = (Map<String, String>) data;
        countId = item.getIndex();

        count = item.getIndex() + 1;

        item.setAttribute(ZkConstants.RowData, map);

        item.appendChild(buildCheckbox(null , count));
        //Listcell lbl = new Listcell();

        item.appendChild(buildLabel("LOCK_TABLE",map));
        item.appendChild(buildLabelDateTime("LAST_OPR_DATE", map));
        item.appendChild(buildLabel("LOCK_KEY1", map));
        item.appendChild(buildLabel("LOCK_KEY2", map));
        item.appendChild(buildLabel("LOCK_KEY3", map));
        item.appendChild(buildLabel("LOCK_KEY4", map));
        item.appendChild(buildLabel("LOCK_KEY5", map));
    }

private Listcell buildCheckbox(String value , Integer recordNo)
    {
        Listcell  lbl = new Listcell ();



        Checkbox chkbox = new Checkbox();
        String strRecordNo = null;
        strRecordNo = Integer.toString(recordNo);


        chkbox.setId("chkbox_"+countId);
        chkbox.setChecked(false);
        lbl.setLabel(value);
        lbl.setLabel(strRecordNo);
        lbl.appendChild(chkbox);

        return (lbl);
    }

thanks for respond :)

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-10-11 10:29:09 +0800

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

You have to use multiple="true" and checkmark="true"

link publish delete flag offensive edit

Comments

i have tried it before..but the windows will come out with two checkbox for every list

susu ( 2013-10-11 10:51:15 +0800 )edit

in your afterCompose() method do 'yourModel.setMultiple("true");'

sjoshi ( 2013-10-11 13:43:49 +0800 )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-10-11 09:04:41 +0800

Seen: 20 times

Last updated: Oct 11 '13

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