You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Sven Haiges <sv...@web.de> on 2005/11/01 12:42:09 UTC

PanelGrid with dynamic amount of items

Hi there,

I would like to render a panelGrid with an dynamic amount of items  in 
it. The items should be bound to a managed bean variable and based on 
the database result, the display should adapt.

PanelGrid worked fine with a static number of items, but how can I add 
a dynamic number of items. I know there are problems with c:forEach, 
that's probably why the example of my code below also does not work....


Any help is appreciated!

(one sec: I just got the idea to add the components on the server side, 
ok, but isn't there an easy solution that i can just do in my jsp 
page?)

Cheers,
Sven

	<h:panelGrid columns="4" frame="border">

		<c:forEach var='product' items='#{productSearchBean.queryResults}'>
				<h:outputText styleClass="contentRight" 
value="#{product.orderNumber}"/>	<f:verbatim> - </f:verbatim>
				<h:outputText styleClass="contentRight" 
value="#{product.description.titleEN}" rendered="#{view.locale.language 
eq 'en'}" />
				<h:outputText styleClass="contentRight" 
value="#{product.description.titleDE}" rendered="#{view.locale.language 
eq 'de'}" />
				<h:outputText styleClass="contentRight" 
value="#{product.description.titleFR}" rendered="#{view.locale.language 
eq 'fr'}" />
				<h:outputText styleClass="contentRight" 
value="#{product.description.titleES}" rendered="#{view.locale.language 
eq 'es'}" />
		</c:forEach>
		
	</h:panelGrid>
---
Sven Haiges
sven.haiges@gmx.de

TEL +49 89 420 958 993
SIP 8008878@sipgate.de
---
Sven Haiges
sven.haiges@gmx.de

TEL +49 89 420 958 993
SIP 8008878@sipgate.de

Re: PanelGrid with dynamic amount of items

Posted by Craig McClanahan <cr...@apache.org>.
On 11/5/05, Sven Haiges <sv...@web.de> wrote:
>
> i totally agree, but how do I SET children? that's why I used
> setParent, because there is no "set" method. how can I set the children
> of a component? if that works, then the dynamic panelGrid should be no
> problem...


UIComponent parent = ...; // The component you want to be the parent
UIComponent child = ...; // The component that will be the new child
parent.getChildren().add(child); // Implicitly hooks up in both directions

Note that since getChildren() returns a List, you can use any of the List
methods to manipulate it, such as iterating, sorting, or inserting into a
specific spot. For example, if you'd wanted the new child to be the first
one instead, you could have said:

parent.getChildren().add(0, child);

By the way, the same principle applies to the Map returned by
getAttributes() ... you are not restricted to just get() and put().

Craig

Re: PanelGrid with dynamic amount of items

Posted by Volker Weber <us...@weber-oldenburg.de>.
I wrote it before:

>
>                 replace
>                 text.setParent(this.productPanel);
>                 with
>                 this.productPanel.getChildren().add(text);


add the children to the list returned by getChildren().

If you simulate setChildren(list) with somthing like:

  List children = getChildren();
  children.clear();
  children.addAll(list);

regards
  Volker

Sven Haiges wrote:
> i totally agree, but how do I SET children? that's why I used setParent,
> because there is no "set" method. how can I set the children of a
> component? if that works, then the dynamic panelGrid should be no
> problem...
> 
> 
> Am 05.11.2005 um 17:15 Uhr schrieb Martin Marinschek:
> 
>     getChildren() is a method of UIComponentBase, so it must be available
>     in every JSF component.
> 
>     regards,
> 
>     Martin
> 
>     On 11/5/05, Sven Haiges <sv...@web.de> wrote:
> 
>         hmm, strange. that's what i tried to do. but i could not find a
>         getChildren() method... can you be more specific.
> 
>         in the meantime i switched to a datatable, but i would consider to
>         change it again.
>         thanx,
>         sven
>         Am 01.11.2005 um 15:58 Uhr schrieb Martin Marinschek:
> 
>             Oh right, I didn't even see that.
> 
>             Of course, you need to add the text to the children list of
>             the parent
>             component.
> 
>             regards,
> 
>             Martin
> 
>             On 11/1/05, Volker Weber <us...@weber-oldenburg.de>
>             wrote:
> 
>                 Hi,
> 
>                 Sven Haiges wrote:
> 
>                     thanx! i first wanted to try out the programmatic
>                     way. I bound a
>                     panelGrid to a managed bean property and once I get
>                     the result from
>                     the
>                     db, I add some outputText elements. the outputText
>                     is then added to
>                     the
>                     parent, I simply call setParent(productPanel) -
>                     productPanel is the
>                     panelGrid.
> 
>                     private HtmlPanelGrid productPanel = new
>                     HtmlPanelGrid();
> 
>                     ....
> 
>                     if (result != null) {
>                     log.debug("Rebuilding productPanel...");
>                     //this.queryResults = new ListDataModel(result);
>                     for (Iterator i = result.iterator(); i.hasNext();){
>                     log.debug("Adding outputtext to panelgrid... ");
>                     Product product = (Product)i.next();
>                     HtmlOutputText text = new HtmlOutputText();
>                     text.setValue(product.getOrderNumber());
>                     text.setParent(this.productPanel);
>                     }
> 
> 
>                 you don't need to set the parent of text, but you need
>                 to add the text
>                 as child to productPanel.
> 
>                 replace
>                 text.setParent(this.productPanel);
>                 with
>                 this.productPanel.getChildren().add(text);
> 
>                 than it shoud work.
> 
> 
> 
>                     I get the log output that some components were
>                     created, but nothing
>                     is
>                     shown when the page is rendered. Somehow the
>                     panelGrid is empty....
>                     so
>                     is it actually impossible to add elements with a
>                     method like
>                     panelGrid.addChildComponent(UIComponent...)??
> 
> 
>                 regards
>                 Volker
>                 -- 
>                 Don't answer to From: address!
>                 Mail to this account are droped if not recieved via
>                 mailinglist.
>                 To contact me direct create the mail address by
>                 concatenating my forename to my senders domain.
> 
> 
> 
> 
>             -- 
> 
>             http://www.irian.at
>             Your JSF powerhouse -
>             JSF Trainings in English and German
> 
>         ---
>         Sven Haiges
>         sven.haiges@gmx.de
> 
>         TEL +49 89 420 958 993
>         SIP 8008878@sipgate.de
> 
> 
> 
> 
>     -- 
> 
>     http://www.irian.at
>     Your JSF powerhouse -
>     JSF Trainings in English and German
> 
> ---
> Sven Haiges
> sven.haiges@gmx.de
> 
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
> 

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.

Re: PanelGrid with dynamic amount of items

Posted by Sven Haiges <sv...@web.de>.
i totally agree, but how do I SET children? that's why I used 
setParent, because there is no "set" method. how can I set the children 
of a component? if that works, then the dynamic panelGrid should be no 
problem...


Am 05.11.2005 um 17:15 Uhr schrieb Martin Marinschek:

> getChildren() is a method of UIComponentBase, so it must be available
> in every JSF component.
>
> regards,
>
> Martin
>
> On 11/5/05, Sven Haiges <sv...@web.de> wrote:
>> hmm, strange. that's what i tried to do. but i could not find a
>> getChildren() method... can you  be more specific.
>>
>> in the meantime i switched to a datatable, but i would consider to
>> change it again.
>> thanx,
>> sven
>> Am 01.11.2005 um 15:58 Uhr schrieb Martin Marinschek:
>>
>>> Oh right, I didn't even see that.
>>>
>>> Of course, you need to add the text to the children list of the 
>>> parent
>>> component.
>>>
>>> regards,
>>>
>>> Martin
>>>
>>> On 11/1/05, Volker Weber <us...@weber-oldenburg.de> wrote:
>>>> Hi,
>>>>
>>>> Sven Haiges wrote:
>>>>> thanx! i first wanted to try out the programmatic way. I bound a
>>>>> panelGrid to a managed bean property and once I get the result from
>>>>> the
>>>>> db, I add some outputText elements. the outputText is then added to
>>>>> the
>>>>> parent, I simply call setParent(productPanel) - productPanel is the
>>>>> panelGrid.
>>>>>
>>>>> private HtmlPanelGrid productPanel = new HtmlPanelGrid();
>>>>>
>>>>> ....
>>>>>
>>>>> if (result != null) {
>>>>> log.debug("Rebuilding productPanel...");
>>>>> //this.queryResults = new ListDataModel(result);
>>>>> for (Iterator i = result.iterator(); i.hasNext();){
>>>>> log.debug("Adding outputtext to panelgrid... ");
>>>>> Product product = (Product)i.next();
>>>>> HtmlOutputText text = new HtmlOutputText();
>>>>> text.setValue(product.getOrderNumber());
>>>>> text.setParent(this.productPanel);
>>>>> }
>>>>
>>>> you don't need to set the parent of text, but you need to add the 
>>>> text
>>>> as child to productPanel.
>>>>
>>>> replace
>>>>   text.setParent(this.productPanel);
>>>> with
>>>>   this.productPanel.getChildren().add(text);
>>>>
>>>> than it shoud work.
>>>>
>>>>>
>>>>>
>>>>> I get the log output that some components were created, but nothing
>>>>> is
>>>>> shown when the page is rendered. Somehow the panelGrid is empty....
>>>>> so
>>>>> is it actually impossible to add elements with a method like
>>>>> panelGrid.addChildComponent(UIComponent...)??
>>>>>
>>>>
>>>> regards
>>>>   Volker
>>>> --
>>>> Don't answer to From: address!
>>>> Mail to this account are droped if not recieved via mailinglist.
>>>> To contact me direct create the mail address by
>>>> concatenating my forename to my senders domain.
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> http://www.irian.at
>>> Your JSF powerhouse -
>>> JSF Trainings in English and German
>>>
>> ---
>> Sven Haiges
>> sven.haiges@gmx.de
>>
>> TEL +49 89 420 958 993
>> SIP 8008878@sipgate.de
>>
>>
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>
---
Sven Haiges
sven.haiges@gmx.de

TEL +49 89 420 958 993
SIP 8008878@sipgate.de

Re: PanelGrid with dynamic amount of items

Posted by Martin Marinschek <ma...@gmail.com>.
getChildren() is a method of UIComponentBase, so it must be available
in every JSF component.

regards,

Martin

On 11/5/05, Sven Haiges <sv...@web.de> wrote:
> hmm, strange. that's what i tried to do. but i could not find a
> getChildren() method... can you  be more specific.
>
> in the meantime i switched to a datatable, but i would consider to
> change it again.
> thanx,
> sven
> Am 01.11.2005 um 15:58 Uhr schrieb Martin Marinschek:
>
> > Oh right, I didn't even see that.
> >
> > Of course, you need to add the text to the children list of the parent
> > component.
> >
> > regards,
> >
> > Martin
> >
> > On 11/1/05, Volker Weber <us...@weber-oldenburg.de> wrote:
> >> Hi,
> >>
> >> Sven Haiges wrote:
> >>> thanx! i first wanted to try out the programmatic way. I bound a
> >>> panelGrid to a managed bean property and once I get the result from
> >>> the
> >>> db, I add some outputText elements. the outputText is then added to
> >>> the
> >>> parent, I simply call setParent(productPanel) - productPanel is the
> >>> panelGrid.
> >>>
> >>> private HtmlPanelGrid productPanel = new HtmlPanelGrid();
> >>>
> >>> ....
> >>>
> >>> if (result != null) {
> >>> log.debug("Rebuilding productPanel...");
> >>> //this.queryResults = new ListDataModel(result);
> >>> for (Iterator i = result.iterator(); i.hasNext();){
> >>> log.debug("Adding outputtext to panelgrid... ");
> >>> Product product = (Product)i.next();
> >>> HtmlOutputText text = new HtmlOutputText();
> >>> text.setValue(product.getOrderNumber());
> >>> text.setParent(this.productPanel);
> >>> }
> >>
> >> you don't need to set the parent of text, but you need to add the text
> >> as child to productPanel.
> >>
> >> replace
> >>   text.setParent(this.productPanel);
> >> with
> >>   this.productPanel.getChildren().add(text);
> >>
> >> than it shoud work.
> >>
> >>>
> >>>
> >>> I get the log output that some components were created, but nothing
> >>> is
> >>> shown when the page is rendered. Somehow the panelGrid is empty....
> >>> so
> >>> is it actually impossible to add elements with a method like
> >>> panelGrid.addChildComponent(UIComponent...)??
> >>>
> >>
> >> regards
> >>   Volker
> >> --
> >> Don't answer to From: address!
> >> Mail to this account are droped if not recieved via mailinglist.
> >> To contact me direct create the mail address by
> >> concatenating my forename to my senders domain.
> >>
> >>
> >
> >
> > --
> >
> > http://www.irian.at
> > Your JSF powerhouse -
> > JSF Trainings in English and German
> >
> ---
> Sven Haiges
> sven.haiges@gmx.de
>
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
>
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

Re: PanelGrid with dynamic amount of items

Posted by Volker Weber <us...@weber-oldenburg.de>.
Hi,

where are you searching for getChildren()?

'public abstract java.util.List getChildren()' is a method of
UIComponent and javax.faces.component.html.HtmlPanelGrid is a subclass
of UIComponent.

regards

  Volker


Sven Haiges wrote:
> hmm, strange. that's what i tried to do. but i could not find a
> getChildren() method... can you be more specific.
> 
> in the meantime i switched to a datatable, but i would consider to
> change it again.
> thanx,
> sven
> Am 01.11.2005 um 15:58 Uhr schrieb Martin Marinschek:
> 
>     Oh right, I didn't even see that.
> 
>     Of course, you need to add the text to the children list of the parent
>     component.
> 
>     regards,
> 
>     Martin
> 
>     On 11/1/05, Volker Weber <us...@weber-oldenburg.de> wrote:
> 
>         Hi,
> 
>         Sven Haiges wrote:
> 
>             thanx! i first wanted to try out the programmatic way. I
>             bound a
>             panelGrid to a managed bean property and once I get the
>             result from the
>             db, I add some outputText elements. the outputText is then
>             added to the
>             parent, I simply call setParent(productPanel) - productPanel
>             is the
>             panelGrid.
> 
>             private HtmlPanelGrid productPanel = new HtmlPanelGrid();
> 
>             ....
> 
>             if (result != null) {
>             log.debug("Rebuilding productPanel...");
>             //this.queryResults = new ListDataModel(result);
>             for (Iterator i = result.iterator(); i.hasNext();){
>             log.debug("Adding outputtext to panelgrid... ");
>             Product product = (Product)i.next();
>             HtmlOutputText text = new HtmlOutputText();
>             text.setValue(product.getOrderNumber());
>             text.setParent(this.productPanel);
>             }
> 
> 
>         you don't need to set the parent of text, but you need to add
>         the text
>         as child to productPanel.
> 
>         replace
>         text.setParent(this.productPanel);
>         with
>         this.productPanel.getChildren().add(text);
> 
>         than it shoud work.
> 
> 
> 
>             I get the log output that some components were created, but
>             nothing is
>             shown when the page is rendered. Somehow the panelGrid is
>             empty.... so
>             is it actually impossible to add elements with a method like
>             panelGrid.addChildComponent(UIComponent...)??
> 
> 
>         regards
>         Volker
>         -- 
>         Don't answer to From: address!
>         Mail to this account are droped if not recieved via mailinglist.
>         To contact me direct create the mail address by
>         concatenating my forename to my senders domain.
> 
> 
> 
> 
>     -- 
> 
>     http://www.irian.at
>     Your JSF powerhouse -
>     JSF Trainings in English and German
> 
> ---
> Sven Haiges
> sven.haiges@gmx.de
> 
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
> 

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.

Re: PanelGrid with dynamic amount of items

Posted by Sven Haiges <sv...@web.de>.
hmm, strange. that's what i tried to do. but i could not find a 
getChildren() method... can you  be more specific.

in the meantime i switched to a datatable, but i would consider to 
change it again.
thanx,
sven
Am 01.11.2005 um 15:58 Uhr schrieb Martin Marinschek:

> Oh right, I didn't even see that.
>
> Of course, you need to add the text to the children list of the parent
> component.
>
> regards,
>
> Martin
>
> On 11/1/05, Volker Weber <us...@weber-oldenburg.de> wrote:
>> Hi,
>>
>> Sven Haiges wrote:
>>> thanx! i first wanted to try out the programmatic way. I bound a
>>> panelGrid to a managed bean property and once I get the result from 
>>> the
>>> db, I add some outputText elements. the outputText is then added to 
>>> the
>>> parent, I simply call setParent(productPanel) - productPanel is the
>>> panelGrid.
>>>
>>> private HtmlPanelGrid productPanel = new HtmlPanelGrid();
>>>
>>> ....
>>>
>>> if (result != null) {
>>> log.debug("Rebuilding productPanel...");
>>> //this.queryResults = new ListDataModel(result);
>>> for (Iterator i = result.iterator(); i.hasNext();){
>>> log.debug("Adding outputtext to panelgrid... ");
>>> Product product = (Product)i.next();
>>> HtmlOutputText text = new HtmlOutputText();
>>> text.setValue(product.getOrderNumber());
>>> text.setParent(this.productPanel);
>>> }
>>
>> you don't need to set the parent of text, but you need to add the text
>> as child to productPanel.
>>
>> replace
>>   text.setParent(this.productPanel);
>> with
>>   this.productPanel.getChildren().add(text);
>>
>> than it shoud work.
>>
>>>
>>>
>>> I get the log output that some components were created, but nothing 
>>> is
>>> shown when the page is rendered. Somehow the panelGrid is empty.... 
>>> so
>>> is it actually impossible to add elements with a method like
>>> panelGrid.addChildComponent(UIComponent...)??
>>>
>>
>> regards
>>   Volker
>> --
>> Don't answer to From: address!
>> Mail to this account are droped if not recieved via mailinglist.
>> To contact me direct create the mail address by
>> concatenating my forename to my senders domain.
>>
>>
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>
---
Sven Haiges
sven.haiges@gmx.de

TEL +49 89 420 958 993
SIP 8008878@sipgate.de

Re: PanelGrid with dynamic amount of items

Posted by Mathias Brökelmann <mb...@googlemail.com>.
I think t:newspaperTable will do the job pretty well.

2005/11/1, Martin Marinschek <ma...@gmail.com>:
> Oh right, I didn't even see that.
>
> Of course, you need to add the text to the children list of the parent
> component.
>
> regards,
>
> Martin
>
> On 11/1/05, Volker Weber <us...@weber-oldenburg.de> wrote:
> > Hi,
> >
> > Sven Haiges wrote:
> > > thanx! i first wanted to try out the programmatic way. I bound a
> > > panelGrid to a managed bean property and once I get the result from the
> > > db, I add some outputText elements. the outputText is then added to the
> > > parent, I simply call setParent(productPanel) - productPanel is the
> > > panelGrid.
> > >
> > > private HtmlPanelGrid productPanel = new HtmlPanelGrid();
> > >
> > > ....
> > >
> > > if (result != null) {
> > > log.debug("Rebuilding productPanel...");
> > > //this.queryResults = new ListDataModel(result);
> > > for (Iterator i = result.iterator(); i.hasNext();){
> > > log.debug("Adding outputtext to panelgrid... ");
> > > Product product = (Product)i.next();
> > > HtmlOutputText text = new HtmlOutputText();
> > > text.setValue(product.getOrderNumber());
> > > text.setParent(this.productPanel);
> > > }
> >
> > you don't need to set the parent of text, but you need to add the text
> > as child to productPanel.
> >
> > replace
> >   text.setParent(this.productPanel);
> > with
> >   this.productPanel.getChildren().add(text);
> >
> > than it shoud work.
> >
> > >
> > >
> > > I get the log output that some components were created, but nothing is
> > > shown when the page is rendered. Somehow the panelGrid is empty.... so
> > > is it actually impossible to add elements with a method like
> > > panelGrid.addChildComponent(UIComponent...)??
> > >
> >
> > regards
> >   Volker
> > --
> > Don't answer to From: address!
> > Mail to this account are droped if not recieved via mailinglist.
> > To contact me direct create the mail address by
> > concatenating my forename to my senders domain.
> >
> >
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>


--
Mathias

Re: PanelGrid with dynamic amount of items

Posted by Martin Marinschek <ma...@gmail.com>.
Oh right, I didn't even see that.

Of course, you need to add the text to the children list of the parent
component.

regards,

Martin

On 11/1/05, Volker Weber <us...@weber-oldenburg.de> wrote:
> Hi,
>
> Sven Haiges wrote:
> > thanx! i first wanted to try out the programmatic way. I bound a
> > panelGrid to a managed bean property and once I get the result from the
> > db, I add some outputText elements. the outputText is then added to the
> > parent, I simply call setParent(productPanel) - productPanel is the
> > panelGrid.
> >
> > private HtmlPanelGrid productPanel = new HtmlPanelGrid();
> >
> > ....
> >
> > if (result != null) {
> > log.debug("Rebuilding productPanel...");
> > //this.queryResults = new ListDataModel(result);
> > for (Iterator i = result.iterator(); i.hasNext();){
> > log.debug("Adding outputtext to panelgrid... ");
> > Product product = (Product)i.next();
> > HtmlOutputText text = new HtmlOutputText();
> > text.setValue(product.getOrderNumber());
> > text.setParent(this.productPanel);
> > }
>
> you don't need to set the parent of text, but you need to add the text
> as child to productPanel.
>
> replace
>   text.setParent(this.productPanel);
> with
>   this.productPanel.getChildren().add(text);
>
> than it shoud work.
>
> >
> >
> > I get the log output that some components were created, but nothing is
> > shown when the page is rendered. Somehow the panelGrid is empty.... so
> > is it actually impossible to add elements with a method like
> > panelGrid.addChildComponent(UIComponent...)??
> >
>
> regards
>   Volker
> --
> Don't answer to From: address!
> Mail to this account are droped if not recieved via mailinglist.
> To contact me direct create the mail address by
> concatenating my forename to my senders domain.
>
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

Re: PanelGrid with dynamic amount of items

Posted by Volker Weber <us...@weber-oldenburg.de>.
Hi,

Sven Haiges wrote:
> thanx! i first wanted to try out the programmatic way. I bound a
> panelGrid to a managed bean property and once I get the result from the
> db, I add some outputText elements. the outputText is then added to the
> parent, I simply call setParent(productPanel) - productPanel is the
> panelGrid.
> 
> private HtmlPanelGrid productPanel = new HtmlPanelGrid();
> 
> ....
> 
> if (result != null) {
> log.debug("Rebuilding productPanel...");
> //this.queryResults = new ListDataModel(result);
> for (Iterator i = result.iterator(); i.hasNext();){
> log.debug("Adding outputtext to panelgrid... ");
> Product product = (Product)i.next();
> HtmlOutputText text = new HtmlOutputText();
> text.setValue(product.getOrderNumber());
> text.setParent(this.productPanel);
> }

you don't need to set the parent of text, but you need to add the text
as child to productPanel.

replace
  text.setParent(this.productPanel);
with
  this.productPanel.getChildren().add(text);

than it shoud work.

> 
> 
> I get the log output that some components were created, but nothing is
> shown when the page is rendered. Somehow the panelGrid is empty.... so
> is it actually impossible to add elements with a method like
> panelGrid.addChildComponent(UIComponent...)??
> 

regards
  Volker
-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.


Re: PanelGrid with dynamic amount of items

Posted by Martin Marinschek <ma...@gmail.com>.
This should work - can you show your jsp code?

regards,

Martin

On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> thanx! i first wanted to try out the programmatic way. I bound a
> panelGrid to a managed bean property and once I get the result from the
> db, I add some outputText elements. the outputText is then added to the
> parent, I simply call setParent(productPanel) - productPanel is the
> panelGrid.
>
>         private HtmlPanelGrid productPanel = new HtmlPanelGrid();
>
> ....
>
>                 if (result != null) {
>                         log.debug("Rebuilding productPanel...");
>                         //this.queryResults = new ListDataModel(result);
>                         for (Iterator i = result.iterator(); i.hasNext();){
>                                 log.debug("Adding outputtext to panelgrid... ");
>                                 Product product = (Product)i.next();
>                                 HtmlOutputText text = new HtmlOutputText();
>                                 text.setValue(product.getOrderNumber());
>                                 text.setParent(this.productPanel);
>                         }
>
>
> I get the log output that some components were created, but nothing is
> shown when the page is rendered. Somehow the panelGrid is empty.... so
> is it actually impossible to add elements with a method like
> panelGrid.addChildComponent(UIComponent...)??
>
> Hmmm. If this does not work for some reason, I guess the only solution
> is to take a look at t:columns. I looked at the example but if I got it
> right, a column with column data of a database table was added. What I
> want is the behaviour of a panelGrid, e.g. items are filled into a
> table from left to right and top-down.
>
> So if I got 6 products returned from the database, this should be
> rendered:
>
> 1 | 2 | 3 | 4
> 5 | 6
>
> Any ideas?
>
> Cheers,
> Sven
>
> Am 01.11.2005 um 13:23 Uhr schrieb Martin Marinschek:
>
> > Best is you look into the examples - there you'll find a nice example
> > for the dataTable.
> >
> > link to see it in action:
> > http://www.irian.at/myfaces/crossDataTable.jsf
> >
> > regards,
> >
> > Martin
> >
> > On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> >> Ok, so t:columns (not in 1.1 RI, right, only Tomahawk) is used within
> >> a
> >> <h:dataTable .. >
> >>
> >> Where can I find some more info about this tag - the tlddoc is pretty
> >> empty... :-)
> >>
> >> value of t:columns seems to take a datamodel (the same like for the
> >> dataTable??)
> >> var is the individual item (again duplication, already set in
> >> dataTable...)
> >>
> >> how is the amount of columns specified....?
> >>
> >> Thanx!
> >> Sven
> >>
> >>
> >>
> >> Am 01.11.2005 um 13:08 Uhr schrieb Martin Marinschek:
> >>
> >>> Look at what the dynamic dataTable does - with this and the h:columns
> >>> tag, you can arrange things horizontally as well.
> >>>
> >>> regards,
> >>>
> >>> Martin
> >>>
> >>> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> >>>> The problem with dataTable is that the results are displayed
> >>>> vertically, so I can display rows of information.
> >>>>
> >>>> What I want to do is to present the data in a 4*x table, each cell
> >>>> should contain the next element. I will use it as an overview
> >>>> results
> >>>> page, then the user will be able to click on one cell (image inside)
> >>>> and have the detailed view.
> >>>>
> >>>> I know, very easy with dataTable... or can I switch dataTable and
> >>>> display 1 item each row?
> >>>>
> >>>> cheers\
> >>>> sven
> >>>>
> >>>>
> >>>> Am 01.11.2005 um 12:49 Uhr schrieb Martin Marinschek:
> >>>>
> >>>>> Why don't you use a dataTable for this?
> >>>>>
> >>>>> regards,
> >>>>>
> >>>>> Martin
> >>>>>
> >>>>> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> >>>>>> Hi there,
> >>>>>>
> >>>>>> I would like to render a panelGrid with an dynamic amount of items
> >>>>>> in
> >>>>>> it. The items should be bound to a managed bean variable and based
> >>>>>> on
> >>>>>> the database result, the display should adapt.
> >>>>>>
> >>>>>> PanelGrid worked fine with a static number of items, but how can I
> >>>>>> add
> >>>>>> a dynamic number of items. I know there are problems with
> >>>>>> c:forEach,
> >>>>>> that's probably why the example of my code below also does not
> >>>>>> work....
> >>>>>>
> >>>>>>
> >>>>>> Any help is appreciated!
> >>>>>>
> >>>>>> (one sec: I just got the idea to add the components on the server
> >>>>>> side,
> >>>>>> ok, but isn't there an easy solution that i can just do in my jsp
> >>>>>> page?)
> >>>>>>
> >>>>>> Cheers,
> >>>>>> Sven
> >>>>>>
> >>>>>>         <h:panelGrid columns="4" frame="border">
> >>>>>>
> >>>>>>                 <c:forEach var='product'
> >>>>>> items='#{productSearchBean.queryResults}'>
> >>>>>>                                 <h:outputText
> >>>>>> styleClass="contentRight"
> >>>>>> value="#{product.orderNumber}"/>        <f:verbatim> -
> >>>>>> </f:verbatim>
> >>>>>>                                 <h:outputText
> >>>>>> styleClass="contentRight"
> >>>>>> value="#{product.description.titleEN}"
> >>>>>> rendered="#{view.locale.language
> >>>>>> eq 'en'}" />
> >>>>>>                                 <h:outputText
> >>>>>> styleClass="contentRight"
> >>>>>> value="#{product.description.titleDE}"
> >>>>>> rendered="#{view.locale.language
> >>>>>> eq 'de'}" />
> >>>>>>                                 <h:outputText
> >>>>>> styleClass="contentRight"
> >>>>>> value="#{product.description.titleFR}"
> >>>>>> rendered="#{view.locale.language
> >>>>>> eq 'fr'}" />
> >>>>>>                                 <h:outputText
> >>>>>> styleClass="contentRight"
> >>>>>> value="#{product.description.titleES}"
> >>>>>> rendered="#{view.locale.language
> >>>>>> eq 'es'}" />
> >>>>>>                 </c:forEach>
> >>>>>>
> >>>>>>         </h:panelGrid>
> >>>>>> ---
> >>>>>> Sven Haiges
> >>>>>> sven.haiges@gmx.de
> >>>>>>
> >>>>>> TEL +49 89 420 958 993
> >>>>>> SIP 8008878@sipgate.de
> >>>>>> ---
> >>>>>> Sven Haiges
> >>>>>> sven.haiges@gmx.de
> >>>>>>
> >>>>>> TEL +49 89 420 958 993
> >>>>>> SIP 8008878@sipgate.de
> >>>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>>
> >>>>> http://www.irian.at
> >>>>> Your JSF powerhouse -
> >>>>> JSF Trainings in English and German
> >>>>>
> >>>> ---
> >>>> Sven Haiges
> >>>> sven.haiges@gmx.de
> >>>>
> >>>> TEL +49 89 420 958 993
> >>>> SIP 8008878@sipgate.de
> >>>>
> >>>>
> >>>
> >>>
> >>> --
> >>>
> >>> http://www.irian.at
> >>> Your JSF powerhouse -
> >>> JSF Trainings in English and German
> >>>
> >> ---
> >> Sven Haiges
> >> sven.haiges@gmx.de
> >>
> >> TEL +49 89 420 958 993
> >> SIP 8008878@sipgate.de
> >>
> >>
> >
> >
> > --
> >
> > http://www.irian.at
> > Your JSF powerhouse -
> > JSF Trainings in English and German
> >
> ---
> Sven Haiges
> sven.haiges@gmx.de
>
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
>
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

Re: PanelGrid with dynamic amount of items

Posted by Sven Haiges <sv...@web.de>.
thanx! i first wanted to try out the programmatic way. I bound a 
panelGrid to a managed bean property and once I get the result from the 
db, I add some outputText elements. the outputText is then added to the 
parent, I simply call setParent(productPanel) - productPanel is the 
panelGrid.

	private HtmlPanelGrid productPanel = new HtmlPanelGrid();

....

		if (result != null) {
			log.debug("Rebuilding productPanel...");
			//this.queryResults = new ListDataModel(result);
			for (Iterator i = result.iterator(); i.hasNext();){
				log.debug("Adding outputtext to panelgrid... ");
				Product product = (Product)i.next();
				HtmlOutputText text = new HtmlOutputText();
				text.setValue(product.getOrderNumber());
				text.setParent(this.productPanel);
			}


I get the log output that some components were created, but nothing is 
shown when the page is rendered. Somehow the panelGrid is empty.... so 
is it actually impossible to add elements with a method like 
panelGrid.addChildComponent(UIComponent...)??

Hmmm. If this does not work for some reason, I guess the only solution 
is to take a look at t:columns. I looked at the example but if I got it 
right, a column with column data of a database table was added. What I 
want is the behaviour of a panelGrid, e.g. items are filled into a 
table from left to right and top-down.

So if I got 6 products returned from the database, this should be 
rendered:

1 | 2 | 3 | 4
5 | 6

Any ideas?

Cheers,
Sven

Am 01.11.2005 um 13:23 Uhr schrieb Martin Marinschek:

> Best is you look into the examples - there you'll find a nice example
> for the dataTable.
>
> link to see it in action: 
> http://www.irian.at/myfaces/crossDataTable.jsf
>
> regards,
>
> Martin
>
> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
>> Ok, so t:columns (not in 1.1 RI, right, only Tomahawk) is used within 
>> a
>> <h:dataTable .. >
>>
>> Where can I find some more info about this tag - the tlddoc is pretty
>> empty... :-)
>>
>> value of t:columns seems to take a datamodel (the same like for the
>> dataTable??)
>> var is the individual item (again duplication, already set in
>> dataTable...)
>>
>> how is the amount of columns specified....?
>>
>> Thanx!
>> Sven
>>
>>
>>
>> Am 01.11.2005 um 13:08 Uhr schrieb Martin Marinschek:
>>
>>> Look at what the dynamic dataTable does - with this and the h:columns
>>> tag, you can arrange things horizontally as well.
>>>
>>> regards,
>>>
>>> Martin
>>>
>>> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
>>>> The problem with dataTable is that the results are displayed
>>>> vertically, so I can display rows of information.
>>>>
>>>> What I want to do is to present the data in a 4*x table, each cell
>>>> should contain the next element. I will use it as an overview 
>>>> results
>>>> page, then the user will be able to click on one cell (image inside)
>>>> and have the detailed view.
>>>>
>>>> I know, very easy with dataTable... or can I switch dataTable and
>>>> display 1 item each row?
>>>>
>>>> cheers\
>>>> sven
>>>>
>>>>
>>>> Am 01.11.2005 um 12:49 Uhr schrieb Martin Marinschek:
>>>>
>>>>> Why don't you use a dataTable for this?
>>>>>
>>>>> regards,
>>>>>
>>>>> Martin
>>>>>
>>>>> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
>>>>>> Hi there,
>>>>>>
>>>>>> I would like to render a panelGrid with an dynamic amount of items
>>>>>> in
>>>>>> it. The items should be bound to a managed bean variable and based
>>>>>> on
>>>>>> the database result, the display should adapt.
>>>>>>
>>>>>> PanelGrid worked fine with a static number of items, but how can I
>>>>>> add
>>>>>> a dynamic number of items. I know there are problems with 
>>>>>> c:forEach,
>>>>>> that's probably why the example of my code below also does not
>>>>>> work....
>>>>>>
>>>>>>
>>>>>> Any help is appreciated!
>>>>>>
>>>>>> (one sec: I just got the idea to add the components on the server
>>>>>> side,
>>>>>> ok, but isn't there an easy solution that i can just do in my jsp
>>>>>> page?)
>>>>>>
>>>>>> Cheers,
>>>>>> Sven
>>>>>>
>>>>>>         <h:panelGrid columns="4" frame="border">
>>>>>>
>>>>>>                 <c:forEach var='product'
>>>>>> items='#{productSearchBean.queryResults}'>
>>>>>>                                 <h:outputText
>>>>>> styleClass="contentRight"
>>>>>> value="#{product.orderNumber}"/>        <f:verbatim> - 
>>>>>> </f:verbatim>
>>>>>>                                 <h:outputText
>>>>>> styleClass="contentRight"
>>>>>> value="#{product.description.titleEN}"
>>>>>> rendered="#{view.locale.language
>>>>>> eq 'en'}" />
>>>>>>                                 <h:outputText
>>>>>> styleClass="contentRight"
>>>>>> value="#{product.description.titleDE}"
>>>>>> rendered="#{view.locale.language
>>>>>> eq 'de'}" />
>>>>>>                                 <h:outputText
>>>>>> styleClass="contentRight"
>>>>>> value="#{product.description.titleFR}"
>>>>>> rendered="#{view.locale.language
>>>>>> eq 'fr'}" />
>>>>>>                                 <h:outputText
>>>>>> styleClass="contentRight"
>>>>>> value="#{product.description.titleES}"
>>>>>> rendered="#{view.locale.language
>>>>>> eq 'es'}" />
>>>>>>                 </c:forEach>
>>>>>>
>>>>>>         </h:panelGrid>
>>>>>> ---
>>>>>> Sven Haiges
>>>>>> sven.haiges@gmx.de
>>>>>>
>>>>>> TEL +49 89 420 958 993
>>>>>> SIP 8008878@sipgate.de
>>>>>> ---
>>>>>> Sven Haiges
>>>>>> sven.haiges@gmx.de
>>>>>>
>>>>>> TEL +49 89 420 958 993
>>>>>> SIP 8008878@sipgate.de
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> http://www.irian.at
>>>>> Your JSF powerhouse -
>>>>> JSF Trainings in English and German
>>>>>
>>>> ---
>>>> Sven Haiges
>>>> sven.haiges@gmx.de
>>>>
>>>> TEL +49 89 420 958 993
>>>> SIP 8008878@sipgate.de
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> http://www.irian.at
>>> Your JSF powerhouse -
>>> JSF Trainings in English and German
>>>
>> ---
>> Sven Haiges
>> sven.haiges@gmx.de
>>
>> TEL +49 89 420 958 993
>> SIP 8008878@sipgate.de
>>
>>
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>
---
Sven Haiges
sven.haiges@gmx.de

TEL +49 89 420 958 993
SIP 8008878@sipgate.de

Re: PanelGrid with dynamic amount of items

Posted by Martin Marinschek <ma...@gmail.com>.
Best is you look into the examples - there you'll find a nice example
for the dataTable.

link to see it in action: http://www.irian.at/myfaces/crossDataTable.jsf

regards,

Martin

On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> Ok, so t:columns (not in 1.1 RI, right, only Tomahawk) is used within a
> <h:dataTable .. >
>
> Where can I find some more info about this tag - the tlddoc is pretty
> empty... :-)
>
> value of t:columns seems to take a datamodel (the same like for the
> dataTable??)
> var is the individual item (again duplication, already set in
> dataTable...)
>
> how is the amount of columns specified....?
>
> Thanx!
> Sven
>
>
>
> Am 01.11.2005 um 13:08 Uhr schrieb Martin Marinschek:
>
> > Look at what the dynamic dataTable does - with this and the h:columns
> > tag, you can arrange things horizontally as well.
> >
> > regards,
> >
> > Martin
> >
> > On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> >> The problem with dataTable is that the results are displayed
> >> vertically, so I can display rows of information.
> >>
> >> What I want to do is to present the data in a 4*x table, each cell
> >> should contain the next element. I will use it as an overview results
> >> page, then the user will be able to click on one cell (image inside)
> >> and have the detailed view.
> >>
> >> I know, very easy with dataTable... or can I switch dataTable and
> >> display 1 item each row?
> >>
> >> cheers\
> >> sven
> >>
> >>
> >> Am 01.11.2005 um 12:49 Uhr schrieb Martin Marinschek:
> >>
> >>> Why don't you use a dataTable for this?
> >>>
> >>> regards,
> >>>
> >>> Martin
> >>>
> >>> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> >>>> Hi there,
> >>>>
> >>>> I would like to render a panelGrid with an dynamic amount of items
> >>>> in
> >>>> it. The items should be bound to a managed bean variable and based
> >>>> on
> >>>> the database result, the display should adapt.
> >>>>
> >>>> PanelGrid worked fine with a static number of items, but how can I
> >>>> add
> >>>> a dynamic number of items. I know there are problems with c:forEach,
> >>>> that's probably why the example of my code below also does not
> >>>> work....
> >>>>
> >>>>
> >>>> Any help is appreciated!
> >>>>
> >>>> (one sec: I just got the idea to add the components on the server
> >>>> side,
> >>>> ok, but isn't there an easy solution that i can just do in my jsp
> >>>> page?)
> >>>>
> >>>> Cheers,
> >>>> Sven
> >>>>
> >>>>         <h:panelGrid columns="4" frame="border">
> >>>>
> >>>>                 <c:forEach var='product'
> >>>> items='#{productSearchBean.queryResults}'>
> >>>>                                 <h:outputText
> >>>> styleClass="contentRight"
> >>>> value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
> >>>>                                 <h:outputText
> >>>> styleClass="contentRight"
> >>>> value="#{product.description.titleEN}"
> >>>> rendered="#{view.locale.language
> >>>> eq 'en'}" />
> >>>>                                 <h:outputText
> >>>> styleClass="contentRight"
> >>>> value="#{product.description.titleDE}"
> >>>> rendered="#{view.locale.language
> >>>> eq 'de'}" />
> >>>>                                 <h:outputText
> >>>> styleClass="contentRight"
> >>>> value="#{product.description.titleFR}"
> >>>> rendered="#{view.locale.language
> >>>> eq 'fr'}" />
> >>>>                                 <h:outputText
> >>>> styleClass="contentRight"
> >>>> value="#{product.description.titleES}"
> >>>> rendered="#{view.locale.language
> >>>> eq 'es'}" />
> >>>>                 </c:forEach>
> >>>>
> >>>>         </h:panelGrid>
> >>>> ---
> >>>> Sven Haiges
> >>>> sven.haiges@gmx.de
> >>>>
> >>>> TEL +49 89 420 958 993
> >>>> SIP 8008878@sipgate.de
> >>>> ---
> >>>> Sven Haiges
> >>>> sven.haiges@gmx.de
> >>>>
> >>>> TEL +49 89 420 958 993
> >>>> SIP 8008878@sipgate.de
> >>>>
> >>>
> >>>
> >>> --
> >>>
> >>> http://www.irian.at
> >>> Your JSF powerhouse -
> >>> JSF Trainings in English and German
> >>>
> >> ---
> >> Sven Haiges
> >> sven.haiges@gmx.de
> >>
> >> TEL +49 89 420 958 993
> >> SIP 8008878@sipgate.de
> >>
> >>
> >
> >
> > --
> >
> > http://www.irian.at
> > Your JSF powerhouse -
> > JSF Trainings in English and German
> >
> ---
> Sven Haiges
> sven.haiges@gmx.de
>
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
>
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

