I have the a Person.java object that I'm trying to use the BeanEditForm
component with. It has no Tapestry annotations in it. Is it possible to use
the BeanEditForm component with it? Here's the error I'm getting:

Render queue error in AfterRender[PersonForm:beaneditform.editor.loop]:
Failure reading parameter 'validate' of component
core/PropertyEditBlocks:datefield: No object of type
org.apache.tapestry5.services.PropertyEditContext is available from the
Environment. Available types are org.apache.tapestry5.RenderSupport,
org.apache.tapestry5.ValidationDecorator,
org.apache.tapestry5.ValidationTracker,
org.apache.tapestry5.internal.services.ClientBehaviorSupport,
org.apache.tapestry5.services.FormSupport,
org.apache.tapestry5.services.Heartbeat.

My template is as follows:

<t:layout title="message:personDetail.title"
          heading="message:personDetail.heading" menu="literal:PersonMenu"
          xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

    <t:beaneditform object="person" id="personForm" exclude="id">
        <t:parameter name="buttons">
            <input type="submit" name="delete"
value="message:button.delete"/>
            <input type="submit" name="cancel"
value="message:button.cancel"/>
        </t:parameter>
    </t:beaneditform>

    <script type="text/javascript">
        Form.focusFirstElement($("personForm"));
    </script>

</t:layout>

My Person.java object looks as follows:

package com.company.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name = "person")
public class Person {
    private Long id;
    private Date creationDate;
    private String email;
    private Integer age;
    private Date modificationDate;
    private String username;
    private boolean active;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    @Column(name = "creation_date", nullable = false)
    public Date getCreationDate() {
        return creationDate;
    }

    @Column(name = "email_address", length = 40, unique = true, nullable =
false)
    public String getEmail() {
        return email;
    }

    @Column(name = "modification_date", nullable = false)
    public Date getModificationDate() {
        return modificationDate;
    }

    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    @Column(nullable = false)
    public Integer getAge() {
        return age;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setModificationDate(Date modificationDate) {
        this.modificationDate = modificationDate;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }
}

Any help is appreciated.

Thanks,

Matt
-- 
View this message in context: 
http://www.nabble.com/Problem-using-BeanEditForm-with-a-POJO-tp23349016p23349016.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to