/** * Creates a widget with certain absolute maximum and minimum values as defined by a specific numeric Concept * * @param concept * @param size, the size of the text field to render */ public NumberFieldWidget(ConceptNumeric concept, String size) { if (concept != null) { ConceptCompatibility conceptCompatibility = Context.getRegisteredComponent("htmlformentry.ConceptCompatibility", ConceptCompatibility.class); setAbsoluteMaximum(concept.getHiAbsolute()); setAbsoluteMinimum(concept.getLowAbsolute()); setFloatingPoint(conceptCompatibility.isAllowDecimal(concept)); if (size != null && !size.equals("")){ try { setNumberFieldSize(Integer.valueOf(size)); } catch (Exception ex){ throw new IllegalArgumentException("Value for 'size' attribute in numeric obs must be a number."); } } } }