Revision history [back]

click to hide/show revision 1
initial version

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

susu gravatar image susu

Select all checkbox in Listbox header?

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" <br=""> 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);
}

tq for respond :)

Select all checkbox in Listbox header?

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" <br=""> 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);
 }

tq thanks for respond :)

Select all checkbox in Listbox header?

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

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

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

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 :)

Select all checkbox in Listbox header?

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 :)

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