• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

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

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Grow a forest with seedballs and this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic