← Back to team overview

dhis2-devs team mailing list archive

Re: Limit characters in Comment

 

Dear Lars,
I tried to change in history.js
but when i enter longer than 360 in comment, and press "Save Comment". It
always jump:
CONSOLE
-------------------------------------
ReferenceError: i18n_saving_comment_failed_error_code is not defined
                   history.js:64
-------------------------------------

history.js
--------------------------------------
function handleError( xhr, textStatus, errorThrown )
    {
        markComment( COLOR_RED );
        window.alert( i18n_saving_comment_failed_error_code + '\n\n' +
xhr.responseText );
    }


On Wed, Apr 9, 2014 at 3:29 PM, Lars Helge Øverland <larshelge@xxxxxxxxx>wrote:

> The cell border will be green for fields which have comments (next time
> you open that form).
>
>
>
>
> On Wed, Apr 9, 2014 at 10:27 AM, channara rin <rin.channara@xxxxxxxxx>wrote:
>
>> Great, Thank you.
>> SO i need to modify the 360 in history.js file?
>>
>> AND another problem is. when has comment, can show highlight data value
>> in dataset that has text in that comment? SO it is easy for us(M&E staff)
>> to view if that data value has comment..
>>
>> Thank you
>> CHANNARA
>>
>>
>>
>>
>>
>> On Wed, Apr 9, 2014 at 3:02 PM, Lars Helge Øverland <larshelge@xxxxxxxxx>wrote:
>>
>>> Hi Channara,
>>>
>>> the max is actually 255 characters, backed by a "varchar" column in the
>>> database. I'm sorry but we don't plan to change it to a "text" type column
>>> anytime soon - reason is just that most comments are pretty short and
>>> "text" requires more storage space on disk.
>>>
>>> Now that said you are of course free to change the column type to text
>>> directly in your database, and then apply the patch copied below this email
>>> to remove the validation.
>>>
>>> regards,
>>>
>>> Lars
>>>
>>> -----
>>>
>>>
>>> === modified file
>>> 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js'
>>> ---
>>> dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-02-27
>>> 04:15:35 +0000
>>> +++
>>> dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/history.js 2014-04-09
>>> 08:01:57 +0000
>>> @@ -5,14 +5,6 @@
>>>
>>>      var commentValue = $( '#commentTextArea' ).val();
>>>
>>> -    if ( commentValue.length > 360 )
>>> -    {
>>> -        markComment( COLOR_YELLOW );
>>> -        window.alert(i18n_value_too_long + " for comment field");
>>> -
>>> -        return;
>>> -    }
>>> -
>>>       var commentSaver = new CommentSaver( currentDataElementId,
>>> currentOptionComboId, commentValue );
>>>
>>>      commentSaver.save();
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Apr 9, 2014 at 6:55 AM, channara rin <rin.channara@xxxxxxxxx>wrote:
>>>
>>>> Dear All,
>>>> I found that, in the Comment in data value in dataset is
>>>> limit character around 360characters.
>>>> Can we extend to unlimited characters for comments?
>>>>
>>>>
>>>> Thank you
>>>> CHANNARA
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>
>>
>

Follow ups

References