Tuesday - April 25, 2006Default Submit Action on Multiple Submit FormThis 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." Friday - July 22, 2005Automatic reset of instance variables in Stateless WOComponent subclassesI 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.
Wednesday - July 20, 2005Reusable Stateless ComponentsStateless 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)...
Wednesday - July 06, 2005Conditionals in WOBuilderWOConditional 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?
...
Tuesday - June 07, 2005Displaying Subclass Attributes in WOBuilderLet'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"....
Wednesday - May 04, 2005Guidelines for HTML EmailHere are some of the guidelines for HTML email to
ensure you have a good HTML rendering in a broad range of email
clients:
Tuesday - November 23, 2004Adding Components from another project in XCode 1.5This 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! .....
|
|