Book Image

Tapestry 5: Building Web Applications

Book Image

Tapestry 5: Building Web Applications

Overview of this book

Table of Contents (17 chapters)
Tapestry 5
Credits
About the Author
About the Reviewers
Preface
Foreword
Where to Go Next

Tweaking BeanEditForm


There are a few parameters that we could use to tweak the component. First of all, you will probably want the submit button to display a different label, not the default Create/Update. Nothing could be easier:

<t:beaneditform t:id="celebrity" t:submitLabel="Save"/>

You can also explicitly specify the object that BeanEditForm should work with, and use an arbitrary id:

<t:beaneditform t:id="celebrityEditor" t:object="celebrity"
t:submitLabel="Save"/>

Although BeanEditForm made a lot of clever guesses, in many cases we shall want to somehow influence the way it works. As with the Grid component in the previous section, we'll want to remove the Id field and change the order of fields in the form, so that the Birth Date Verified check box is underneath the Birth Date control.

Note

By the way, did you notice that the label for this control is Birth Date, not Date Of Birth, as would be automatically generated by Tapestry? This is because of the entry that we've added...