Previous | Next | WireHose Developers Guide |
SignupPage is a typical WebObjects component, with the exception that the message prompt and field and button labels will be localizable rather than hard-coded into the HTML or Java code. You can resolve localized strings with a simple @string.key or self.@string.key.
Note: Other useful bindings provided by WHComponent include @userCanEdit.keyPath and @userCanView.keyPath, which return true or false by querying the application helper (and its delegate, if set) as to whether or not the object identified by keyPath in the current context can be edited, viewed or deleted by the current user. The keyPath is any keypath which is currently valid, so you can bind things like @userCanEdit.helper.editingObject to a WOConditional. Note: WebObjects Builder on Windows will not allow bindings which start with an "@", such as @string.key, so WireHose also supports self.@string.key. There are no performance penalties for using WHComponent's self.@string.key or self.@userCanView.keyPath bindings over @string.key or @userCanView.keyPath. |
public String message;
public SignupPage(WOContext context) { super(context); message = helper().stringInComponent(this, "signup"); }
signup = "Sign up for a new account";
login = "make up a user name"; password = "make up a password"; passwordAgain = "type password again"; signupButton = "Sign Up"; wantCookie = "save my login and password in a cookie";
public String login, password, passwordAgain; public boolean shouldSaveCookie = false;
Note: Since WireHose components can be used in any number of layouts, which may have special graphical needs for buttons or links, WireHose includes the WHImageButton component. WHImageButton will render itself as a hypertext link, a linked image, a graphical submit button, or a plain submit button, depending on whether it's currently in a form or not, and if its filename binding resolves to a string or not. Bindings such as filename and framework are typically resolved through the layout dictionary rather than being bound directly. |
Copyright ©2000-2003 Gary Teter. All rights reserved. WireHose is a trademark of Gary Teter.