FAQ
Hi Julien,

Since a x:datalist do not have columns you may not use h:column in a
datalist.

<x:dataList value="#{AlbumsAction.albums}" var="item"
layout="unorderedList">
<h:outputText value="#{item.value.album_date}"/>
</x:dataList>

Mathias
-----Original Message-----
From: Julien Martin
Sent: Wednesday, May 25, 2005 5:00 PM
To: MyFaces Discussion
Subject: x:dataList component


Hello,

I use the x:dataList component. Note that I want to display a
hashmap. Using
the forEach tag I would have something like that:
[code]
<c:out value="${item.value.album_date}"/>
[/code]

but because I use the x:dataList I have a h:outputText
instead of the c:out.
Here it is:

[code]
<h:outputText value="#{item.value.album_date}"/>
[/code]

This does not seem to work. I just get the list's bullet with
nothing else.
Here is the full code:

[code]
<x:dataList value="#{AlbumsAction.albums}" var="item"
layout="unorderedList">
<h:column>
<h:outputText value="#{item.value.album_date}"/>
</h:column>
</x:dataList>
[/code]

Can anyone help please?

Thanks in advance,

Julien.

Search Discussions

  • Julien Martin at May 25, 2005 at 3:08 pm
    Thanks for the prompt reply,

    I have removed the columns as indicated and I now have this:

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    It has the same behavior i.e. an empty bullet (there is only one element as
    of now) with nothing else...

    Julien.


    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:04 PM
    Subject: RE: dataList component


    Hi Julien,

    Since a x:datalist do not have columns you may not use h:column in a
    datalist.

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:00 PM
    To: MyFaces Discussion
    Subject: x:dataList component


    Hello,

    I use the x:dataList component. Note that I want to display a
    hashmap. Using
    the forEach tag I would have something like that:
    [code]
    <c:out value="${item.value.album_date}"/>
    [/code]

    but because I use the x:dataList I have a h:outputText
    instead of the c:out.
    Here it is:

    [code]
    <h:outputText value="#{item.value.album_date}"/>
    [/code]

    This does not seem to work. I just get the list's bullet with
    nothing else.
    Here is the full code:

    [code]
    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:column>
    <h:outputText value="#{item.value.album_date}"/>
    </h:column>
    </x:dataList>
    [/code]

    Can anyone help please?

    Thanks in advance,

    Julien.

  • Broekelmann, Mathias at May 25, 2005 at 3:22 pm
    Do you get any warning messages from the variable resolver regarding
    null values?
    Verify through a breakpoint in getAlbum_date() that the method is
    called.

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:09 PM
    To: MyFaces Discussion
    Subject: Re: dataList component


    Thanks for the prompt reply,

    I have removed the columns as indicated and I now have this:

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    It has the same behavior i.e. an empty bullet (there is only
    one element as
    of now) with nothing else...

    Julien.


    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:04 PM
    Subject: RE: dataList component


    Hi Julien,

    Since a x:datalist do not have columns you may not use h:column in a
    datalist.

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:00 PM
    To: MyFaces Discussion
    Subject: x:dataList component


    Hello,

    I use the x:dataList component. Note that I want to display a
    hashmap. Using
    the forEach tag I would have something like that:
    [code]
    <c:out value="${item.value.album_date}"/>
    [/code]

    but because I use the x:dataList I have a h:outputText
    instead of the c:out.
    Here it is:

    [code]
    <h:outputText value="#{item.value.album_date}"/>
    [/code]

    This does not seem to work. I just get the list's bullet with
    nothing else.
    Here is the full code:

    [code]
    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:column>
    <h:outputText value="#{item.value.album_date}"/>
    </h:column>
    </x:dataList>
    [/code]

    Can anyone help please?

    Thanks in advance,

    Julien.


  • Julien Martin at May 25, 2005 at 3:29 pm
    Mathias,
    You're right. I added a System.out.println in the javabean and the getter
    method is never called. I am puzzled. Any clue?
    Julien.

    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:22 PM
    Subject: RE: dataList component


    Do you get any warning messages from the variable resolver regarding
    null values?
    Verify through a breakpoint in getAlbum_date() that the method is
    called.

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:09 PM
    To: MyFaces Discussion
    Subject: Re: dataList component


    Thanks for the prompt reply,

    I have removed the columns as indicated and I now have this:

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    It has the same behavior i.e. an empty bullet (there is only
    one element as
    of now) with nothing else...

    Julien.


    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:04 PM
    Subject: RE: dataList component


    Hi Julien,

    Since a x:datalist do not have columns you may not use h:column in a
    datalist.

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:00 PM
    To: MyFaces Discussion
    Subject: x:dataList component


    Hello,

    I use the x:dataList component. Note that I want to display a
    hashmap. Using
    the forEach tag I would have something like that:
    [code]
    <c:out value="${item.value.album_date}"/>
    [/code]

    but because I use the x:dataList I have a h:outputText
    instead of the c:out.
    Here it is:

    [code]
    <h:outputText value="#{item.value.album_date}"/>
    [/code]

    This does not seem to work. I just get the list's bullet with
    nothing else.
    Here is the full code:

    [code]
    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:column>
    <h:outputText value="#{item.value.album_date}"/>
    </h:column>
    </x:dataList>
    [/code]

    Can anyone help please?

    Thanks in advance,

    Julien.


  • Alex at May 25, 2005 at 3:55 pm

    Julien Martin wrote:
    Mathias,
    You're right. I added a System.out.println in the javabean and the getter
    method is never called. I am puzzled. Any clue?
    Julien
    Hi,

    so, from one of your previous posts I assume that #{AlbumsAction.albums}
    returns a Map (what kind of map is unimportant), am I right???
    If this is the case, it cannot work, cause the dataList has nothing to
    iterate over.

    [code]
    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:column>
    <h:outputText value="#{item.value.album_date}"/>
    </h:column>
    </x:dataList>
    [/code]


    #{AlbumsAction.albums} should either return a List of Map.Entries so you
    could enter the value with item.value.someproperty

    Or your class AlbumsAction should return a List of the key-values like this
    public List getAlbumKeys() {
    return new List(albums.keySet());
    }

    Then you could do as follows:

    <x:dataList value="#{AlbumsAction.albumKeys}" var="item"
    layout="unorderedList">
    <h:outputText value="#{AlbumsAction.album.key.someproperty}" />
    //maybe #{AlbumsAction[album][key]['someproperty']}
    </x:dataList>

    Regards
    Alex
  • Broekelmann, Mathias at May 25, 2005 at 3:39 pm
    Verify that your managed bean AlbumsAction contains a method like

    public List|Object[]|DataModel getAlbums() {...}

    The Collection which is returned by getAlbums() must contain instances
    which implement a method like

    public Object getValue() {...}

    This method must return an instance which implements a method like

    public Object getAlbum_date() {...}

    Check if lower/upper case is a problem.

    Try to define a breakpoint in each method.

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:30 PM
    To: MyFaces Discussion
    Subject: Re: dataList component


    Mathias,
    You're right. I added a System.out.println in the javabean
    and the getter
    method is never called. I am puzzled. Any clue?
    Julien.

    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:22 PM
    Subject: RE: dataList component


    Do you get any warning messages from the variable resolver regarding
    null values?
    Verify through a breakpoint in getAlbum_date() that the method is
    called.

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:09 PM
    To: MyFaces Discussion
    Subject: Re: dataList component


    Thanks for the prompt reply,

    I have removed the columns as indicated and I now have this:

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    It has the same behavior i.e. an empty bullet (there is only
    one element as
    of now) with nothing else...

    Julien.


    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:04 PM
    Subject: RE: dataList component


    Hi Julien,

    Since a x:datalist do not have columns you may not use h:column in a
    datalist.

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:00 PM
    To: MyFaces Discussion
    Subject: x:dataList component


    Hello,

    I use the x:dataList component. Note that I want to display a
    hashmap. Using
    the forEach tag I would have something like that:
    [code]
    <c:out value="${item.value.album_date}"/>
    [/code]

    but because I use the x:dataList I have a h:outputText
    instead of the c:out.
    Here it is:

    [code]
    <h:outputText value="#{item.value.album_date}"/>
    [/code]

    This does not seem to work. I just get the list's bullet with
    nothing else.
    Here is the full code:

    [code]
    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:column>
    <h:outputText value="#{item.value.album_date}"/>
    </h:column>
    </x:dataList>
    [/code]

    Can anyone help please?

    Thanks in advance,

    Julien.



  • Julien Martin at May 25, 2005 at 3:58 pm
    Hello,
    I have checked everything. The constructor gets called ok but not the
    getters. By the way the getAlbums method returns a parametized Map.
    (Map<Integer, Album>).
    Julien.

    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:39 PM
    Subject: RE: dataList component


    Verify that your managed bean AlbumsAction contains a method like

    public List|Object[]|DataModel getAlbums() {...}

    The Collection which is returned by getAlbums() must contain instances
    which implement a method like

    public Object getValue() {...}

    This method must return an instance which implements a method like

    public Object getAlbum_date() {...}

    Check if lower/upper case is a problem.

    Try to define a breakpoint in each method.

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:30 PM
    To: MyFaces Discussion
    Subject: Re: dataList component


    Mathias,
    You're right. I added a System.out.println in the javabean
    and the getter
    method is never called. I am puzzled. Any clue?
    Julien.

    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:22 PM
    Subject: RE: dataList component


    Do you get any warning messages from the variable resolver regarding
    null values?
    Verify through a breakpoint in getAlbum_date() that the method is
    called.

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:09 PM
    To: MyFaces Discussion
    Subject: Re: dataList component


    Thanks for the prompt reply,

    I have removed the columns as indicated and I now have this:

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    It has the same behavior i.e. an empty bullet (there is only
    one element as
    of now) with nothing else...

    Julien.


    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:04 PM
    Subject: RE: dataList component


    Hi Julien,

    Since a x:datalist do not have columns you may not use h:column in a
    datalist.

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:00 PM
    To: MyFaces Discussion
    Subject: x:dataList component


    Hello,

    I use the x:dataList component. Note that I want to display a
    hashmap. Using
    the forEach tag I would have something like that:
    [code]
    <c:out value="${item.value.album_date}"/>
    [/code]

    but because I use the x:dataList I have a h:outputText
    instead of the c:out.
    Here it is:

    [code]
    <h:outputText value="#{item.value.album_date}"/>
    [/code]

    This does not seem to work. I just get the list's bullet with
    nothing else.
    Here is the full code:

    [code]
    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:column>
    <h:outputText value="#{item.value.album_date}"/>
    </h:column>
    </x:dataList>
    [/code]

    Can anyone help please?

    Thanks in advance,

    Julien.



  • Broekelmann, Mathias at May 25, 2005 at 4:03 pm
    Julien,

    Alex is right. You can´t use a map in that way. Try the solution from Alex to solve your problem.

    Mathias

    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:59 PM
    To: MyFaces Discussion
    Subject: Re: dataList component


    Hello,
    I have checked everything. The constructor gets called ok but not the
    getters. By the way the getAlbums method returns a parametized Map.
    (Map<Integer, Album>).
    Julien.

    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:39 PM
    Subject: RE: dataList component


    Verify that your managed bean AlbumsAction contains a method like

    public List|Object[]|DataModel getAlbums() {...}

    The Collection which is returned by getAlbums() must contain instances
    which implement a method like

    public Object getValue() {...}

    This method must return an instance which implements a method like

    public Object getAlbum_date() {...}

    Check if lower/upper case is a problem.

    Try to define a breakpoint in each method.

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:30 PM
    To: MyFaces Discussion
    Subject: Re: dataList component


    Mathias,
    You're right. I added a System.out.println in the javabean
    and the getter
    method is never called. I am puzzled. Any clue?
    Julien.

    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:22 PM
    Subject: RE: dataList component


    Do you get any warning messages from the variable resolver regarding
    null values?
    Verify through a breakpoint in getAlbum_date() that the method is
    called.

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:09 PM
    To: MyFaces Discussion
    Subject: Re: dataList component


    Thanks for the prompt reply,

    I have removed the columns as indicated and I now have this:

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    It has the same behavior i.e. an empty bullet (there is only
    one element as
    of now) with nothing else...

    Julien.


    ----- Original Message -----
    From: "Broekelmann, Mathias" <MBroekelmann@PSI.DE>
    To: "MyFaces Discussion" <users@myfaces.apache.org>
    Sent: Wednesday, May 25, 2005 5:04 PM
    Subject: RE: dataList component


    Hi Julien,

    Since a x:datalist do not have columns you may not use
    h:column in a
    datalist.

    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:outputText value="#{item.value.album_date}"/>
    </x:dataList>

    Mathias
    -----Original Message-----
    From: Julien Martin
    Sent: Wednesday, May 25, 2005 5:00 PM
    To: MyFaces Discussion
    Subject: x:dataList component


    Hello,

    I use the x:dataList component. Note that I want to display a
    hashmap. Using
    the forEach tag I would have something like that:
    [code]
    <c:out value="${item.value.album_date}"/>
    [/code]

    but because I use the x:dataList I have a h:outputText
    instead of the c:out.
    Here it is:

    [code]
    <h:outputText value="#{item.value.album_date}"/>
    [/code]

    This does not seem to work. I just get the list's bullet with
    nothing else.
    Here is the full code:

    [code]
    <x:dataList value="#{AlbumsAction.albums}" var="item"
    layout="unorderedList">
    <h:column>
    <h:outputText value="#{item.value.album_date}"/>
    </h:column>
    </x:dataList>
    [/code]

    Can anyone help please?

    Thanks in advance,

    Julien.




Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesmyfaces
postedMay 25, '05 at 3:04p
activeMay 25, '05 at 4:03p
posts8
users3
websitemyfaces.apache.org

People

Translate

site design / logo © 2019 Grokbase