-
1. Re: Displaying dataTable row numbers with uiComponent, what
mars1412 Jan 23, 2008 12:18 PM (in response to oberiko)does it work when you remove thr "row" column and just display smth. like emailAddresses.Id (or what ever)?
maybe also post your person and emailAddresses source -
2. Re: Displaying dataTable row numbers with uiComponent, what
oberiko Jan 23, 2008 12:47 PM (in response to oberiko)I've tried without the <h:output /> (so that it looked exactly as the demo) and had the same result.
Nothing special about person, it's a fairly standard basic entity bean:package org.domain.myProject.entity; import java.util.ArrayList; import java.util.Collection; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; import org.hibernate.validator.NotNull; import org.jboss.seam.annotations.Name; @Entity @Name("person") public class Person { @Id @GeneratedValue private Long id; @NotNull private String name; @OneToMany(cascade = CascadeType.ALL, mappedBy="person") private Collection<EmailAddress> emailAddresses; public Long getId() {return id;} public void setId(Long id) {this.id = id;} public String getName() {return name;} public void setName(String name) {this.name = name;} public Collection<EmailAddress> getEmailAddresses() { return emailAddresses; } public void setEmailAddresses(Collection<EmailAddress> emailAddresses) { this.emailAddresses = emailAddresses; } public void addEmailAddress(EmailAddress email){ if (emailAddresses == null) emailAddresses= new ArrayList<EmailAddress>(); email.setPerson(this); emailAddresses.add(email); } public void removeEmailAddress(EmailAddress emailAddress){ if (emailAddresses != null){ emailAddresses.remove(emailAddress); } } }
-
3. Re: Displaying dataTable row numbers with uiComponent, what
ristretto Jan 23, 2008 3:52 PM (in response to oberiko)Check out this post
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=105780
Last post in that thread. Using binding as described worked for me. -
4. Re: Displaying dataTable row numbers with uiComponent, what
oberiko Jan 23, 2008 4:06 PM (in response to oberiko)Hmm... I was hoping to avoid binding and creating additional components if possible. It's not a highly needed feature, and I think the solution on that thread outweighes the benefits.
Still, nothing about the uiComponent? That looked like the nice and simple solution I was looking for.