Alternative approach of Setting optionCriteria

16 Views Asked by At

I am working on Java and SmartGWT and is trying to set criteria into the field which has some innate fetch operation id in it. When I check the logger for the line of logger.info("id: " + criteria .getAttribute("id")), I can see that there is value for the id. However, when it comes to field.setOptionCriteria(criteria );, it seems that the criteria is not set to the field FormItem object. May I know what would be the correct approach of handling this ?

 private static void setCriteria(FormItem field, String id) {
    
            Criteria criteria = new Criteria();
            criteria.addCriteria("id", id);
            try {
                logger.info("id: " + criteria.getAttribute("id"));
            }catch(Exception exception){};
            field.setOptionCriteria(criteria );
        }
0

There are 0 best solutions below