You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by SiSi'mon <s_...@purpleblade.net> on 2007/06/12 20:01:50 UTC

how to get ordered list to work? problems with dataList

I have the following:

---
    <t:dataList id="String"
                styleClass="my-text"
                itemStyleClass="my-text"
                var="String"
                value="List"
                layout="orderedList"
                rowCountVar="int"
                rowIndexVar="int">

        <h:outputText
                value="Item1"/>

        <h:outputText
                value="Item2"/>
    </t:dataList>
---
With this I get the following on the web page:

1.  Item1Item2

any ideas why Item2 is not put on a new line like
2.  Item2

??

thanks


Si'mon
-- 
View this message in context: http://www.nabble.com/how-to-get-ordered-list-to-work--problems-with-dataList-tf3909067.html#a11083805
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: how to get ordered list to work? problems with dataList

Posted by Andrew Robinson <an...@gmail.com>.
> The example I saw on the myfaces website had exactly what I entered below
> that I was having problems with.  Is the documentation incorrect?
Sounds like it may be

> Also does this mean that my strings must be defined/declared in the backing
> bean and not in the xhtml?
Yes, the entire purpose of data list is to iterate over a java collection

> Is there a way to have the messages in the XHTML?  With this solution I must
> provide the messages in the backing bean only.
Messages? I presume you mean the value. The value must come from EL,
that is the entire purpose of data list (just like datatable). If you
want an order list of components just do this:

<ol>
  <li><h:outputText value="option 1" /></li>
  <li><h:outputText value="option 2" /></li>
</ol>

>
> thanks
>
>
> Si'mon
>
>
>
> Andrew Robinson-5 wrote:
> >
> > You told data list to put two pieces of text in each loop of "Item1 Item2"
> >
> > You want the equivalent of:
> >
> > public String[] getItems() { return new String[] { "Item1", "Item2" }; }
> >
> > <t:dataList var="_item" value="#{myBean.items}" layout="orderedList">
> >   <h:outputText value="#{_item}" />
> > </t:dataList>
> >
> > On 6/12/07, SiSi'mon <s_...@purpleblade.net> wrote:
> >>
> >> I have the following:
> >>
> >> ---
> >>     <t:dataList id="String"
> >>                 styleClass="my-text"
> >>                 itemStyleClass="my-text"
> >>                 var="String"
> >>                 value="List"
> >>                 layout="orderedList"
> >>                 rowCountVar="int"
> >>                 rowIndexVar="int">
> >>
> >>         <h:outputText
> >>                 value="Item1"/>
> >>
> >>         <h:outputText
> >>                 value="Item2"/>
> >>     </t:dataList>
> >> ---
> >> With this I get the following on the web page:
> >>
> >> 1.  Item1Item2
> >>
> >> any ideas why Item2 is not put on a new line like
> >> 2.  Item2
> >>
> >> ??
> >>
> >> thanks
> >>
> >>
> >> Si'mon
> >> --
> >> View this message in context:
> >> http://www.nabble.com/how-to-get-ordered-list-to-work--problems-with-dataList-tf3909067.html#a11083805
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/how-to-get-ordered-list-to-work--problems-with-dataList-tf3909067.html#a11093685
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Re: how to get ordered list to work? problems with dataList

Posted by SiSi'mon <s_...@purpleblade.net>.
The example I saw on the myfaces website had exactly what I entered below
that I was having problems with.  Is the documentation incorrect?

Also does this mean that my strings must be defined/declared in the backing
bean and not in the xhtml?

Is there a way to have the messages in the XHTML?  With this solution I must
provide the messages in the backing bean only.

thanks


Si'mon



Andrew Robinson-5 wrote:
> 
> You told data list to put two pieces of text in each loop of "Item1 Item2"
> 
> You want the equivalent of:
> 
> public String[] getItems() { return new String[] { "Item1", "Item2" }; }
> 
> <t:dataList var="_item" value="#{myBean.items}" layout="orderedList">
>   <h:outputText value="#{_item}" />
> </t:dataList>
> 
> On 6/12/07, SiSi'mon <s_...@purpleblade.net> wrote:
>>
>> I have the following:
>>
>> ---
>>     <t:dataList id="String"
>>                 styleClass="my-text"
>>                 itemStyleClass="my-text"
>>                 var="String"
>>                 value="List"
>>                 layout="orderedList"
>>                 rowCountVar="int"
>>                 rowIndexVar="int">
>>
>>         <h:outputText
>>                 value="Item1"/>
>>
>>         <h:outputText
>>                 value="Item2"/>
>>     </t:dataList>
>> ---
>> With this I get the following on the web page:
>>
>> 1.  Item1Item2
>>
>> any ideas why Item2 is not put on a new line like
>> 2.  Item2
>>
>> ??
>>
>> thanks
>>
>>
>> Si'mon
>> --
>> View this message in context:
>> http://www.nabble.com/how-to-get-ordered-list-to-work--problems-with-dataList-tf3909067.html#a11083805
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/how-to-get-ordered-list-to-work--problems-with-dataList-tf3909067.html#a11093685
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: how to get ordered list to work? problems with dataList

Posted by Andrew Robinson <an...@gmail.com>.
You told data list to put two pieces of text in each loop of "Item1 Item2"

You want the equivalent of:

public String[] getItems() { return new String[] { "Item1", "Item2" }; }

<t:dataList var="_item" value="#{myBean.items}" layout="orderedList">
  <h:outputText value="#{_item}" />
</t:dataList>

On 6/12/07, SiSi'mon <s_...@purpleblade.net> wrote:
>
> I have the following:
>
> ---
>     <t:dataList id="String"
>                 styleClass="my-text"
>                 itemStyleClass="my-text"
>                 var="String"
>                 value="List"
>                 layout="orderedList"
>                 rowCountVar="int"
>                 rowIndexVar="int">
>
>         <h:outputText
>                 value="Item1"/>
>
>         <h:outputText
>                 value="Item2"/>
>     </t:dataList>
> ---
> With this I get the following on the web page:
>
> 1.  Item1Item2
>
> any ideas why Item2 is not put on a new line like
> 2.  Item2
>
> ??
>
> thanks
>
>
> Si'mon
> --
> View this message in context: http://www.nabble.com/how-to-get-ordered-list-to-work--problems-with-dataList-tf3909067.html#a11083805
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>