mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- Next checkpoint of workflow
- Made the date picker renderer allow user to set date to "None" git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3554 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -4,6 +4,7 @@ import java.util.Date;
|
||||
|
||||
import javax.faces.component.UIComponent;
|
||||
import javax.faces.component.UIOutput;
|
||||
import javax.faces.component.UISelectOne;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.convert.Converter;
|
||||
|
||||
@@ -13,6 +14,7 @@ import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.ui.common.ComponentConstants;
|
||||
import org.alfresco.web.ui.common.converter.XMLDateConverter;
|
||||
import org.alfresco.web.ui.repo.RepoConstants;
|
||||
import org.alfresco.web.ui.repo.component.UIMultiValueEditor;
|
||||
import org.alfresco.web.ui.repo.component.property.PropertySheetItem;
|
||||
import org.alfresco.web.ui.repo.component.property.UIPropertySheet;
|
||||
|
||||
@@ -97,8 +99,26 @@ public class DatePickerGenerator extends BaseComponentGenerator
|
||||
UIPropertySheet propertySheet, PropertySheetItem item,
|
||||
UIComponent component, boolean realTimeChecking, String idSuffix)
|
||||
{
|
||||
// a date picker will always have a date value so there
|
||||
// is no need to create a mandatory validation rule
|
||||
if (component instanceof UIMultiValueEditor)
|
||||
{
|
||||
// Override the setup of the mandatory validation
|
||||
// so we can send the _current_value id suffix.
|
||||
// We also enable real time so the page load
|
||||
// check disables the ok button if necessary, as the user
|
||||
// adds or removes items from the multi value list the
|
||||
// page will be refreshed and therefore re-check the status.
|
||||
|
||||
super.setupMandatoryValidation(context, propertySheet, item,
|
||||
component, true, "_current_value");
|
||||
}
|
||||
else
|
||||
{
|
||||
// setup the client validation rule with real time validation enabled
|
||||
// so that the initial page load checks the state of the date
|
||||
super.setupMandatoryValidation(context, propertySheet, item,
|
||||
component, true, idSuffix);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -84,12 +84,17 @@ public class TextFieldGenerator extends BaseComponentGenerator
|
||||
|
||||
if (propertySheet.inEditMode())
|
||||
{
|
||||
// if the field has the list of values constraint a
|
||||
// SelectOne component is required otherwise create
|
||||
// the standard edit component
|
||||
// if the field has the list of values constraint
|
||||
// and it is editable a SelectOne component is
|
||||
// required otherwise create the standard edit component
|
||||
ListOfValuesConstraint constraint = getListOfValuesConstraint(
|
||||
context, propertySheet, item);
|
||||
if (constraint != null)
|
||||
|
||||
PropertyDefinition propDef = this.getPropertyDefinition(context,
|
||||
propertySheet.getNode(), item.getName());
|
||||
|
||||
if (constraint != null && item.isReadOnly() == false &&
|
||||
propDef != null && propDef.isProtected() == false)
|
||||
{
|
||||
component = context.getApplication().createComponent(
|
||||
UISelectOne.COMPONENT_TYPE);
|
||||
|
Reference in New Issue
Block a user