D2W: Grouping fields in edit form

To group your edit form fields use sectionsContents instead of displayPropertyKeys. A rule for a User for might look like this:

LH: pageConfiguration = 'EditUser'
RH: sectionsContents =
(
  (
    "Personal Info",
    "salutation", 
    "firstName", 
    "lastName", 
    "emailAddress", 
    "phone", 
    "phoneExtension", 
    "mobile"), 
  (	
    "Address", 
    "address.address1", 
    "address.address2", 
    "address.city", 
    "address.province", 
    "address.postalCode"), 
  (	
    "Details", 
    "organization", 
    "role", 
    "loginCredential.password", 
    "loginCredential.isActive", 
    "loginCredential.role"
  )
)

This will result in a form that looks something like this:

d2w_segmented_form.gif

Standard assumptions apply: Wonder’s D2W classes are being used.

D2W: List default sort order

Assumptions: Your D2WList page inherits from ERD2WListPage in Wonder (and if it doesn’t it should).

Apply a default sort order on the list with a rule that looks like this:

LH: task = 'list' and entity.name = 'User'
RH: defaultSortOrdering = ( "name",
"compareAscending" )

Class: com.webobjects.directtoweb.Assignment

Also available are:

compareAscending
compareCaseInsensitiveAscending
compareCaseInsensitiveDescending
compareDescending.

Interesting stuff post

A couple of interesting bits and pieces today:

Blueprint is a CSS frameworks for making grid based web page layout much easier. It incorporates a decent reset.css (to clear all of the default rules set by the various browsers giving you a clean slate) then adds a grid.css and typography.css to give you a consistent base to start with.

I’m not much of a designer, and hacking CSS is fun, but only until it stops being fun (if that makes any sense). Anyway, this looks like a very promising start at making the fun bit last longer.

Via the Daring Fireball linked list.

ERAttachment is an addition to Project Wonder that provides a consistent mechanism for handling file attachments to web apps built in WebObjects. From the javadoc:

The framework provide a single unified set of components and models that can allow the storage of attachments on your local filesystem, served through your webserver; on your local filesystem served through a custom request handler; in your database, served through a custom request handler; and on Amazon’s S3 service, served directly from S3.

I’ve had to handle this kind of thing in a number of apps, allowing users to upload files and serve them back again. Very cool to see this make it into Wonder.

Via an email from Mike Schrag to the Wonder-disc email list.