Display tag mulit check problem !!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siddiq
    New Member
    • Oct 2008
    • 3

    #1

    Display tag mulit check problem !!

    Hi ,

    Do any one have solution to this problem ?

    I am using a display tag for pagination in my JSP page. I have a checkbox field as one of the columns. I am using displayTagWrapp er class to display my checkboxes. I have a submit button in a page which will save checkbox status into the database. I also have pagination and sorting in the page.

    The problem i have is, i will loose the status of the checkbox when i go to second page. If i select some of the checkboxes in page 1 and go to page 2 to select some more and if i come back, i loose all the selected checkboxes in page 1.

    Is there a way where i could save my check boxes in session and its checked while i browse across pages and gets submitted all at once.

    Any help is appreciated

    Thanks
    Siddiq.
  • sukatoa
    Contributor
    • Nov 2007
    • 539

    #2
    Originally posted by siddiq
    Hi ,

    Do any one have solution to this problem ?

    I am using a display tag for pagination in my JSP page. I have a checkbox field as one of the columns. I am using displayTagWrapp er class to display my checkboxes. I have a submit button in a page which will save checkbox status into the database. I also have pagination and sorting in the page.

    The problem i have is, i will loose the status of the checkbox when i go to second page. If i select some of the checkboxes in page 1 and go to page 2 to select some more and if i come back, i loose all the selected checkboxes in page 1.

    Is there a way where i could save my check boxes in session and its checked while i browse across pages and gets submitted all at once.

    Any help is appreciated

    Thanks
    Siddiq.
    If you use that displayTagWrapp er class to generate html checkbox tag equivalent, then that framework should allow to modify its properties before throwing its output to the browser, what i mean is, there should be a method that set the specific checkbox's checked="yes" or none

    why don't you just use a pure html here and manage the sessions ( better to handle an arraylist )
    put a scriplet after any other properties,

    eg

    <input type="checkbox" name="werty" <%= werty_exists?"c hecked=\"yes\"" :"" %>

    where werty_exists is only an indicator that if werty exists on a list ( beans session scoped )....


    regards,
    sukatoa

    Comment

    Working...