Which IIQ version are you inquiring about?
8.3
Share all details about your problem, including any error messages you may have received.
I created a form and tried to add a “Save and Add Another” button using the following section:
<Section label="Saved Role/Entitlement Entries" name="savedSection">
<Field displayName="Save and Add Another" name="savedSelections" type="button">
<Attributes>
<Map>
<entry key="buttonLabel" value="Save and Add Another"/>
<entry key="onClick">
<value>
<Script>
<Source>
</Source>
</Script>
</value>
</entry>
</Map>
</Attributes>
</Field>
</Section>
However, instead of rendering a button, it shows a text label and a text input field.
I followed the reference in this article:
https://developer.sailpoint.com/discuss/t/add-more-button-in-form/126087/3
Initially, I received an error on the line:
<value>Click Me</value>
To resolve it, I replaced it with:
<entry key="buttonLabel" value="Click Me"/>
The intended logic of this button is to store the entered data temporarily so that the user can clear the fields, input new values, and ultimately submit all entries together as a bulk request.
Below is the Java logic I plan to use for storing and resetting values (though I first tested without logic to isolate the UI issue):
import java.util.*;
if (form.getField("savedSelections").getValue() == null){
List input = new ArrayList();
form.getField("savedSelections").setValue(input);
}
List saved = (List) identityModel.get("savedSelections");
String type = (String) form.getField("selectAccess").getValue();
Map entry = new HashMap();
entry.put("entryType", type);
entry.put("operation", form.getField("selectop").getValue());
if ("Roles".equals(type)) {
Object r = form.getField("roles").getValue();
if (r instanceof java.util.List) {
entry.put("roles", String.join(",", (List) r));
} else {
entry.put("roles", r != null ? r.toString() : "");
}
entry.put("appName", "");
entry.put("ents", "");
Object c = form.getField("comments").getValue();
entry.put("comments", c != null ? c.toString() : "");
} else {
Object a = form.getField("appName").getValue();
entry.put("appName", a != null ? a.toString() : "");
Object e = form.getField("entitlements").getValue();
if (e instanceof java.util.List) {
entry.put("ents", String.join(",", (List) e));
} else {
entry.put("ents", e != null ? e.toString() : "");
}
entry.put("roles", "");
Object c2 = form.getField("comments").getValue();
entry.put("comments", c2 != null ? c2.toString() : "");
}
saved.add(entry);
identityModel.put("savedSelections", saved);
// Reset input fields
form.getField("roles").setValue(null);
form.getField("appName").setValue(null);
form.getField("entitlements").setValue(null);
form.getField("comments").setValue(null);
At this stage, the main issue is that the field definition is not producing a button in the form.