myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Korherr <jakob.korh...@gmail.com>
Subject Re: General JSF 1.2 + Facelets question
Date Wed, 23 Dec 2009 14:00:54 GMT
Hi Bart,

Actually he uses JSF 1.2. I just looked that part up in the newest doc (JSF
2.0).

Regards,
Jakob

2009/12/23 Bart Kummel <bkummel@gmail.com>

> Hi Surija,
>
> Am I getting you right? Are you using Facelets 1.1.14 with a JSF 2.0
> implementation? That's weird, as JSF 2.0 includes a newer version of
> Facelets. You shouldn't use a separate Facelets lib when using JSF 2.0.
>
> Regards,
> Bart Kummel
>
> On Fri, Dec 18, 2009 at 16:22, Luka Surija <luka@iytim.hr> wrote:
>
> > Yeah, it works. Thank you.
> >
> > I'm just wondering the behavior is changed between facelets 1.1.13 and
> > 1.1.14?
> >
> > Luka Surija
> >
> >
> >
> > Jakob Korherr wrote:
> >
> >> Hi Luka,
> >>
> >> The JSF 2.0 specification only explains that when attaching a
> >> <f:setPropertyActionListener>, an ActionListener (with specific
> behavior)
> >> should be created and added to the nesting UIComponent (which has to
> >> implement ActionSource) with addActionListener().
> >>
> >> From my point of view it is not clear which is added first, the action
> >> listener from the tag attribute »actionListener« or the nested action
> >> listener(s), but I think the order is: first tag attributes, then nested
> >> tags.
> >>
> >> You can try to work around this problem using <f:actionListener /> below
> >> <f:setPropertyActionListener> instead of the tag attribute
> >> »actionListener«,
> >> so that it will be added to the UIComponent after
> >> <f:setPropertyActionListener> and thus executed after
> >> <f:setPropertyActionListener>.
> >>
> >> I hope this works for you.
> >>
> >> Regards,
> >>
> >> Jakob Korherr
> >>
> >>
> >> 2009/12/16 Luka Surija <lukaXremoveX@iytim.hr>
> >>
> >>
> >>
> >>> It looks like i'm not familiar with JSF as much as I've thought.  What
> is
> >>> the expected behavior  in JSF 1.2 + Facelets for
> >>> f:setPropertyActionListener?
> >>>
> >>> code:
> >>>
> >>> <h:panelGroup rendered="#{PersonMB.person == null}">
> >>>  <h:dataTable value="#{PersonMB.allPersons}" var="item" >
> >>>  <h:column>
> >>>    <f:facet name="header">Name</f:facet>
> >>>    #{item.name}
> >>>  </h:column>                     <h:column>
> >>>    <h:commandLink value="Edit" actionListener="#{PersonMB.edit}" >
> >>>      <f:setPropertyActionListener value="#{item}"
> >>> target="#{PersonMB.person}" />
> >>>    </h:commandLink>
> >>>  </h:column>
> >>>  <h:column>
> >>>    <h:commandLink actionListener="#{PersonMB.delete}" value="Delete"
>
> >>>      <f:setPropertyActionListener value="#{item}"
> >>> target="#{PersonMB.person}" />
> >>>    </h:commandLink>
> >>>  </h:column>
> >>>  </h:dataTable>
> >>>  <h:commandLink onclick="dialog.show()"
> >>> actionListener="#{PersonMB.createPerson}" value="New person" />
> >>>  <br />
> >>>  <h:commandLink actionListener="#{PersonMB.reload}" value="Reload" />
> >>> </h:panelGroup>
> >>>
> >>> PersonMB:
> >>>   @EJB
> >>>   PersonController controller;
> >>>
> >>>   private Person person;
> >>>
> >>>   public Person getPerson(){
> >>>     return person;
> >>>   }
> >>>    public void setPerson(Person _person){
> >>>     this.person=_person;
> >>>   }
> >>>
> >>>  public void delete(ActionEvent event){
> >>>     controller.delete(person);
> >>>  }
> >>>
> >>> So here are two possible scenarios:
> >>> case #1: actionListener "delete" executes BEFORE
> >>> f:setPropertyActionListener sets value "item" to "person"
> >>> case #2: actionListener "delete" executes AFTER
> >>> f:setPropertyActionListener
> >>> sets value "item" to "person"
> >>>
> >>> ....
> >>>
> >>> In case #1 action listener "delete" isn't executed as expected because
> >>> "person" is null, but in case #2 function is executed properly.
> >>>
> >>> Why I'm asking this?
> >>> Till facelets version 1.1.14+trinidad and back on old Oracle ADF Faces
> >>> all
> >>> my applications behaved as described in scenario case #2, BUT with
> >>> trinidad+facelets 1.1.14 or IceFaces 1.8.x and now JSF 2.0 (mojarra)
> >>> behavior changed to scenario case #1.
> >>>
> >>> What is the proper behavior according to specification ?
> >>>
> >>> Best regards,
> >>>
> >>> Luka Surija
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >
>

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