BUG 8475 Adjustment in the fields validation and readOnly attribute.

This commit is contained in:
Hector Cortez
2012-02-07 09:58:17 -04:00
parent 311847c060
commit 6b8879e817
6 changed files with 20 additions and 6 deletions

View File

@@ -1136,6 +1136,12 @@ function G_Text( form, element, name)
};
this.handleKeyPress = function(event){
if (me.element.readOnly) {
return true;
}
if (( me.mType != 'currency' && me.mType != 'percentage') && (me.element.value.length > me.element.maxLength - 1)) {
return true;
}
if (me.validate == 'Any' && me.mask == '') return true;
//THIS FUNCTION HANDLE ALL KEYS EXCEPT BACKSPACE AND DELETE
keyCode = event.keyCode;

View File

@@ -1635,7 +1635,9 @@ class XmlForm_Field_Currency extends XmlForm_Field_SimpleText {
$html .= 'name="form[' . $this->name . ']" ';
$html .= 'type="hidden" value="'.$this->htmlentities($value, ENT_COMPAT, 'utf-8').'" />';
}
if (($this->readOnly == 1) && ($this->renderMode == 'edit')) {
$html = str_replace("class=\"module_app_input___gray\"", "class=\"module_app_input___gray_readOnly\"", $html);
}
$html .= $this->renderHint();
return $html;
@@ -1706,6 +1708,9 @@ class XmlForm_Field_Percentage extends XmlForm_Field_SimpleText {
$html .= 'type="hidden" value="'.$this->htmlentities($value, ENT_COMPAT, 'utf-8').'" />';
}
if (($this->readOnly == 1) && ($this->renderMode == 'edit')) {
$html = str_replace("class=\"module_app_input___gray\"", "class=\"module_app_input___gray_readOnly\"", $html);
}
$html .= $this->renderHint();
return $html;

View File

@@ -40,11 +40,12 @@
<tr>
<td class="FormTitle" colspan="2" align="">{$form.PME_SUBTITLE3}</td>
</tr>
<!--
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$PME_MAXLENGTH}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_MAXLENGTH} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.PME_MAXLENGTH}</td>
</tr>
-->
<!-- tr>
<td class="FormLabel" width="{$form_labelWidth}">{$PME_CURRENCY}</td-->
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_CURRENCY} </td> //-->

View File

@@ -23,10 +23,11 @@ SELECT XMLNODE_NAME, TYPE FROM dynaForm WHERE XMLNODE_NAME = @@PME_XMLNODE_NAME
<PME_SUBTITLE3 type="title" enableHTML="1">
<en>Behaviour</en>
</PME_SUBTITLE3>
<!--
<PME_MAXLENGTH type="text" maxlength="10" size="10" validate="Int" defaultvalue="15">
<en>Max. Length</en>
</PME_MAXLENGTH>
-->
<PME_CURRENCY type="hidden" maxlength="50" size="30" defaultvalue="$">
<en>Currency</en>
</PME_CURRENCY>

View File

@@ -40,11 +40,12 @@
<tr>
<td class="FormTitle" colspan="2" align="">{$form.PME_SUBTITLE3}</td>
</tr>
<!--
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$PME_MAXLENGTH}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_MAXLENGTH} </td> //-->
<td class="FormFieldContent" width="{$form_fieldContentWidth}">{$form.PME_MAXLENGTH}</td>
</tr>
-->
<tr>
<td class="FormLabel" width="{$form_labelWidth}">{$PME_VALIDATE}</td>
<!-- <td class='FormFieldContent' width="{$form_width}" >{$form.PME_VALIDATE} </td> //-->

View File

@@ -24,11 +24,11 @@ SELECT XMLNODE_NAME, TYPE FROM dynaForm WHERE XMLNODE_NAME = @@PME_XMLNODE_NAME
<PME_SUBTITLE3 type="title" enableHTML="1">
<en>Behaviour</en>
</PME_SUBTITLE3>
<!--
<PME_MAXLENGTH type="text" maxlength="10" size="10" validate="Int" defaultvalue="15">
<en>Max. Length</en>
</PME_MAXLENGTH>
-->
<PME_VALIDATE type="dropdown" defaultvalue="Real">
<en>Validate<option name="Int">Integer </option><option name="Real">Real Number</option></en>
</PME_VALIDATE>