JBoss Community Archive (Read Only)

RHQ 4.9

UI Code to Edit a List of Maps


Occasionally you will want to creat a configuration in a plugin descriptor that contains something similar to the following:



        .... other properties here ....



Using the onc:config JSF component with the readOnly attribute = false, these list elements are rendered with add, edit, and delete buttons.

These buttons have action mappings to org.rhq.core.gui.configuration.ConfigHelperUIBean, which should be fairly clear.  The only trick here is that all of these operations have the same outcome string, which makes taking different navigation routes for each operation (slightly) less straightforward.

There are several request parameters that are supplied by these buttons:

  • listName - identifier for which list on which to operate.  This is the name that is supplied in the plugin descriptor (the name attribute in the list-property element).

  • listIndex - the array index into the list identified by listName that you want to view/edit/delete.  If this is not supplied, then it is assumed that you are adding a new map to the list.

Both of these attributes can be used by your view to pass directly into an onc:config component.

(Minimal) Steps to set it all up

  • Define JSF navigation rules with a <from-action> of #{ConfigHelperUIBean.addNewMap} and #{ConfigHelperUIBean.accessMap}

  • Any view-id that is displayed as a result of the above navigation shoud include an onc:config component that uses the listName and listIndex attributes to display the proper map.  If the component is displayed with the readOnly attribute = false, then saving the changes should be handled for you.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 08:19:37 UTC, last content change 2013-09-18 19:42:17 UTC.