Wednesday, August 20, 2008

Summarize, Review, with Dynamic Fields

During data collection activities the user should have the opportunity to review info that has been entered. In the image on the right we see a review or summary screen from our fuel control application that allows the user to consider fields values, before storage.

Such screen can be easily defined in Diamond Powder schemas with the Dynamic Fileds concept: a field can use data defined in another field. In our example stringitem fileds capture their values from other fields previously manipulated by application user.

Here comes the how to:

// a review page, and its fields
schema.put("page.summary", "Please, review;" +
"summDate;summOdometer;" +
"summFuelAmount;summFuelPrice;summGSName;" +

// the dynamic fields
schema.put("field.summDate", "stringitem;when:;${date}");
schema.put("field.summOdometer", "stringitem;odometer:;${odometer}");
schema.put("field.summFuelAmount", "stringitem;fuel amount:;${fuelAmount}");
schema.put("field.summFuelPrice", "stringitem;fuel price:;${fuelPrice}");
schema.put("field.summGSName", "stringitem;gas station:;${gasStationName}");
schema.put("field.summGSBrand", "stringitem;brand:;${gasStationBrand}");
schema.put("field.summFacilit", "stringitem;facilities:;${facilities}");
schema.put("help.summary", "You're just one step from saving this record. Review your entries before proceeding.");

The ${field name} notation tells Dyamond Powder where to capture information from. We are using field names defined in the same schema.

In our example (add-cmd-diamond-powder) we reserved the last page to show dynamic fields, but this is not a rule. You could mix in the same page input fields and dynamic fields.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.