|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value=FIELD) @Retention(value=RUNTIME) public @interface Bindable
Provides a Page field auto binding annotation. Please see the user guide sections on Autobinding and Autobinding Using Annotations for a detailed description of Page field binding.
Bindable can bind private, protected and public Page fields. Note if a @Bindable field's visibility is not public then Click will set the field to be accessible using reflection. If the Java application server has restricted security policies in place then this may cause a SecurityException to be thrown. In these environments you can either modify your fields visibility to be public or modify your servers Java security policy.<click-app> <pages package="com.mycorp.page" autobinding="annotation"/> </click-app>
public class BindableDemo extends Page { // ActionLink automatically added to Page control list @Bindable protected ActionLink link = new ActionLink(); // Message string is automatically added to Page model @Bindable protected String message; public BindableDemo() { // Listener method invoked when link clicked link.setActionListener(new ActionListener() { public boolean onAction(Control source) { // message added to page mode and rendered in template message = "I was clicked"; return true; } }); } }
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |