File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes MyFaces Tomahawk ignores checkbox in dataList on first submission Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "MyFaces Tomahawk ignores checkbox in dataList on first submission" Watch "MyFaces Tomahawk ignores checkbox in dataList on first submission" New topic
Author

MyFaces Tomahawk ignores checkbox in dataList on first submission

Wally Hartshorn
Ranch Hand

Joined: Jan 30, 2003
Posts: 77
We're using MyFaces with Tomahawk and are seeing some strange behavior that appears to be related to t:dataList and certain types of form elements.

Suppose you have a form with code like this:


Note that one checkbox is outside of the dataList, the other is inside the dataList.

Suppose I were to do this:
  • display the form
  • select both checkboxes
  • click submit
  • I would find that the value of the checkbox that is inside the t:dataList is ignored -- the value of myBean.boxInDataList would NOT be set to "true". The checkbox outside of the t:dataList would work just fine.

    Stranger still, if I were to:
  • display the form
  • select both checkboxes
  • do something that will cause a validation error (e.g. leave a required field blank)
  • click submit
  • Then I would find that when the form was redisplayed with the validation error message, the checkbox within the t:dataList would NOT be checked. The checkbox that is outside of the t:dataList would properly remember that I had checked it.

    Strangest of all, if I were to:
  • display the form
  • select both checkboxes
  • do something that will cause a validation error (e.g. leave a required field blank)
  • click submit
  • observe on the redisplayed form that the checkbox in the t:dataList is not checked
  • reselect the checkbox
  • correct the validation error
  • resubmit the form
  • Then I would find that the value of the checkbox in the t:dataList is NO LONGER IGNORED.

    What the...?

    Is this a bug in MyFaces Tomahawk or is there something subtle going on here that I'm missing?


    Wally Hartshorn
     
    I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
     
    subject: MyFaces Tomahawk ignores checkbox in dataList on first submission
     
    Similar Threads
    How do you implement Tomahawk tree control with a CheckBox?
    how to set checked to checkbox and radio button
    Generating Horizontal Menu in JSF using h:dataTable
    How do I require at least one boolean checkbox to be checked?
    required field...but only if enabled