• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Setting mutiple backing bean attributes from rich:calender component

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

I am very much a beginner with JSF and have been asked to do some dev work on an application (original devloper has left the company) and no one here knows JSF that well. So Its time for me to learn and get to grips with the framework.

I been working through quite well and googling and reading has normally found the answer to any problems, however im stuck on one particular probem.

I basically have the following rich:calender component below :



This works fine and sets the backing bean attrubute correctly (viewBooking.fromRange). However is it possible in JSF that this component can set "two" backing bean attributes"? I.E. After the user action I not only set (viewBooking.fromRange) but also (viewBooking.toRange) too?



 
Saloon Keeper
Posts: 24283
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Darren!

You can set the the "toRange" backing bean property by copying the "fromRange" property into it in your "resetForm" action method.

That's half the battle. However, presumably there's a separate calendar control that displays and controls "toRange", so your a4j:support tag needs to ensure that that control is updated in the View. Use the "reRender" attribute to indicate the id of that control so that it will be refreshed from the updated backing bean.
 
Darren Carter
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Thank you very much for the reply...

I was unable to put the logic into resetForm as the method is in the superclass of my backing bean (viewBookingBean)



What I have done is created an atrribute in my backing bean called fromToRange which sets two values I require



My form looks like this, which has thee rich calenders..



However when all three dates are filled in and I click the "Download data as CSV" button on the first form , all three setters are called wheres my values of fromRange and toRange are overwittten.



Is there a way that I can stop this from happening so that only the setters of the particular component are called (e.g setFromToRange )

Thnaks for the help :-)
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic