Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 40685 invoked from network); 12 Dec 2005 16:12:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Dec 2005 16:12:03 -0000 Received: (qmail 36234 invoked by uid 500); 12 Dec 2005 16:12:00 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 35950 invoked by uid 500); 12 Dec 2005 16:11:58 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 35939 invoked by uid 99); 12 Dec 2005 16:11:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2005 08:11:58 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [80.123.121.133] (HELO wmxsrv.sys.wimaxtelecom.at) (80.123.121.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2005 08:11:56 -0800 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: datatable - parameter passing - workaround? X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Mon, 12 Dec 2005 17:12:48 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Re: datatable - parameter passing - workaround? Thread-Index: AcX/Kgk8oqGL8jWfQo2/gXtO1V5+6QACgkHQ From: =?iso-8859-1?Q?Harald_M=FCller?= To: "MyFaces Discussion" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Mathias! Thanks for your answer. Unfortunately I've still some problems with it ... Changes I've made: List contentList =3D new ArrayList(); for (int i =3D 0 ; i<10;i++) { contentList.add("row " + i); } DataModel content =3D new ListDataModel(contentList); hdt.setValue(content); The console-output looks like: [STDOUT] >>>>>>>>>> =3D=3D> ROWCOUNT 2 [STDOUT] >>>>>>>>>> =3D=3D> ROWINDEX 0 [STDOUT] >>>>>>>>>> =3D=3D> WRAPPEDDATA = [org.jbpm.taskmgmt.exe.TaskInstance@1a9b034, = org.jbpm.taskmgmt.exe.TaskInstance@b950d1] [STDOUT] >>>>>>>>>> =3D=3D> ROWDATA = org.jbpm.taskmgmt.exe.TaskInstance@1a9b034 [STDOUT] >>>>>>>>>> =3D=3D> ROWCOUNT 2 [STDOUT] >>>>>>>>>> =3D=3D> ROWINDEX 0 [STDOUT] >>>>>>>>>> =3D=3D> WRAPPEDDATA = [org.jbpm.taskmgmt.exe.TaskInstance@1a9b034, = org.jbpm.taskmgmt.exe.TaskInstance@b950d1] [STDOUT] >>>>>>>>>> =3D=3D> ROWDATA = org.jbpm.taskmgmt.exe.TaskInstance@1a9b034 As you can see there are 2 elements (wrappeddata) but the rowindex is = not incremented during the iteration ... so I always get the first = element/object back by using 'content.getRowData()'. What am I doing wrong? Thanks, Harry -----Urspr=FCngliche Nachricht----- Von: Mathias Br=F6kelmann [mailto:mbroekelmann@googlemail.com]=20 Gesendet: Montag, 12. Dezember 2005 15:39 An: MyFaces Discussion Betreff: Re: datatable - parameter passing - workaround? use an instance of javax.faces.model.DataModel for the datatable=B4s value. You can then use datamodel.getRowIndex() or datamodel.getRowData() to get the current row value during the iteration. 2005/12/12, Harald M=FCller : > Hi! > > My current (test)code to create a datatable in a dynamic created tab = looks like this: > > > // datatable > UIData hdt =3D = (HtmlDataTable)app.createComponent(HtmlDataTable.COMPONENT_TYPE); > hdt.setId("hdtId1"); > hdt.setVar("hdtVar1"); > tab.getChildren().add(hdt); > > List content =3D new ArrayList(); > for (int i =3D 0 ; i<10;i++) { > content.add("row " + i); > } > hdt.setValue(content); > > // create column > UIColumn column =3D = (UIColumn)app.createComponent(HtmlSimpleColumn.COMPONENT_TYPE); > > // create and add header > UIOutput header =3D = (UIOutput)app.createComponent(HtmlOutputText.COMPONENT_TYPE); > header.setValue("Last Column"); > column.setHeader(header); > > // create and add content > UIOutput text =3D = (UIOutput)app.createComponent(HtmlOutputText.COMPONENT_TYPE); > ValueBinding valueBinding =3D app.createValueBinding(#{hdtVar1}) > text.setValueBinding("value", valueBinding); > column.getChildren().add(text); > > // add column > hdt.getChildren().add(column); > > > > Ok ... it is not possible to pass a parameter using "valuebinding" - = so, there is no way > to call #{hdtVar1.name(mystring)} ... right? > > Is there a way to call a bean-setter and set the current object (of = the datatable-iteration) > in my bean, so that I'm able to call something like 'String whatever = =3D hdtVar1.getName("mystring")' > and do a 'text.setValue(whatever)' from there? > > Thanks, > Harry > -- Mathias