mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
MNT-10171: Merged DEV to V4.2-BUG-FIX
59289 : MNT-10171 : Exception thrown if Share metadata is longer than 1024 characters Set 'maxlength' attribute to 1024 (characters) for 'description' property in share and jsf client. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@59493 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,6 +21,7 @@ package org.alfresco.web.bean.generator;
|
|||||||
import javax.faces.component.UIComponent;
|
import javax.faces.component.UIComponent;
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
|
|
||||||
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.web.app.servlet.FacesHelper;
|
import org.alfresco.web.app.servlet.FacesHelper;
|
||||||
import org.alfresco.web.ui.common.ComponentConstants;
|
import org.alfresco.web.ui.common.ComponentConstants;
|
||||||
|
|
||||||
@@ -77,6 +78,13 @@ public class TextAreaGenerator extends TextFieldGenerator
|
|||||||
component.getAttributes().put("rows", this.rows);
|
component.getAttributes().put("rows", this.rows);
|
||||||
component.getAttributes().put("cols", this.columns);
|
component.getAttributes().put("cols", this.columns);
|
||||||
|
|
||||||
|
// MNT-10171 Exception thrown if Share metadata is longer than 1024 characters
|
||||||
|
if (ContentModel.PROP_DESCRIPTION.getLocalName().equals(id))
|
||||||
|
{
|
||||||
|
// add 'onfocus' event for adding 'maxlength' attribute
|
||||||
|
component.getAttributes().put("onfocus", "addMaxLengthForDescriptionTextArea(this)");
|
||||||
|
}
|
||||||
|
|
||||||
return component;
|
return component;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -219,6 +219,14 @@ if (Application.getDialogManager().getState() == null)
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function addMaxLengthForDescriptionTextArea(el)
|
||||||
|
{
|
||||||
|
el.setAttribute("maxlength", "1024");
|
||||||
|
el.removeAttribute("onfocus");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
</h:form>
|
</h:form>
|
||||||
|
|
||||||
</f:view>
|
</f:view>
|
||||||
|
Reference in New Issue
Block a user