check/uncheck in multibox

jaggernat
jaggernat used Ask the Experts™
on
Dear experts

I have 2  jsp page1 and page2, Code in page1 is like this:

      <c:when test="${param.checkaddToCartforReports == 'disableR'}">
                                                      
<html:multibox property="selectedEditions" >
      <c:out value='${edition.editionId}'/>
</html:multibox>
      Edition <c:out value='${edition.editionId}'/>
</c:when>

<html:button value=”Add to Cart”/>

In page1, my <html:multibox>  has like 10 to 15 checkboxes .  Each checkbox corresponds to a “edition” .When I ‘check’ one of the edition, and say “Add to Cart” in page1, it goes to page2 and that edition is added to cart.so page2 contains the cart
Now in page2, for that “edition” which was added in cart, I am setting checkaddToCartforReports == 'disableR' in the url query string.
Like this

<a href="/abc.xyz.do?submitAction=viewItem&checkaddToCartforReports=disableR<c:out value="${lineItems.edition}"/>Go to Page1</a>

So , when above link is clicked, it goes to page1. so once it goes to page1, I want that edition (and its corresponding checkbox) which was added in the cart to be disabled.

That is , the checkbox which was added to cart (from the multibox ) should be disabled when I get back from page2 to page1.

Want to know if that’s possible

Any help appreciated
Thanks
J

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
<html:multibox property="selectedEditions" disabled="true"> actually disables all check boxes. Is it possible to disable only a few selected checkboxes based on url query string value

thanks
J

Hi J,

Do not think you can do that in easy way using html tag of Struts afaik. However, other experts may have some other ideas.

My suggestion is for you to use the traditional <input type> approach instead of Struts html tag. Then you have to use Scriptlet to generate the checkboxes.

But yeah, Scriptlet and <input type> are just the last option (until we have no choice) for us :)
Weiping DuSenior Web Developer
Commented:
J,

If I was you, I will use scriptlet Java code inside JSP to treat this special case

Owen
Weiping DuSenior Web Developer

Commented:
Since question is not solved, I suggest to delete this question...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial