for (String key : clientSideSelectedKeys) { final Object id = itemIdMapper.get(key); if (!isNullSelectionAllowed() && (id == null || id == getNullSelectionItemId())) { if (!isNullSelectionAllowed() && acceptedSelections.isEmpty()) { if (!isNullSelectionAllowed() && (clientSideSelectedKeys.length == 0 || clientSideSelectedKeys[0] == null if (!isNullSelectionAllowed() && id == null) { markAsDirty(); } else if (id != null
@Test public void selectHasNoDefaultValueIfNotConfigured() { // GIVEN // WHEN createField(); // THEN AbstractSelect select = getSubFieldWithType(AbstractSelect.class); assertTrue(select.isNullSelectionAllowed()); assertNull(select.getValue()); }
target.addAttribute("allownewitem", true); if (isNullSelectionAllowed()) { target.addAttribute("nullselect", true); if (getNullSelectionItemId() != null) { if (isNullSelectionAllowed() && getNullSelectionItemId() != null && !ids.contains(getNullSelectionItemId())) { final Object id = getNullSelectionItemId(); if (!isNullSelectionAllowed() && id != null && id.equals(getNullSelectionItemId())) {
@Test public void selectHasDefaultValueIfConfigured() throws Exception { // GIVEN definition.getOptions().get(1).setSelected(true); baseItem = new JcrNewNodeAdapter(baseNode, baseNode.getPrimaryNodeType().getName()); // WHEN createField(); // THEN AbstractSelect select = getSubFieldWithType(AbstractSelect.class); assertTrue(select.isNullSelectionAllowed()); assertEquals("code", select.getValue()); }