Re: PanelGrid with dynamic amount of items

Posted by Sven Haiges <sv...@web.de>.
Ok, so t:columns (not in 1.1 RI, right, only Tomahawk) is used within a 
<h:dataTable .. >

Where can I find some more info about this tag - the tlddoc is pretty 
empty... :-)

value of t:columns seems to take a datamodel (the same like for the 
dataTable??)
var is the individual item (again duplication, already set in 
dataTable...)

how is the amount of columns specified....?

Thanx!
Sven



Am 01.11.2005 um 13:08 Uhr schrieb Martin Marinschek:

> Look at what the dynamic dataTable does - with this and the h:columns
> tag, you can arrange things horizontally as well.
>
> regards,
>
> Martin
>
> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
>> The problem with dataTable is that the results are displayed
>> vertically, so I can display rows of information.
>>
>> What I want to do is to present the data in a 4*x table, each cell
>> should contain the next element. I will use it as an overview results
>> page, then the user will be able to click on one cell (image inside)
>> and have the detailed view.
>>
>> I know, very easy with dataTable... or can I switch dataTable and
>> display 1 item each row?
>>
>> cheers\
>> sven
>>
>>
>> Am 01.11.2005 um 12:49 Uhr schrieb Martin Marinschek:
>>
>>> Why don't you use a dataTable for this?
>>>
>>> regards,
>>>
>>> Martin
>>>
>>> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
>>>> Hi there,
>>>>
>>>> I would like to render a panelGrid with an dynamic amount of items  
>>>> in
>>>> it. The items should be bound to a managed bean variable and based 
>>>> on
>>>> the database result, the display should adapt.
>>>>
>>>> PanelGrid worked fine with a static number of items, but how can I 
>>>> add
>>>> a dynamic number of items. I know there are problems with c:forEach,
>>>> that's probably why the example of my code below also does not
>>>> work....
>>>>
>>>>
>>>> Any help is appreciated!
>>>>
>>>> (one sec: I just got the idea to add the components on the server
>>>> side,
>>>> ok, but isn't there an easy solution that i can just do in my jsp
>>>> page?)
>>>>
>>>> Cheers,
>>>> Sven
>>>>
>>>>         <h:panelGrid columns="4" frame="border">
>>>>
>>>>                 <c:forEach var='product'
>>>> items='#{productSearchBean.queryResults}'>
>>>>                                 <h:outputText
>>>> styleClass="contentRight"
>>>> value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
>>>>                                 <h:outputText
>>>> styleClass="contentRight"
>>>> value="#{product.description.titleEN}"
>>>> rendered="#{view.locale.language
>>>> eq 'en'}" />
>>>>                                 <h:outputText
>>>> styleClass="contentRight"
>>>> value="#{product.description.titleDE}"
>>>> rendered="#{view.locale.language
>>>> eq 'de'}" />
>>>>                                 <h:outputText
>>>> styleClass="contentRight"
>>>> value="#{product.description.titleFR}"
>>>> rendered="#{view.locale.language
>>>> eq 'fr'}" />
>>>>                                 <h:outputText
>>>> styleClass="contentRight"
>>>> value="#{product.description.titleES}"
>>>> rendered="#{view.locale.language
>>>> eq 'es'}" />
>>>>                 </c:forEach>
>>>>
>>>>         </h:panelGrid>
>>>> ---
>>>> Sven Haiges
>>>> sven.haiges@gmx.de
>>>>
>>>> TEL +49 89 420 958 993
>>>> SIP 8008878@sipgate.de
>>>> ---
>>>> Sven Haiges
>>>> sven.haiges@gmx.de
>>>>
>>>> TEL +49 89 420 958 993
>>>> SIP 8008878@sipgate.de
>>>>
>>>
>>>
>>> --
>>>
>>> http://www.irian.at
>>> Your JSF powerhouse -
>>> JSF Trainings in English and German
>>>
>> ---
>> Sven Haiges
>> sven.haiges@gmx.de
>>
>> TEL +49 89 420 958 993
>> SIP 8008878@sipgate.de
>>
>>
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>
---
Sven Haiges
sven.haiges@gmx.de

