myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Müllan" <bierbra...@gmail.com>
Subject Re: RichList and SelectBooleanCheckbox
Date Tue, 12 Sep 2006 10:44:43 GMT
Hi,

sure, MyClass has to be declared as a managed bean in your faces-config.xml.

The t:updateActionListener should be used as follows:

<t:updateActionListener property="#{managedBean.itemId}" value="#{item.id}"/>

Just use it inside a commandLink like:

<h:commandLink value="someText" action="#{managedBean.goNextPage}">
     <t:updateActionListener property="#{managedBean.itemId}"
value="#{item.id}"/>
</h:commandLink>

With the help of this component, you know (via the id) in the backend
which entry was clicked on. You can also use an ActionListener to
accomplish this task.

cheers,

Gerald

On 9/12/06, sjarlier@stradefi.com <sjarlier@stradefi.com> wrote:
> Hi!
>
> Thanks for your help.
> I tried to use this dataTable tag as follow:
>
> <t:dataTable    value="#{MyClass.listToDisplay}"
>                                          var="item">
>
>         <f:facet name="Name">
>                   <f:verbatim>&amp;#160;</f:verbatim>
>         </f:facet>
>         <h:column>
>                           <h:outputText value="#{item.name}"/>
>         </h:column>
>         <h:column>
>                 <h:outputText value="#{item.firstname}"/>
>         </h:column>
> </t:dataTable>
>
> But I am getting this error: javax.faces.FacesException:
> org.apache.myfaces.config.MyfacesConfig
>
> Do I need to declare a bean or something in my xml configuration files to
> use it?
>
> And thus this t:updateActionListener will allow me to set a property of the
> current item? For exemple if I have a list of person and this person has a
> property Boolean authorized then this authorized for this precise person
> will be set to true for example?
>
> Thanks
> Sophie
>
> -----Message d'origine-----
> De: Thorbjørn Ravn Andersen [mailto:thunderaxiom@gmail.com]
> Envoyé: lundi 11 septembre 2006 21:25
> À: MyFaces Discussion
> Objet: Re: RichList and SelectBooleanCheckbox
>
> sjarlier@stradefi.com skrev  den 11-09-2006 17:02:
> > The problem I have now is that I would like the user to select some
> persons
> > in this list and getting the list of selected persons in my program. I was
> > thinking of putting a SelectBooleanCheckbox in front of each row of this
> > table but then I cannot get back the node associated to the checkbox. If I
> > am doing something like this:
> >
> > H:selectBooleanCheckbox id=ok value="#{r.personAuthorized}"
> >
> > Then this checkbox will be checked if r.personAuthorized is true but I
> will
> > not get the value of this checkbox in my nodes when leaving this page no?
> >
> >
> If you were using a h:dataTable I would suggest using the
> t:updateActionListener tag which allows you to set a property where the
> variable is available from the loop.
>
> Maybe it will work inside your package too?
>
> --
>   THorbjørn
>
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Mime
View raw message