PeterThoeny - 2010-09-10:
Yesterday I gave a presentation to
ACCU at Symantec in Mountain View, CA. I prepared the
ContactDB application and created it during the presentation. Today I thought that it might help to expand on that by writing this blog post.
I am looking forward for your feedback.
PeterThoeny - 2010-10-14:
We have now an improved contact database, packaged as a TWiki application & ready to be used:
ContactDbAddOn. Attached is a screenshot of the application homepage. There is now a filter row to search for entries. Useful if you have hundreds or thousands of entries.
PeterThoeny - 2011-10-08:
I will have a session on this topic tomorrow Saturday 11:15am at the Silicon Valley Code Camp,
http://www.siliconvalley-codecamp.com/Sessions.aspx, room 4203. It is a free event for 3000 attendees, come and join us!
DanielAjoy - 2012-01-18:
when you say "Create page to create new records". Why is that? Could we use instead the form that is generated when we edit a page based on the Template ?
When we edit a page based on that template we are shown a nice form below the textbox of the content of the page. It seems to me that there should be a way to, instead of editing both: the content of the page, and the added form, just edit the form. No?
It
DanielAjoy - 2012-01-18:
The actual page of the code-camp currently is:
https://codecamp.pbworks.com/w/page/46626203/How%20to%20Create%20Web%20Apps%20in%20the%20Cloud%20Using%20TWiki%202011 . Though I was hoping for recorded video of the session.
PeterThoeny - 2012-01-23:
It is certainly possible to create a page without a hand-crafted "create new records" page: Simply use the edit script and tell it to use the proper template, such as
%SCRIPTURL{edit}%/%WEB%?topic=JimmyNeutron;templatetopic=ContactTemplate - this tells the edit script to create a topic called JimmyNeutron using template topic ContactTemplate. Nevertheless you lose convenience because you still need a form to specify the topic name. In some applications this is not needed, for example the
TWikibug:WebHome bug tracker application uses topic names that are generated automatically. If you specify
topic=ID-AUTOINC001 to the edit script, you will get consecutively numbered topics ID-001, ID-002, ID-003, etc.
DirkWilhelmy - 2012-04-10:
I'm looking forward for the second answer

I want to reuse the page from creating new records for editing them. Is this possible?
PeterThoeny - 2012-04-10:
Dirk, three options:
1. Use TWiki's edit feature to edit a form: Create a link that point to the edit script, telling it to edit only the form (not the page content). Example link:
[[%SCRIPTURL{edit}%/%BASEWEB%/%BASETOPIC%?t=%SERVERTIME{$epoch}%;action=form][Edit contact]]
2. Create a ModifyContact page to modify an existing record: Copy content over from NewContact and modify as follows:
- Add a new HTML form on top that shows a picklist of all existing contacts, name the select "contact". When you submit the form, the page will have a
contact=JimmyNeutron parameter that will be used in the original form below.
- In the HTML input fields, initialize the values based on the
contact URL parameter. Example: <input type="text" name="JobTitle" value="%FORMFIELD{ "JobTitle" topic="%URLPARAM{ "contact" encode="entity" }%" }%" size="40" />
- Change the topic name to a hidden field:
<input type="hidden" name="topic" value="%URLPARAM{ "contact" encode="entity" }%" />
- Disable the submit button in case the
contact URL parameter is empty (consult Javascript docs). Condition: %IF{ " '%URLPARAM{ "contact" encode="entity" }%' = '' " then="..." else="..." }%
It is possible to combine the NewContact and ModifyContact into one page. Some conditional code is required using
%IF{}%.
3. In-line editing: The most usable solution is to add the contact edit feature into the ContactHeader. The current header only shows a summary of the contact info in table format. It can be enhanced to toggle between view mode and edit mode, e.g. to change the content in-line. We have done that with the user profile pages; for inspiration study the
Main.UserProfileHeader topic.