TEL +49 89 420 958 993
SIP 8008878@sipgate.de

Re: PanelGrid with dynamic amount of items

Posted by Martin Marinschek <ma...@gmail.com>.
Look at what the dynamic dataTable does - with this and the h:columns
tag, you can arrange things horizontally as well.

regards,

Martin

On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> The problem with dataTable is that the results are displayed
> vertically, so I can display rows of information.
>
> What I want to do is to present the data in a 4*x table, each cell
> should contain the next element. I will use it as an overview results
> page, then the user will be able to click on one cell (image inside)
> and have the detailed view.
>
> I know, very easy with dataTable... or can I switch dataTable and
> display 1 item each row?
>
> cheers\
> sven
>
>
> Am 01.11.2005 um 12:49 Uhr schrieb Martin Marinschek:
>
> > Why don't you use a dataTable for this?
> >
> > regards,
> >
> > Martin
> >
> > On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> >> Hi there,
> >>
> >> I would like to render a panelGrid with an dynamic amount of items  in
> >> it. The items should be bound to a managed bean variable and based on
> >> the database result, the display should adapt.
> >>
> >> PanelGrid worked fine with a static number of items, but how can I add
> >> a dynamic number of items. I know there are problems with c:forEach,
> >> that's probably why the example of my code below also does not
> >> work....
> >>
> >>
> >> Any help is appreciated!
> >>
> >> (one sec: I just got the idea to add the components on the server
> >> side,
> >> ok, but isn't there an easy solution that i can just do in my jsp
> >> page?)
> >>
> >> Cheers,
> >> Sven
> >>
> >>         <h:panelGrid columns="4" frame="border">
> >>
> >>                 <c:forEach var='product'
> >> items='#{productSearchBean.queryResults}'>
> >>                                 <h:outputText
> >> styleClass="contentRight"
> >> value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
> >>                                 <h:outputText
> >> styleClass="contentRight"
> >> value="#{product.description.titleEN}"
> >> rendered="#{view.locale.language
> >> eq 'en'}" />
> >>                                 <h:outputText
> >> styleClass="contentRight"
> >> value="#{product.description.titleDE}"
> >> rendered="#{view.locale.language
> >> eq 'de'}" />
> >>                                 <h:outputText
> >> styleClass="contentRight"
> >> value="#{product.description.titleFR}"
> >> rendered="#{view.locale.language
> >> eq 'fr'}" />
> >>                                 <h:outputText
> >> styleClass="contentRight"
> >> value="#{product.description.titleES}"
> >> rendered="#{view.locale.language
> >> eq 'es'}" />
> >>                 </c:forEach>
> >>
> >>         </h:panelGrid>
> >> ---
> >> Sven Haiges
> >> sven.haiges@gmx.de
> >>
> >> TEL +49 89 420 958 993
> >> SIP 8008878@sipgate.de
> >> ---
> >> Sven Haiges
> >> sven.haiges@gmx.de
> >>
> >> TEL +49 89 420 958 993
> >> SIP 8008878@sipgate.de
> >>
> >
> >
> > --
> >
> > http://www.irian.at
> > Your JSF powerhouse -
> > JSF Trainings in English and German
> >
> ---
> Sven Haiges
> sven.haiges@gmx.de
>
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
>
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

Re: PanelGrid with dynamic amount of items

Posted by Sven Haiges <sv...@web.de>.
The problem with dataTable is that the results are displayed 
vertically, so I can display rows of information.

What I want to do is to present the data in a 4*x table, each cell 
should contain the next element. I will use it as an overview results 
page, then the user will be able to click on one cell (image inside) 
and have the detailed view.

I know, very easy with dataTable... or can I switch dataTable and 
display 1 item each row?

cheers\
sven


Am 01.11.2005 um 12:49 Uhr schrieb Martin Marinschek:

