This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

The updated value of a class reference - updated in JSF validator - is not reflected in the XHTML  RSS feed

 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following XHTML which gets included in another XHTML.




This is the validator code I am using for validating a desired entity on click of a button contained in the XHTML in which the above shown XHTML is included.




This is the abstract class whose subclass's instance is being obtained using WebUtils.getElValue("#{cartBean}");
in method validateDeliveryTypeCoupon(GenericAS400Coupon genericAS400Coupon) above.



What is happening is after the code gets executed in method above
in which I am doing so as to disable the checkboxes being rendered in the XHTML shown above.



After the validator's validate(..) method is executed I am re-rendering the panel "deliveryInfoDetails".

The problem I am facing is even though I am setting the cartBean's deliveryInfo's deliveryOptionBean's deliveryMode property as null so that the
checkboxes gets disabled but the "deliveryMode" instance state remains intact after applying the validator, as it was before applying the validator.

I inspected the "cartBean" instance by printing its default toString() implementation method.The instance which I am getting in the validator
is the same I am getting in the XHTML when I print it using .
Now since the TruDeliveryInfoBean.getDeliveryOptionsSorted() is a collection of DeliveryOptionBean instances so I have just updated the reference
so it should get reflected in the XHTML too.But that is not happening.

Following is the configuration of TruCartBean in faces-config.xml



Don't know where it is going wrong.Any inputs/guidance would be a great help.

 
Ilari Moilanen
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First I would make tests with code that is a lot less complex than this. I think that I understood what your code does, but I guess you are not getting any answers since you have so much unnecessary data and code shown that the real problem is very hard to understand.
Why for example you are telling about the validator if you really want to update some field inside a loop to disabled state? Or is the validator itself doing the update? Are you sure that it is the right way to do that? As I said, the code is hard to understand. Validation is performed before the actual action gets executed and if validation fails then the action itself never gets executed. But you know that. At least you can try to add more debugs throughout the code to see if everything happens in the same order and way you presume it does.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!