Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-tapestry Wiki" 
for change notification.

The following page has been changed by DanielGredler:
http://wiki.apache.org/jakarta-tapestry/BeanForm

------------------------------------------------------------------------------
  
  {{{<span jwcid="@BeanForm" bean="ognl:pojo" save="ognl:listeners.save" 
delete="ognl:listeners.delete"/>}}}
  
- The above code gets you a form that will call save() when submitted for save, 
delete() when submitted for delete, displays a TextField for every string or 
number property, a Checkbox for every boolean property and a DatePicker for 
every date property, and automatically disables fields for read-only 
properties. Properties are discovered via 
[http://java.sun.com/docs/books/tutorial/javabeans/index.html bean 
introspection]. You can use the BeanForm with a single line, as above, or you 
can include it inside one of your existing Forms, in which case the internal 
Form component will not be generated. It's your choice.
+ The above code gets you a form that will call save() when submitted for save, 
delete() when submitted for delete, displays a !TextField for every string or 
number property, a Checkbox for every boolean property and a !DatePicker for 
every date property, and automatically disables fields for read-only 
properties. Properties are discovered via 
[http://java.sun.com/docs/books/tutorial/javabeans/index.html bean 
introspection]. You can use the BeanForm with a single line, as above, or you 
can include it inside one of your existing Forms, in which case the internal 
Form component will not be generated. It's your choice.
  
  You can also specify exactly which properties you want included in the 
BeanForm, as well as cancel and refresh listeners. When you explicitly specify 
editable properties, those properties are shown on the page in the order you 
specify:
  
  {{{<span jwcid="@BeanForm" bean="ognl:pojo" 
properties="ognl:'name,email,comment'" save="ognl:listeners.save" 
cancel="ognl:listeners.cancel" refresh="ognl:listeners.refresh" />}}}
  
- The generated HTML is a form containing a two-column table (unless the 
BeanForm is already inside a Form, in which case no Form is generated). The 
left column contains the field labels and the right column contains the data 
entry fields. The bottom row spans both columns and contains the save button, 
the cancel button (if the ''cancel'' parameter was specified), the refresh 
button (if the ''refresh'' parameter was specified) and the delete button (if 
the ''delete'' parameter was specified). The table can be styled using CSS: the 
table's CSS class is ''beanFormTable'', the left column's CSS class is 
''beanFormLeftColumn'', the right column's CSS class is 
''beanFormRightColumn'', and the bottom column that contains the buttons has 
the CSS class ''beanFormButtonColumn''.
+ The generated HTML is a form containing a two-column table (unless the 
BeanForm is already inside a Form, in which case another Form is not 
generated). The left column contains the field labels and the right column 
contains the data entry fields. The bottom row spans both columns and contains 
the save button, the cancel button (if the ''cancel'' parameter was specified), 
the refresh button (if the ''refresh'' parameter was specified) and the delete 
button (if the ''delete'' parameter was specified). The table can be styled 
using CSS: the table's CSS class is ''beanFormTable'', the left column's CSS 
class is ''beanFormLeftColumn'', the right column's CSS class is 
''beanFormRightColumn'', and the bottom column that contains the buttons has 
the CSS class ''beanFormButtonColumn''.
  
- If you need to customize any of the input fields, you can do so by adding a 
Block component to your page (with the id ''[propertyName]BeanFieldBlock'') 
that contains any IFormComponent (with the id ''[propertyName]BeanField''). For 
example, if you wanted to edit the ''comment'' property in a text area instead 
of the default textfield, you could add the following to your page:
+ If you need to customize any of the input fields, you can do so by adding a 
Block component to your page (with the id ''"[propertyName]!BeanFieldBlock"'') 
that contains any I!FormComponent (with the id ''"[propertyName]!BeanField"''). 
For example, if you wanted to edit the ''comment'' property in a text area 
instead of the default textfield, you could add the following to your page:
  
  {{{<div jwcid="[EMAIL PROTECTED]"><input jwcid="[EMAIL PROTECTED]" 
value="ognl:pojo.comment" displayName="message:comment"/></div>}}}
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to