how to add checkbox in to display tag column headers?

Discussions

Web tier: servlets, JSP, Web frameworks: how to add checkbox in to display tag column headers?

  1. Hi all,


    i need to add one checkbox in displayTag column headers.
    i am able to add checkbox in all rows for the above column. but i need at the column header level. i need to do a selectall functionality, only after putting a checkbox in the column header. selectall can be done by using javascript, but unable to add one checkbox at table level.

    if, any one has any solutions , please forward me the solution...


    regards,
    mishra
  2. Is there any other work you'd like done for you?
  3. Is It clear for you, what is my problem......


    if you do have any solution for my problem, please let me know
  4. <display:column title="Select">
    <html:checkbox name="choosen" value='<c:out value="${user.id}"/>' />
    </display:column>
    Check it out
    Regards
    RamnathN
  5. Hi Ramanth,

    is it possible without "value='<c:out value="${user.id}"/>'"

    i donot want to use JSTL ,
    Reply me,

    biswa
  6. <display:column property="editableCheckbox" title="" oddRowStyle="Row1StyleLeft"
    evenRowStyle="Row2StyleLeft" decorator="displaytag.decorator.CheckboxDecorator"/>


    i am using like this, i am able to add checkbox to all the lineitems , but not to the column header...

    do u have any soultion....

    please mail me...

    regards,
    biswa
  7. Hey Biswa,

    Can u plzz let me know how u implemented the checkBox functionality for display Tag..forget ab't header...I just need checkboxes for my line items...sample code welcome.

    Thanks...
    Phani
  8. I came upon the same problem and found (thanks to a colleague in the office) the following solution, thought not very elegant:

    <display:column title="<input type='checkbox' name='selectall' />">
      <input type="checkbox" name="select" />
    </display:column>

    HTH,
    Andrey
  9. Hi,
    i am not able to retain checkbox values over multiple pages, when i come back the checkbox value is reset again. is there any way, i can retain the checkbox values.

    Thanks,
    Ramesh
  10. Thank you[ Go to top ]

    I was almost about to give up to use displaytag due to this problem. Thank you.
  11. adding checkbox title[ Go to top ]

    A bit after the fact I know, but I have this:

        <display:column title="<input type='checkbox' name='selectall' onClick='selectAll(this, \"selectableCheckbox\")' />" media="html">
              <input type="checkbox" name="${myMapSet.id}" class="selectableCheckbox" />

    which not only displays the checkboxes but also displays a tick box in the title bar which selects all.  In addition it takes the name of the checkbox from the id element in each map of myMapSet, the object being displayed.

    Also need this java script function to make it work:

    function selectAll(box, classStyle) {
        var checked = box.checked;
        document.getElementsByClassName(classStyle).each( function(checkbox){
                checkbox.checked = checked;
            });
    }

    which needs you to include prototype.js.