You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Marcus Schmidke <ma...@prosystemsit.de> on 2006/07/20 08:49:57 UTC

[Tomahawk] Using "inputCalendar" component

Hello again,

quite beginner, I am tumbling from one problem into the next.

I'm trying to use the inputCalendar component (non-popup). It displays
fine. The value binding works fine.

The page containing displays a set of records corresponding to the
currently selected date. In the future, data in that records shall be
editable, but I'm not so far by now. Just displaying.

For the moment I am trying to implement the logic to load new records when
another day is selected.

I've added a valueChangeListener to the inputCalendar component. This works
fine, but valueChangeListeners are called before the values are set into
the bindings. Ok, in the event I have the new date, so I could load the new
records. But this would only be a solution for the moment. In the future,
there are much more values to be applied (the coming up input fields)
before the new records may be loaded.

So I want to have an event which occurs after the value applying has
completed.

Perhaps an action method would be the right place to load the new day.

But unfortunately, I cannot bind an action method to the inputCalendar
component, right?

I think it is a really really beginner question, but I'm migrating from a
WebApp Framework where everything was totally different (Apple WebObjects),
so I have a lot of trouble understanding the basic things. Sorry for this,
but I would be very glad, if you could help me!!

Regards,

Marcus.

_____________________________________________________________________
prosystems IT GmbH
Anwendungsentwicklung
Postfach 31 51
53021 Bonn (Germany)

Tel: 0228 / 3366 - 3329, Fax: 0228 / 3366 - 73329
mailto:Marcus.Schmidke@prosystemsIT.de http://www.prosystemsIT.de
Amtsgericht Bonn - HR B 13189



Re: [Tomahawk] Using "inputCalendar" component

Posted by Mike Kienenberger <mk...@gmail.com>.
On 7/20/06, Marcus Schmidke <ma...@prosystemsit.de> wrote:
> For the moment I am trying to implement the logic to load new records when
> another day is selected.
>
> I've added a valueChangeListener to the inputCalendar component. This works
> fine, but valueChangeListeners are called before the values are set into
> the bindings. Ok, in the event I have the new date, so I could load the new
> records. But this would only be a solution for the moment. In the future,
> there are much more values to be applied (the coming up input fields)
> before the new records may be loaded.
>
> So I want to have an event which occurs after the value applying has
> completed.
>
> Perhaps an action method would be the right place to load the new day.
>
> But unfortunately, I cannot bind an action method to the inputCalendar
> component, right?

I think there's a couple of different ways you could do this.
One would be to have your form submitted when the value changes.   You
may not need the result to be so immediate, however.

http://wiki.apache.org/myfaces/SubmitPageOnValueChange

The second is to use StateChangedNotifier.   This is probably what you
want, but I can't find the documentation for it offhand.   It's a
sandbox component.

http://www.irian.at/myfaces-sandbox/stateChangedNotifier.jsf

> I think it is a really really beginner question, but I'm migrating from a
> WebApp Framework where everything was totally different (Apple WebObjects),
> so I have a lot of trouble understanding the basic things. Sorry for this,
> but I would be very glad, if you could help me!!

Actually, WebObjects isn't all that much different.    The components
are different, but conceptionally most of how it works is the same --
it's just harder to do the same things in JSF.   You'll probably find
it easier to convert WebObject pages into JSF/facelet pages since the
templating and composition capabilities are similar.

Basically each of your WO page classes can be made into a page-scoped
bean (use a request-scoped bean and t:saveState on your new class
bean).

If you're not yet committed to JSF, you might take a look at Click
(http://click.sourceforge.net/) as an alternative -- the WO port
should be much easier.