Paging drop down field in form

Which IIQ version are you inquiring about?

Version 8.3

Share all details related to your problem, including any error messages you may have received.

I’m trying to implement a drop down field inside the form which will return a list of Entitlement from a given Application. The list is quite large and is timing out the webpage when attempting to click the drop down. The requirement is that it should return the list of Entitlements and the end user should have the ability to select multiple items from the list. Here is my implementation:

List groups = new ArrayList();
  
QueryOptions qo = new QueryOptions();
qo.add(Filter.and(Filter.eq("application.name", appName), Filter.like("displayName", startsWith), Filter.eq("type", "group")));

Iterator result = context.search(ManagedAttribute.class, qo);
while (result.hasNext()){
    ManagedAttribute managedAttribute = (ManagedAttribute)result.next();
    groups.add(managedAttribute.getDisplayName());
}
Util.flushIterator(result);

return groups;

What’s the best way to go about this so that I don’t timeout the form page?

Hi @ctrovada ,

Pulling all the entitlements can always be heavy causing the time out error. We had a custom UI with similar requirement. We made sure at least 4 letters as mandatory to be provided by the end user as an input which will filter the quantity of results to be loaded. You can try a similar approach.

Also, I would suggest not to use the a plan context.search in this case which pulls all the managedattribute objects though what you only needed is displayName.

Use the below approach to retrieve only the displayName information when database is queried.

context.search(java.langClass cls, QueryOptions options, java.lang.String properties) which translates to context.search(ManagedAttribute.class, qo, “displayName”);

This returns an iterator with list of display names.

Hope this helps.

Regards,
Uday Kilambi

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.