> Why don't you use a dataTable for this?
>
> regards,
>
> Martin
>
> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
>> Hi there,
>>
>> I would like to render a panelGrid with an dynamic amount of items  in
>> it. The items should be bound to a managed bean variable and based on
>> the database result, the display should adapt.
>>
>> PanelGrid worked fine with a static number of items, but how can I add
>> a dynamic number of items. I know there are problems with c:forEach,
>> that's probably why the example of my code below also does not 
>> work....
>>
>>
>> Any help is appreciated!
>>
>> (one sec: I just got the idea to add the components on the server 
>> side,
>> ok, but isn't there an easy solution that i can just do in my jsp
>> page?)
>>
>> Cheers,
>> Sven
>>
>>         <h:panelGrid columns="4" frame="border">
>>
>>                 <c:forEach var='product' 
>> items='#{productSearchBean.queryResults}'>
>>                                 <h:outputText 
>> styleClass="contentRight"
>> value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
>>                                 <h:outputText 
>> styleClass="contentRight"
>> value="#{product.description.titleEN}" 
>> rendered="#{view.locale.language
>> eq 'en'}" />
>>                                 <h:outputText 
>> styleClass="contentRight"
>> value="#{product.description.titleDE}" 
>> rendered="#{view.locale.language
>> eq 'de'}" />
>>                                 <h:outputText 
>> styleClass="contentRight"
>> value="#{product.description.titleFR}" 
>> rendered="#{view.locale.language
>> eq 'fr'}" />
>>                                 <h:outputText 
>> styleClass="contentRight"
>> value="#{product.description.titleES}" 
>> rendered="#{view.locale.language
>> eq 'es'}" />
>>                 </c:forEach>
>>
>>         </h:panelGrid>
>> ---
>> Sven Haiges
>> sven.haiges@gmx.de
>>
>> TEL +49 89 420 958 993
>> SIP 8008878@sipgate.de
>> ---
>> Sven Haiges
>> sven.haiges@gmx.de
>>
>> TEL +49 89 420 958 993
>> SIP 8008878@sipgate.de
>>
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>
---
Sven Haiges
sven.haiges@gmx.de

TEL +49 89 420 958 993
SIP 8008878@sipgate.de

Re: PanelGrid with dynamic amount of items

Posted by Martin Marinschek <ma...@gmail.com>.
Why don't you use a dataTable for this?

regards,

Martin

On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> Hi there,
>
> I would like to render a panelGrid with an dynamic amount of items  in
> it. The items should be bound to a managed bean variable and based on
> the database result, the display should adapt.
>
> PanelGrid worked fine with a static number of items, but how can I add
> a dynamic number of items. I know there are problems with c:forEach,
> that's probably why the example of my code below also does not work....
>
>
> Any help is appreciated!
>
> (one sec: I just got the idea to add the components on the server side,
> ok, but isn't there an easy solution that i can just do in my jsp
> page?)
>
> Cheers,
> Sven
>
>         <h:panelGrid columns="4" frame="border">
>
>                 <c:forEach var='product' items='#{productSearchBean.queryResults}'>
>                                 <h:outputText styleClass="contentRight"
> value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleEN}" rendered="#{view.locale.language
> eq 'en'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleDE}" rendered="#{view.locale.language
> eq 'de'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleFR}" rendered="#{view.locale.language
> eq 'fr'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleES}" rendered="#{view.locale.language
> eq 'es'}" />
>                 </c:forEach>
>
>         </h:panelGrid>
> ---
> Sven Haiges
> sven.haiges@gmx.de
>
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
> ---
> Sven Haiges
> sven.haiges@gmx.de
>
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

RE: PanelGrid with dynamic amount of items

Posted by Yee CN <ye...@streamyx.com>.
Thanks Martin, that is indeed what I am looking for. Still learning :)

Regards,
Yee

-----Original Message-----
From: Martin Marinschek [mailto:martin.marinschek@gmail.com] 
Sent: Thursday, 3 November 2005 1:23 AM
To: MyFaces Discussion; yeecn@streamyx.com
Subject: Re: PanelGrid with dynamic amount of items

Can I resuggest what Mathias said - try out

t:newspaperTable

regards,

Martin

On 11/2/05, Yee CN <ye...@streamyx.com> wrote:
> Mike,
>
> Thanks. You suggestions make a lot of sense. I can see how to subclass a
> datalist. As with adding a layout type - I have not finished scaling the
> learning curve yet. I don't know when I will be able to get around
learning
> component creation with the project deadline pressing on me right now. I
> like to participate eventually, as I really enjoyed the open source
> community.
>
> Anyway subclassing datalist will have to do for me for now. Maybe somebody
> can pickup the idea and implement it in Myfaces soon?
>
> Regards,
> Yee
>
> -----Original Message-----
> From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> Sent: Thursday, 3 November 2005 12:38 AM
> To: MyFaces Discussion; yeecn@streamyx.com
> Subject: Re: PanelGrid with dynamic amount of items
>
> Yee,
>
> This would probably make more sense as an additional layout type for
> dataList, or as a subclass of dataList, since it deals with formatting
> a list of data in arbitrary ways.
>
> However, as with most open source projects, new features are most
> likely to be implemented by the person who needs the functionality
> rather than by those who don't.
>
> Maybe you could provide a patch implementing this behavior?
>
> On 11/2/05, Yee CN <ye...@streamyx.com> wrote:
> > I like to propose a new component for Myfaces - t:repeater. It will
allow
> a
> > linear list of objects to be displayed in tabular form. The objects can
be
> > arranged in horizontal orientation. i.e.
> >
> > 1  2  3
> > 4  5  6
> > 7  8  9
> >
> > Or in vertical orientation, i.e.
> >
> > 1  4  7
> > 2  5  8
> > 3  6  9
> >
> > This is a control available in ASP.NET that I find very handy.
> >
> > It is a special case for t:columns, and I believe can be implemented on
> top
> > of t:columns quite easily.
> >
> > Regards,
> > Yee
> >
> > -----Original Message-----
> > From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> > Sent: Thursday, 3 November 2005 12:09 AM
> > To: MyFaces Discussion
> > Subject: Re: PanelGrid with dynamic amount of items
> >
> > Instead of dataTable, have you considered using t:dataList with
> > layout=simple?   It's probably the best JSF replacement for c:forEach.
> >
> > As for t:columns, consider it as a dataTable within a dataTable, only
> > the data is displayed horizontally rather than vertically.
> > Internally, it's just a UIData component just like dataTable or
> > dataList.
> >
> > -Mike
> >
> > On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> > > Hi there,
> > >
> > > I would like to render a panelGrid with an dynamic amount of items  in
> > > it. The items should be bound to a managed bean variable and based on
> > > the database result, the display should adapt.
> > >
> > > PanelGrid worked fine with a static number of items, but how can I add
> > > a dynamic number of items. I know there are problems with c:forEach,
> > > that's probably why the example of my code below also does not
work....
> > >
> > >
> > > Any help is appreciated!
> > >
> > > (one sec: I just got the idea to add the components on the server
side,
> > > ok, but isn't there an easy solution that i can just do in my jsp
> > > page?)
> > >
> > > Cheers,
> > > Sven
> > >
> > >         <h:panelGrid columns="4" frame="border">
> > >
> > >                 <c:forEach var='product'
> > items='#{productSearchBean.queryResults}'>
> > >                                 <h:outputText
styleClass="contentRight"
> > > value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
> > >                                 <h:outputText
styleClass="contentRight"
> > > value="#{product.description.titleEN}"
rendered="#{view.locale.language
> > > eq 'en'}" />
> > >                                 <h:outputText
styleClass="contentRight"
> > > value="#{product.description.titleDE}"
rendered="#{view.locale.language
> > > eq 'de'}" />
> > >                                 <h:outputText
styleClass="contentRight"
> > > value="#{product.description.titleFR}"
rendered="#{view.locale.language
> > > eq 'fr'}" />
> > >                                 <h:outputText
styleClass="contentRight"
> > > value="#{product.description.titleES}"
rendered="#{view.locale.language
> > > eq 'es'}" />
> > >                 </c:forEach>
> > >
> > >         </h:panelGrid>
> > > ---
> > > Sven Haiges
> > > sven.haiges@gmx.de
> > >
> > > TEL +49 89 420 958 993
> > > SIP 8008878@sipgate.de
> > > ---
> > > Sven Haiges
> > > sven.haiges@gmx.de
> > >
> > > TEL +49 89 420 958 993
> > > SIP 8008878@sipgate.de
> > >
> >
> >
>
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German


Re: PanelGrid with dynamic amount of items

Posted by Martin Marinschek <ma...@gmail.com>.
Can I resuggest what Mathias said - try out

t:newspaperTable

regards,

Martin

