HOWTO - Sashipa development

 How to compute automatically a pk value.

You wish that a primary key value will be automatically computed when adding a new record. The primary key column has integer type.

Just do not display a field for this column in the cardForm. Melba computes a value for the primary key column when the value is missing and the column is Integer.

If you want to generate value and to display the column value, just set the field as unsaved (and read-only too, it's more logical). Example:

  <textField readonly='yes' save='no'>
    ...

NB: the value will be available only for modification. But not in adding mode. It's because the value is generated when user inserts the card. There isn't any generated value when user displays the card.

© Copyright 2003 Sashipa-Melba Team. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License as much as this note clearly appears.