I'm trying to work on a user interface for adding "events". These events have either 0 or many contacts.
Ideally I would like to have an interface that when entering a new event, has a section for contacts, with a little form to enter one contact (name, phone, etc). On the bottom of that mini-form I would like to have a link or button saying "Add another" that would dynamically load another another mini contact form.
Is this possible with rishfaces/jsf?
Yes, it's doable. Adding another contact have to send ajax event to rerender contact list (addContact method need to result null to remain on the same page). After entering event data and selecting contact list the form will be submitted with event data.
The key elements are:
<a4j:commandButton value="Add contact" reRender="contactList" action="#{yourBean.addContact}" >
contact list may be created as <rich:orderingList id="contactList" ...>
- see demo
If you want that panel with contact form initialy should be hidden you can use rendered property or use any collapsible component like <rich:simpleTogglePanel>
or use <rich:modalPanel>
I thing it may help. Take a look of richfaces demo how to use a4j tags.