On 11/2/05, Yee CN <ye...@streamyx.com> wrote:
> Mike,
>
> Thanks. You suggestions make a lot of sense. I can see how to subclass a
> datalist. As with adding a layout type - I have not finished scaling the
> learning curve yet. I don't know when I will be able to get around learning
> component creation with the project deadline pressing on me right now. I
> like to participate eventually, as I really enjoyed the open source
> community.
>
> Anyway subclassing datalist will have to do for me for now. Maybe somebody
> can pickup the idea and implement it in Myfaces soon?
>
> Regards,
> Yee
>
> -----Original Message-----
> From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> Sent: Thursday, 3 November 2005 12:38 AM
> To: MyFaces Discussion; yeecn@streamyx.com
> Subject: Re: PanelGrid with dynamic amount of items
>
> Yee,
>
> This would probably make more sense as an additional layout type for
> dataList, or as a subclass of dataList, since it deals with formatting
> a list of data in arbitrary ways.
>
> However, as with most open source projects, new features are most
> likely to be implemented by the person who needs the functionality
> rather than by those who don't.
>
> Maybe you could provide a patch implementing this behavior?
>
> On 11/2/05, Yee CN <ye...@streamyx.com> wrote:
> > I like to propose a new component for Myfaces - t:repeater. It will allow
> a
> > linear list of objects to be displayed in tabular form. The objects can be
> > arranged in horizontal orientation. i.e.
> >
> > 1  2  3
> > 4  5  6
> > 7  8  9
> >
> > Or in vertical orientation, i.e.
> >
> > 1  4  7
> > 2  5  8
> > 3  6  9
> >
> > This is a control available in ASP.NET that I find very handy.
> >
> > It is a special case for t:columns, and I believe can be implemented on
> top
> > of t:columns quite easily.
> >
> > Regards,
> > Yee
> >
> > -----Original Message-----
> > From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> > Sent: Thursday, 3 November 2005 12:09 AM
> > To: MyFaces Discussion
> > Subject: Re: PanelGrid with dynamic amount of items
> >
> > Instead of dataTable, have you considered using t:dataList with
> > layout=simple?   It's probably the best JSF replacement for c:forEach.
> >
> > As for t:columns, consider it as a dataTable within a dataTable, only
> > the data is displayed horizontally rather than vertically.
> > Internally, it's just a UIData component just like dataTable or
> > dataList.
> >
> > -Mike
> >
> > On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> > > Hi there,
> > >
> > > I would like to render a panelGrid with an dynamic amount of items  in
> > > it. The items should be bound to a managed bean variable and based on
> > > the database result, the display should adapt.
> > >
> > > PanelGrid worked fine with a static number of items, but how can I add
> > > a dynamic number of items. I know there are problems with c:forEach,
> > > that's probably why the example of my code below also does not work....
> > >
> > >
> > > Any help is appreciated!
> > >
> > > (one sec: I just got the idea to add the components on the server side,
> > > ok, but isn't there an easy solution that i can just do in my jsp
> > > page?)
> > >
> > > Cheers,
> > > Sven
> > >
> > >         <h:panelGrid columns="4" frame="border">
> > >
> > >                 <c:forEach var='product'
> > items='#{productSearchBean.queryResults}'>
> > >                                 <h:outputText styleClass="contentRight"
> > > value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
> > >                                 <h:outputText styleClass="contentRight"
> > > value="#{product.description.titleEN}" rendered="#{view.locale.language
> > > eq 'en'}" />
> > >                                 <h:outputText styleClass="contentRight"
> > > value="#{product.description.titleDE}" rendered="#{view.locale.language
> > > eq 'de'}" />
> > >                                 <h:outputText styleClass="contentRight"
> > > value="#{product.description.titleFR}" rendered="#{view.locale.language
> > > eq 'fr'}" />
> > >                                 <h:outputText styleClass="contentRight"
> > > value="#{product.description.titleES}" rendered="#{view.locale.language
> > > eq 'es'}" />
> > >                 </c:forEach>
> > >
> > >         </h:panelGrid>
> > > ---
> > > Sven Haiges
> > > sven.haiges@gmx.de
> > >
> > > TEL +49 89 420 958 993
> > > SIP 8008878@sipgate.de
> > > ---
> > > Sven Haiges
> > > sven.haiges@gmx.de
> > >
> > > TEL +49 89 420 958 993
> > > SIP 8008878@sipgate.de
> > >
> >
> >
>
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

Re: Javascript conflict between x:tree2 and x:inputCalendar

Posted by Martin Marinschek <ma...@gmail.com>.
yes, that might as well be.

Can you add this to the open issue?

regards,

Martin

On 11/4/05, Luciano Medina <lm...@tissat.es> wrote:
> Does anyone have any idea of what's happening with the javascript resources
> lately, that they seem to conflict with each other? Specifically, as I
> reported on issue #MYFACES-743, I can't have x:tree2 with client-side
> toggling and x:calendar with popup, because the treeNavClick javascript
> function fails.
>
> Also, I noticed that the generated HTML body tag is malformed:
>
>         <body ">
>
> (with a space and a quotation mark) Could this be related to the problem?
>
>
>
> ------------------------------------------------------------------------------------------------------------------------------------
> Nota Legal: Este correo electronico puede contener informacion estrictamente confidencial y es de uso exclusivo del destinatario, quedando prohibida a cualquier otra persona su revelacion, copia, distribucion, o el ejercicio de cualquier accion relativa a su contenido. Si ha recibido este correo electronico por error, por favor, conteste al remitente, y posteriormente proceda a borrarlo de su sistema. Gracias por su colaboracion.
>
> Confidentiality notice: This e-mail message may contain confidential and/or legally privileged information and is solely for the attention and use of the intended recipient. Any disclosure, copying, distribution or the taking of any action with relation to  the contents of this e-mail by any other person is strictly prohibited. If you believe that this e-mail has been mistakenly sent  to you, please reply to the sender from whom you received the message in error and then delete the original e-mail from your system. Thank you for your co-operation.
> ------------------------------------------------------------------------------------------------------------------------------------
>
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

Javascript conflict between x:tree2 and x:inputCalendar

Posted by Luciano Medina <lm...@tissat.es>.
Does anyone have any idea of what's happening with the javascript resources
lately, that they seem to conflict with each other? Specifically, as I
reported on issue #MYFACES-743, I can't have x:tree2 with client-side
toggling and x:calendar with popup, because the treeNavClick javascript
function fails.

Also, I noticed that the generated HTML body tag is malformed:

	<body ">

(with a space and a quotation mark) Could this be related to the problem?



------------------------------------------------------------------------------------------------------------------------------------
Nota Legal: Este correo electronico puede contener informacion estrictamente confidencial y es de uso exclusivo del destinatario, quedando prohibida a cualquier otra persona su revelacion, copia, distribucion, o el ejercicio de cualquier accion relativa a su contenido. Si ha recibido este correo electronico por error, por favor, conteste al remitente, y posteriormente proceda a borrarlo de su sistema. Gracias por su colaboracion.

Confidentiality notice: This e-mail message may contain confidential and/or legally privileged information and is solely for the attention and use of the intended recipient. Any disclosure, copying, distribution or the taking of any action with relation to  the contents of this e-mail by any other person is strictly prohibited. If you believe that this e-mail has been mistakenly sent  to you, please reply to the sender from whom you received the message in error and then delete the original e-mail from your system. Thank you for your co-operation.
------------------------------------------------------------------------------------------------------------------------------------


RE: PanelGrid with dynamic amount of items

Posted by Yee CN <ye...@streamyx.com>.
Mike,

Thanks. You suggestions make a lot of sense. I can see how to subclass a
datalist. As with adding a layout type - I have not finished scaling the
learning curve yet. I don't know when I will be able to get around learning
component creation with the project deadline pressing on me right now. I
like to participate eventually, as I really enjoyed the open source
community.

Anyway subclassing datalist will have to do for me for now. Maybe somebody
can pickup the idea and implement it in Myfaces soon?

Regards,
Yee

-----Original Message-----
From: Mike Kienenberger [mailto:mkienenb@gmail.com] 
Sent: Thursday, 3 November 2005 12:38 AM
To: MyFaces Discussion; yeecn@streamyx.com
Subject: Re: PanelGrid with dynamic amount of items

Yee,

This would probably make more sense as an additional layout type for
dataList, or as a subclass of dataList, since it deals with formatting
a list of data in arbitrary ways.

However, as with most open source projects, new features are most
likely to be implemented by the person who needs the functionality
rather than by those who don't.

Maybe you could provide a patch implementing this behavior?

On 11/2/05, Yee CN <ye...@streamyx.com> wrote:
> I like to propose a new component for Myfaces - t:repeater. It will allow
a
> linear list of objects to be displayed in tabular form. The objects can be
> arranged in horizontal orientation. i.e.
>
> 1  2  3
> 4  5  6
> 7  8  9
>
> Or in vertical orientation, i.e.
>
> 1  4  7
> 2  5  8
> 3  6  9
>
> This is a control available in ASP.NET that I find very handy.
>
> It is a special case for t:columns, and I believe can be implemented on
top
> of t:columns quite easily.
>
> Regards,
> Yee
>
> -----Original Message-----
> From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> Sent: Thursday, 3 November 2005 12:09 AM
> To: MyFaces Discussion
> Subject: Re: PanelGrid with dynamic amount of items
>
> Instead of dataTable, have you considered using t:dataList with
> layout=simple?   It's probably the best JSF replacement for c:forEach.
>
> As for t:columns, consider it as a dataTable within a dataTable, only
> the data is displayed horizontally rather than vertically.
> Internally, it's just a UIData component just like dataTable or
> dataList.
>
> -Mike
>
> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> > Hi there,
> >
> > I would like to render a panelGrid with an dynamic amount of items  in
> > it. The items should be bound to a managed bean variable and based on
> > the database result, the display should adapt.
> >
> > PanelGrid worked fine with a static number of items, but how can I add
> > a dynamic number of items. I know there are problems with c:forEach,
> > that's probably why the example of my code below also does not work....
> >
> >
> > Any help is appreciated!
> >
> > (one sec: I just got the idea to add the components on the server side,
> > ok, but isn't there an easy solution that i can just do in my jsp
> > page?)
> >
> > Cheers,
> > Sven
> >
> >         <h:panelGrid columns="4" frame="border">
> >
> >                 <c:forEach var='product'
> items='#{productSearchBean.queryResults}'>
> >                                 <h:outputText styleClass="contentRight"
> > value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
> >                                 <h:outputText styleClass="contentRight"
> > value="#{product.description.titleEN}" rendered="#{view.locale.language
> > eq 'en'}" />
> >                                 <h:outputText styleClass="contentRight"
> > value="#{product.description.titleDE}" rendered="#{view.locale.language
> > eq 'de'}" />
> >                                 <h:outputText styleClass="contentRight"
> > value="#{product.description.titleFR}" rendered="#{view.locale.language
> > eq 'fr'}" />
> >                                 <h:outputText styleClass="contentRight"
> > value="#{product.description.titleES}" rendered="#{view.locale.language
> > eq 'es'}" />
> >                 </c:forEach>
> >
> >         </h:panelGrid>
> > ---
> > Sven Haiges
> > sven.haiges@gmx.de
> >
> > TEL +49 89 420 958 993
> > SIP 8008878@sipgate.de
> > ---
> > Sven Haiges
> > sven.haiges@gmx.de
> >
> > TEL +49 89 420 958 993
> > SIP 8008878@sipgate.de
> >
>
>


Re: PanelGrid with dynamic amount of items

Posted by Mike Kienenberger <mk...@gmail.com>.
Yee,

This would probably make more sense as an additional layout type for
dataList, or as a subclass of dataList, since it deals with formatting
a list of data in arbitrary ways.

However, as with most open source projects, new features are most
likely to be implemented by the person who needs the functionality
rather than by those who don't.

Maybe you could provide a patch implementing this behavior?

