This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Ok, I have moved on to try and get a grasp of the validation in Tapestry down. And I need a bit of clarification.
I have a login form that consists of a username and a password field. All I want to do initially is specify that these fields are required. Originally, my Login.page looked like this:
So, the first change I started to make was to declare a bean called "delegate" and noticed I needed to define my own class for this. This is confusion #1.
The next change I needed to make was to add a bean declaration called "required" that used a class StringValidator. No problem.
Confusion #2: I then needed to add a component declaration for my ValidField. This was pretty self explanitory until I got to the part where I say something like:
<binding name="value" expression="???" />
The book has a JavaBean which it uses for this purpose. I am just creating a Login form. I don't want to code a bean just for this. I thought that there should be someway to specify this from the following property-specification:
But I am not sure if this is a) possible and b) how I would do it if it is possible.
Note also that the delegate class I need to define would handle the changes made to the html like change the color of the FieldLabel and even highlight the textfield bla bla. I don't really care about this right now. All I care about is notifying the user that the fields are required. So is there a class that I can specify for that delegate that is already in the Tapestry API rather than having to create my own and extend ValidationDelegate?
I hope this made some sense. I have to abuse Howard and Geoff and all the other experts before the promo is over and they all leave. [ May 26, 2004: Message edited by: Gregg Bolinger ]
Method 'public abstract java.lang.String examples.Login.getUserName()' (declared in class examples.Login) has no implementation in class examples.Login (or enhanced subclass examples.Login$Enhance_3).
Now before I started with the validation stuff, my Login.html was a little different. For the input of the username I had the following line:
I know how this worked. The ognl:userName was used to use the abstract method getUserName() in my Login.java class. So I am assuming my error is because of the difference between the 2 files now but I am unclear on how to correct this.