myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Büttner <buettner.mar...@gmail.com>
Subject Re: Ajax update of a composite component within ui:repeat doesn't work
Date Tue, 17 Apr 2012 07:39:40 GMT
Thx Leonardo!

I've patched your fix locally an it works. But I think you mean line 728
instead of 714.

I created an Issue:
https://issues.apache.org/jira/browse/MYFACES-3527

Regards,
Buett

2012/4/16 Leonardo Uribe <lu4242@gmail.com>

> Hi
>
> It seems there is a bug inside _setRowIndex() line 714:
>
> _initialDescendantComponentState = saveDescendantComponentStates(this,
> false, false);
>
> should be
>
> _initialDescendantComponentState = saveDescendantComponentStates(this,
> true, true);
>
> Since all content of a composite component is inside a facet, the
> state for that facet is not saved and it should be.
>
> A fast workaround is wrap all content of ui:repeat inside a
> h:panelGroup. (not tested yet). Please create the issue and I'll fix
> it.
>
> regards,
>
> Leonardo Uribe
>
> 2012/4/16 Mark Struberg <struberg@yahoo.de>:
> > Hi Leo!
> >
> > Did you also try the stuff with composite components inside ui:repeat?
> >
> > Default components seem to work, but composite components are probably
> broken.
> >
> >
> > Buett will upload a sample code later today.
> >
> > LieGrue,
> > strub
> >
> >
> > ----- Original Message -----
> >> From: Leonardo Uribe <lu4242@gmail.com>
> >> To: MyFaces Discussion <users@myfaces.apache.org>
> >> Cc:
> >> Sent: Monday, April 16, 2012 6:32 PM
> >> Subject: Re: Ajax update of a composite component within ui:repeat
> doesn't work
> >>
> >> Hi
> >>
> >> There was two issues solved in 2.1.7 related to ui:repeat:
> >>
> >> https://issues.apache.org/jira/browse/MYFACES-3415
> >>
> >> [ui:repeat] field value disappears if validation error exists on
> current site
> >>
> >> https://issues.apache.org/jira/browse/MYFACES-3463
> >>
> >> Refactor UIRepeat code to implement PSS algorithm like UIData and fix
> >> state behavior
> >>
> >> The code taken from UIData has been already tested and there are some
> >> junit tests for ui:repeat, so in theory it should work.
> >>
> >> regards,
> >>
> >> Leonardo Uribe
> >>
> >> 2012/4/16 Marcus Büttner <buettner.marcus@gmail.com>:
> >>>  Hi,
> >>>
> >>>  This following example works with MyFaces 2.1.6 but not with 2.1.7.
> >>>
> >>>  mycc.xhtml:
> >>>  <cc:interface>
> >>>     <cc:attribute name="state"
> >> type="ExampleModel.State"/>
> >>>  </cc:interface>
> >>>
> >>>  <cc:implementation>
> >>>     <h:selectBooleanCheckbox
> >> value="#{cc.attrs.state.state}">
> >>>         <f:ajax execute="@this" render="@form"/>
> >>>     </h:selectBooleanCheckbox>
> >>>     <h:outputText value="State: #{cc.attrs.state.state}"/>
> >>>  </cc:implementation>
> >>>
> >>>
> >>>  example.xhtml:
> >>>  <h:form id="form">
> >>>     <ui:repeat value="#{example.states}"
> >> var="state">
> >>>         <my:mycc state="#{state}"/>
> >>>     </ui:repeat>
> >>>     <my:mycc state="#{example.state}"/>
> >>>  </h:form>
> >>>
> >>>  In debugger I saw the submitted value of the checkbox is set but this
> state
> >>>  is overridden a little bit later by
> >>>  UIRepeate#restoreDescendantComponentStates method which is triggered
> by
> >>>  UIRepeat#setIndex which is called by UIRepeat#visitTree.
> >>>
> >>>  Any ideas?
> >>>
> >>>  Regards,
> >>>  Marcus
> >>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message