Last modified by Andreas Hahn on 2021/03/16 10:19

When you have followed the steps of this tutorial you have

  • created a new project from the Shept template project page
  • created two web pages with full editing and object creation capabilites
  • written a filter to search for persons
  • written a chain to navigate from Person to Address

Now let's make some quick checks on the live demo.

Create and modify data

Enter a new name in the marked row star.png and push the 'save' accept.png button.
The row mark star.png will disappear and you should see your data on the list.
If the row mark is still there then you did not enter enough data to save the row. In the Person#isCreationAllowed() method we have specified that you have at least to enter a persons name.
If you see an error message when saving then somebody else is trying to save the same data (the same data rows) as you do. Once you update the screen tablerefresh.png after saving your data you will also see a new row marker again.

Search, sort and navigate

Check the filter magnifier.png paging and sorting features.


Data validation and errors

Open 2 browser windows (either on different workstations or different browsers on the same workstation) and let them show the same data. In browser 1 modify some row entry and push 'save' accept.png. Then in browser 2 also modify the same row and then push 'save' accept.png. In browser 2 you'll see an error message indicating there is a conflict.
There are also specific messages: Enter an invalid birthdate '00000' and you'll get an error message and the erroneous form fields will be marked

While this particular feature doesn't mean any effort for you as a developer (it's simply a data type mismatch) there are other cases where you should write validators to provide the user with a specific message. If you omit the extra work for writing a detailed validator then in many cases you will simply fallback to error detection of your database resulting in an unspecific error message (database integrity violation, duplicate keys, invalid empty field, ...)



The demo contains a german and english localization depending on your browsers locale. (We also might simply add user locale selection). These items are subject to localization:

  • labels
  • birthday 'date' entry formatting
  • static selections (address type drop downs on the address subform)

It's easy to add more locales.


Chaining subforms

Chaining is the most powerful feature of shept. Select a person and click on linkgo.png. A new subform appears below the Person form containing the persons addresses. Note that you can do anything with this Address subform as you can do with the Person form above. With the new subform you can

  • create new rows
  • edit existing rows
  • sort and navigate

You can close close.png or fold arrowdown.png a chained subform. In a shept application there is no limit in extending subforms to the bottom of the page through chaining. Best of all it requires very little programming effort. Note that the best browsing experience at this time when you have many subForms is with Firefox which renders the page almost seamlessly.


This simple demo is limited but your own application can extend infinetely to the bottom of the page just by

a) configuring (=allowing) a chain between two segments
b) including a 'chain'-link linkgo.png in the parent subform.
c) name the 'chain'-link after a hibernate 1:n or n:m relation of your entity model.

See more screenshots from other Shept-based application here

For Developers

For Developers it might also be interesting to note that in a default configuration you can append any shept url with a ?debug=true parameter. So if you enter http://demo.shept.org/SheptDemo/person.shept?debug=true each subForm headline will  expose some internals most notably the subForm (segment) name (pointing to its configuration in segments.xml) and the commandPathId which is useful if you mashup your forms with javascript.

<< Create Person

Created by Andreas Hahn on 2011/01/05 14:36

© 2011 shept.org - Andreas Hahn