Tuesday - April 25, 2006

Default Submit Action on Multiple Submit Form


This tip comes from the webobjects-dev mailing list....

"Problem: Some browsers trigger the WOForm action, whilst other trigger the first submit button action when a user hits the enter key. I've tested my test app with IE v4+, Netscape v6+, Opera and Chimera on both mac and windows and can confirm that it is a browser related issue.

After much playing about with this issue, i have decided that the best way to get the behaviour i required was to add a 1x1 pixel image as an WOImageButton at the very top of my form and bind it's action to the action that I want to trigger if the user hits the enter key, and leave the form action method unbound (thanks to Pierre Bernard for this tip). This provides consistent behaviour across all browsers mentioned above. Note that i also add an extra tag to the WOImagButton of TABINDEX="" - this means that as the user tabs through the form elements it doesn't pick up on the single pixel image and hence it is completely invisible to the user."

Posted at 08:51 AM     Read More  

Friday - July 22, 2005

Automatic reset of instance variables in Stateless WOComponent subclasses


I typically use regular ("stateful") components for pages and I use all stateless non-synchronizing components for subcomponents. This works well since often the ivars in the page are pulled into subcomponents lazily on demand through bindings. A common problem is that I may forget to add a newly created ivar to the reset method which may manifest itself as a unusual bug (sharing of the ivar value across different users' pages for example). In any case not setting ivars to null in stateless components' reset() method can have serious information security implications aswell as buggy behaviour. So I created a class that automatically manages the reset responsibility for stateless components and it only requires you to add one generic line of code to your stateless component, or better again, write the reset method once in a subclass which all stateless components extend and thus you can forget about maintaining the reset() method forever. Performance is good too since the names of the ivars to be reset for each component are cached the first time they are evaluated.

Posted at 01:41 PM     Read More  

Wednesday - July 20, 2005

Reusable Stateless Components


Stateless WOComponents result in low memory usage (generally only one instance of the a stateless component exists per application thread) and it's functionality is reused over and over and shared among all pages ( and sessions)...

Posted at 10:41 PM     Read More  

Wednesday - July 06, 2005

Conditionals in WOBuilder


WOConditional is a very flexible dynamic element. You can bind boolean and Boolean, but did you know you can use it to conditionally hide content for optional attributes or related EOs? ...

Posted at 02:48 PM     Read More  

Tuesday - June 07, 2005

Displaying Subclass Attributes in WOBuilder


Let's say we have an abstract class and a few subclasses and the subclasses each have additional attributes. In WOBuilder, if we add the abstract class as a key, usually only its attributes show up. Adding a TypeInfo comment in the source will display the attributes of the subclass so that you can drag to "wire them up"....

Posted at 04:25 PM     Read More  

Wednesday - May 04, 2005

Guidelines for HTML Email


Here are some of the guidelines for HTML email to ensure you have a good HTML rendering in a broad range of email clients:

Posted at 11:57 AM     Read More  

Tuesday - November 23, 2004

Adding Components from another project in XCode 1.5


This is a not so obvious task .... and it can be frustrating if you select the wrong options in the Add dialog and you find that the .wo component no longer responds to double-clicking! .....

Posted at 02:52 PM     Read More  


Published by