On 11/2/05, Yee CN <ye...@streamyx.com> wrote:
> I like to propose a new component for Myfaces - t:repeater. It will allow a
> linear list of objects to be displayed in tabular form. The objects can be
> arranged in horizontal orientation. i.e.
>
> 1  2  3
> 4  5  6
> 7  8  9
>
> Or in vertical orientation, i.e.
>
> 1  4  7
> 2  5  8
> 3  6  9
>
> This is a control available in ASP.NET that I find very handy.
>
> It is a special case for t:columns, and I believe can be implemented on top
> of t:columns quite easily.
>
> Regards,
> Yee
>
> -----Original Message-----
> From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> Sent: Thursday, 3 November 2005 12:09 AM
> To: MyFaces Discussion
> Subject: Re: PanelGrid with dynamic amount of items
>
> Instead of dataTable, have you considered using t:dataList with
> layout=simple?   It's probably the best JSF replacement for c:forEach.
>
> As for t:columns, consider it as a dataTable within a dataTable, only
> the data is displayed horizontally rather than vertically.
> Internally, it's just a UIData component just like dataTable or
> dataList.
>
> -Mike
>
> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> > Hi there,
> >
> > I would like to render a panelGrid with an dynamic amount of items  in
> > it. The items should be bound to a managed bean variable and based on
> > the database result, the display should adapt.
> >
> > PanelGrid worked fine with a static number of items, but how can I add
> > a dynamic number of items. I know there are problems with c:forEach,
> > that's probably why the example of my code below also does not work....
> >
> >
> > Any help is appreciated!
> >
> > (one sec: I just got the idea to add the components on the server side,
> > ok, but isn't there an easy solution that i can just do in my jsp
> > page?)
> >
> > Cheers,
> > Sven
> >
> >         <h:panelGrid columns="4" frame="border">
> >
> >                 <c:forEach var='product'
> items='#{productSearchBean.queryResults}'>
> >                                 <h:outputText styleClass="contentRight"
> > value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
> >                                 <h:outputText styleClass="contentRight"
> > value="#{product.description.titleEN}" rendered="#{view.locale.language
> > eq 'en'}" />
> >                                 <h:outputText styleClass="contentRight"
> > value="#{product.description.titleDE}" rendered="#{view.locale.language
> > eq 'de'}" />
> >                                 <h:outputText styleClass="contentRight"
> > value="#{product.description.titleFR}" rendered="#{view.locale.language
> > eq 'fr'}" />
> >                                 <h:outputText styleClass="contentRight"
> > value="#{product.description.titleES}" rendered="#{view.locale.language
> > eq 'es'}" />
> >                 </c:forEach>
> >
> >         </h:panelGrid>
> > ---
> > Sven Haiges
> > sven.haiges@gmx.de
> >
> > TEL +49 89 420 958 993
> > SIP 8008878@sipgate.de
> > ---
> > Sven Haiges
> > sven.haiges@gmx.de
> >
> > TEL +49 89 420 958 993
> > SIP 8008878@sipgate.de
> >
>
>

Re: PanelGrid with dynamic amount of items

Posted by Sven Haiges <sv...@web.de>.
exactly what I need, too.

martin told me that there is the possibility to add children to a 
panelGrid  programmatically, but I haven't tried it yet. if it works, i 
will post it here.

sven
Am 02.11.2005 um 17:28 Uhr schrieb Yee CN:



> I like to propose a new component for Myfaces - t:repeater. It will 
> allow a
> linear list of objects to be displayed in tabular form. The objects 
> can be
> arranged in horizontal orientation. i.e.
>
> 1  2  3
> 4  5  6
> 7  8  9
>
> Or in vertical orientation, i.e.
>
> 1  4  7
> 2  5  8
> 3  6  9
>
> This is a control available in ASP.NET that I find very handy.
>
> It is a special case for t:columns, and I believe can be implemented 
> on top
> of t:columns quite easily.
>
> Regards,
> Yee
>
> -----Original Message-----
> From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> Sent: Thursday, 3 November 2005 12:09 AM
> To: MyFaces Discussion
> Subject: Re: PanelGrid with dynamic amount of items
>
> Instead of dataTable, have you considered using t:dataList with
> layout=simple?   It's probably the best JSF replacement for c:forEach.
>
> As for t:columns, consider it as a dataTable within a dataTable, only
> the data is displayed horizontally rather than vertically.
> Internally, it's just a UIData component just like dataTable or
> dataList.
>
> -Mike
>
> On 11/1/05, Sven Haiges <sv...@web.de> wrote:
>> Hi there,
>>
>> I would like to render a panelGrid with an dynamic amount of items  in
>> it. The items should be bound to a managed bean variable and based on
>> the database result, the display should adapt.
>>
>> PanelGrid worked fine with a static number of items, but how can I add
>> a dynamic number of items. I know there are problems with c:forEach,
>> that's probably why the example of my code below also does not 
>> work....
>>
>>
>> Any help is appreciated!
>>
>> (one sec: I just got the idea to add the components on the server 
>> side,
>> ok, but isn't there an easy solution that i can just do in my jsp
>> page?)
>>
>> Cheers,
>> Sven
>>
>>         <h:panelGrid columns="4" frame="border">
>>
>>                 <c:forEach var='product'
> items='#{productSearchBean.queryResults}'>
>>                                 <h:outputText 
>> styleClass="contentRight"
>> value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
>>                                 <h:outputText 
>> styleClass="contentRight"
>> value="#{product.description.titleEN}" 
>> rendered="#{view.locale.language
>> eq 'en'}" />
>>                                 <h:outputText 
>> styleClass="contentRight"
>> value="#{product.description.titleDE}" 
>> rendered="#{view.locale.language
>> eq 'de'}" />
>>                                 <h:outputText 
>> styleClass="contentRight"
>> value="#{product.description.titleFR}" 
>> rendered="#{view.locale.language
>> eq 'fr'}" />
>>                                 <h:outputText 
>> styleClass="contentRight"
>> value="#{product.description.titleES}" 
>> rendered="#{view.locale.language
>> eq 'es'}" />
>>                 </c:forEach>
>>
>>         </h:panelGrid>
>> ---
>> Sven Haiges
>> sven.haiges@gmx.de
>>
>> TEL +49 89 420 958 993
>> SIP 8008878@sipgate.de
>> ---
>> Sven Haiges
>> sven.haiges@gmx.de
>>
>> TEL +49 89 420 958 993
>> SIP 8008878@sipgate.de
>>
>
>
---
Sven Haiges
sven.haiges@gmx.de

TEL +49 89 420 958 993
SIP 8008878@sipgate.de

RE: PanelGrid with dynamic amount of items

Posted by Yee CN <ye...@streamyx.com>.
I like to propose a new component for Myfaces - t:repeater. It will allow a
linear list of objects to be displayed in tabular form. The objects can be
arranged in horizontal orientation. i.e.

1  2  3
4  5  6
7  8  9

Or in vertical orientation, i.e.

1  4  7
2  5  8
3  6  9

This is a control available in ASP.NET that I find very handy.

It is a special case for t:columns, and I believe can be implemented on top
of t:columns quite easily.

Regards,
Yee

-----Original Message-----
From: Mike Kienenberger [mailto:mkienenb@gmail.com] 
Sent: Thursday, 3 November 2005 12:09 AM
To: MyFaces Discussion
Subject: Re: PanelGrid with dynamic amount of items

Instead of dataTable, have you considered using t:dataList with
layout=simple?   It's probably the best JSF replacement for c:forEach.

As for t:columns, consider it as a dataTable within a dataTable, only
the data is displayed horizontally rather than vertically.  
Internally, it's just a UIData component just like dataTable or
dataList.

-Mike

On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> Hi there,
>
> I would like to render a panelGrid with an dynamic amount of items  in
> it. The items should be bound to a managed bean variable and based on
> the database result, the display should adapt.
>
> PanelGrid worked fine with a static number of items, but how can I add
> a dynamic number of items. I know there are problems with c:forEach,
> that's probably why the example of my code below also does not work....
>
>
> Any help is appreciated!
>
> (one sec: I just got the idea to add the components on the server side,
> ok, but isn't there an easy solution that i can just do in my jsp
> page?)
>
> Cheers,
> Sven
>
>         <h:panelGrid columns="4" frame="border">
>
>                 <c:forEach var='product'
items='#{productSearchBean.queryResults}'>
>                                 <h:outputText styleClass="contentRight"
> value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleEN}" rendered="#{view.locale.language
> eq 'en'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleDE}" rendered="#{view.locale.language
> eq 'de'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleFR}" rendered="#{view.locale.language
> eq 'fr'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleES}" rendered="#{view.locale.language
> eq 'es'}" />
>                 </c:forEach>
>
>         </h:panelGrid>
> ---
> Sven Haiges
> sven.haiges@gmx.de
>
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
> ---
> Sven Haiges
> sven.haiges@gmx.de
>
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
>


Re: PanelGrid with dynamic amount of items

Posted by Mike Kienenberger <mk...@gmail.com>.
Instead of dataTable, have you considered using t:dataList with
layout=simple?   It's probably the best JSF replacement for c:forEach.

As for t:columns, consider it as a dataTable within a dataTable, only
the data is displayed horizontally rather than vertically.  
Internally, it's just a UIData component just like dataTable or
dataList.

-Mike

On 11/1/05, Sven Haiges <sv...@web.de> wrote:
> Hi there,
>
> I would like to render a panelGrid with an dynamic amount of items  in
> it. The items should be bound to a managed bean variable and based on
> the database result, the display should adapt.
>
> PanelGrid worked fine with a static number of items, but how can I add
> a dynamic number of items. I know there are problems with c:forEach,
> that's probably why the example of my code below also does not work....
>
>
> Any help is appreciated!
>
> (one sec: I just got the idea to add the components on the server side,
> ok, but isn't there an easy solution that i can just do in my jsp
> page?)
>
> Cheers,
> Sven
>
>         <h:panelGrid columns="4" frame="border">
>
>                 <c:forEach var='product' items='#{productSearchBean.queryResults}'>
>                                 <h:outputText styleClass="contentRight"
> value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleEN}" rendered="#{view.locale.language
> eq 'en'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleDE}" rendered="#{view.locale.language
> eq 'de'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleFR}" rendered="#{view.locale.language
> eq 'fr'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleES}" rendered="#{view.locale.language
> eq 'es'}" />
>                 </c:forEach>
>
>         </h:panelGrid>
> ---
> Sven Haiges
> sven.haiges@gmx.de
>
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
> ---
> Sven Haiges
> sven.haiges@gmx.de
>
> TEL +49 89 420 958 993
> SIP 8008878@sipgate.de
>