You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by Laurie Harper <la...@holoweb.net> on 2006/09/01 04:49:23 UTC
selectOneChoice as action source
I have a table showing row items with editable fields in some colums.
The idea is that the row items can be edited 'in place' for simple
updates. I also need to support a number of additional options,
including a full-page edit dialog, for each row.
Because there are a number of possible actions, I'd like to use a
selectOneChoice component to create a 'menu', and have a user
selection trigger the appropriate action. I have this mostly working
by setting autosubmit="true", partialTriggers="x", id="x",
valueChangeListener="y". The value change listener clears the
component value and launches the appropriate dialog, passing the
model data object for the current row as a dialog parameter.
The problem is, the valueChangeListener method gets invoked during
Apply Request Values. At this point, the model object hasn't been
updated yet, so any 'in place edits' are not reflected in the object
that's passed to the dialog.
What I need to do is defer fetching the row data and launching the
dialog until after the Update Model Values phase -- but neither
Update Model Values nor Invoke Application get fired --presumably
because no events have been queued for those phases?
I thought I could either call setPhaseId(PhaseId.INVOKE_APPLICATION)
on the ValueChangeEvent and/or call getViewRoot().queueEvent() to
force processing to be deferred until later in the life-cycle, but I
haven't been able to get that working.
Am I thinking about this all wrong? I suspect I may be on the wrong
path entirely, given that if invalid inputs are supplied during 'in
place' editing, I wont be able to update a model object to pass to
the dialog anyway...
Any pointers would be most appreciated!
--
Laurie Harper
Open Source advocate, Java geek: http://www.holoweb.net/laurie
Founder, Zotech Software: http://www.zotechsoftware.com/