Advertisement

06.27.2008 at 06:58AM PDT, ID: 23521624
[x]
Attachment Details

how do i bind a jsf table column to a joined entity class field

Asked by cavtel in Java Server Faces (JSF), NetBeans IDE, Enterprise Java Beans (EJB)

Tags: java, JSF, entity classes, netbeans 6.x

i have 2 entity classes

(abbreviated)

@Entity
@Table(name = "CUSTOMER_ADDRESSES",schema="TEST")
class Address {
    @Column(name = "NAME", nullable = false)
    private String name;

    @JoinColumn(name = "STATE", referencedColumnName = "STATE")
    @ManyToOne
    private StateLookup state;
}

@Entity
@Table(name = "STATE_LOOKUP",schema="TEST")
class Address {
    @Id
    @Column(name = "STATE", nullable = false)
    private String state;

    @Column(name = "DESCRIPTION", nullable = false)
    private String description;

    @Override
    public String toString() {
        return this.getState();
    }
}


my jsf page binds a table to the entity class and right now i am displaying the state just fine.  however i really want to display the state.description.  i tried to use the obvious text="#{currentRow.value['state.description']}"  but netbeans throws a property not found exception.

<webuijsf:tableColumn headerText="STATE_DESCRIPTION" height="52" id="tableColumn2" noWrap="true" sort="state" valign="middle" width="250">
                                    <webuijsf:staticText id="staticText2" text="#{currentRow.value['state']}"/>
</webuijsf:tableColumn>

this has to be a very basic thing to do, any help is appreciated.Start Free Trial
 
Loading Advertisement...
 
[+][-]06.29.2008 at 10:40PM PDT, ID: 21896826

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Server Faces (JSF), NetBeans IDE, Enterprise Java Beans (EJB)
Tags: java, JSF, entity classes, netbeans 6.x
Sign Up Now!
Solution Provided By: Nellios
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628