Good informtion. Thanks for tracking this down. The
updateActionListener would not have worked in my case as I have
multiple tables and they would each need to preserve the state if any
button in any list is clicked. But good to know.
It would be great with h:dataTable or at least t:dataTable to do as
you say by default, if validation is skipped, keep the row state for
rendering.
Thanks,
-Andrew
On 7/10/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
Just as an FYI, using preserveRowStates appears to work, but I don't
know what other problems it might cause. Here's what I'm considered
-- using updateActionListener and a variable to only set it when I
need it.
<t:dataTable
value="#{testcase.list}"
var="item"
preserveRowStates="#{testcase.preserveRowState}"
>
<h:column>
<t:inputText
id="projectName"
value="#{testcase.value}"/>
<h:commandButton
immediate="true"
value="Immediate Button
- loses value">
<t:updateActionListener
property="#{testcase.preserveRowState}"
value="#{true}" />
</h:commandButton>
<h:commandButton
immediate="false"
value="Non-Immediate
Button - preserves value">
<t:updateActionListener
property="#{testcase.preserveRowState}"
value="#{false}" />
</h:commandButton>
</h:column>
</t:dataTable>
On 7/8/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> Andrew,
>
> I'm hitting the same problem. I spent half of Friday trying to track
> it down, but I haven't solved it yet.
>
> So far, I've determined that it affects all UIData components
> (h:dataTable, t:dataTable, and t:dataList).
>
> I've also figured out that it has something to do with incorrectly
> restoring the row state for EditableValueHolders in the UIData during
> renderResponse. The UIData should render the submitted values, but
> those submitted values are wrong.
>
> During applyValues, the submitted values for the UIInputs are
> correctly set and restored, but during renderResponse, the submitted
> values for the UIInputs have mysteriously changed to null. I'm
> still trying to figure out why the restored table state isn't the same
> in all phases.
>
>
> On 6/30/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> > I had thought I had my problem of phases with UIData figured out, but I am
> > still having issues.
> > I have a data table with input controls in it (inputText for example).
> > Sometimes I lose data in these controls. Here are the use cases and the
> > associated issue:
> >
> > If action immediate set to true, I lose all my data in the data tables
> > If immediate is false my action never fires if a validation error occurs
> > (this is not what I want in this use case, I want my action to ALWAYS fire)
> > If I change the phase ID of the action to the validations phase, and there
> > are validation errors, everything works
> > If I chagne the phase ID of the action to the validations phase and there
> > are no validation errors, I lose my data in the table What I am trying to
> > figure out is the difference between #3 and #4.
> >
> > So, I have changed my action to execute during the processing of
> > validations. This allows me to run my code regardless of validation errors.
> > The side effect is if there are no validation errors, I still lose my data.
> >
> > Why would all my submitted values re-render in the data table when there are
> > validation errors, but not when there are not (I am skipping update model,
> > so in either case it never fires)?
> >
> > I can't see any difference in the code except that with validation errors
> > there is at least one UI component marked as not being valid, but that
> > doesn't seem like it should cause a behavior change with all components on
> > the whole page. If it does how does that work (I couldn't see any such
> > behavior in the code)?
> >
> > I really need to get this sorted out, so if someone could shed some light on
> > how UIData manages to have its child components render submitted values or
> > not I'd really appreciate it.
> >
> > Thanks,
> > Andrew
> >
> >
>