Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to add Ajax4jsf support to custom JSF component?

Daniel Lechner
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I just created a new JSF component, which consists of two input fields. One for the date input and one for the time.
The Renerer-Class is quite nice:

Everything works fine so far and I can use the component in my xhtml-file:

When I send the form, the converters convert the input and the backing bean is updated. It works like expected.

But now, I want to add support for a4j to enable something like this:

When the user changes the input of one of the input fields, the backing-bean has to be updated and the calendarDisplay, displaying the selected date, should be updated as well.

But how can I do that? First of all: how can I fire an event like "onchange", so that the a4j-Tag is working and the reRender is done? Do I have to do something else to update the backing bean (before), when the input changes?

Many thanks in advance for your answers!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic