cancel
Showing results for 
Search instead for 
Did you mean: 

web form string maximum size

miklenusa
Champ in-the-making
Champ in-the-making
Hello,
When entering a long content (more than 4097 characters) in a text area (xs:string), the content is truncated during submit/save/..
The Alfresco version is 2.9 community. Any help is appreciated.
Thanks!!!
6 REPLIES 6

miklenusa
Champ in-the-making
Champ in-the-making
Content is saved Ok (as of the document size and Java code debugging), but it seems it is not displayed entirely when edit form is called. May be something related to the Ajax/xforms implementation. I use Firefox.

miklenusa
Champ in-the-making
Champ in-the-making
It seems that the JS parser splits long text into several child nodes.
What I did:

In the xforms.js outside the Class

  /**
   * Concatenates values of child nodes
   */
   function allChildrenValues(node) {
      var res = "";
      for (var i = 0; i < node.childNodes.length; i++) {
         res += node.childNodes.nodeValue;
      }

      return res;
   }

In the getInitialValue: function()


      this._initialValue = (this._initialValue.nodeType == document.ELEMENT_NODE
                            ? (this._initialValue.firstChild
                               ? allChildrenValues(this._initialValue)
                               : null)
                            : this._initialValue.nodeValue);


Seems to work (Firefox 2), not tested enough though and do not know any side effects yet.

kvc
Champ in-the-making
Champ in-the-making
Thanks for the information … can you file an issue in JIRA, and then attach this code snippet?  That way, our engineers can evaluate the issue and look to include this fix in future distributions.

Kevin

paavo
Champ in-the-making
Champ in-the-making
I just ran into this. It seems that some browsers (most notably Firefox) cuts up the XPath result into a node hierarchy, while some browsers (at least Chrome) doesn't. This means that the firstChild will only have the first child of the hierarchy and so what gets displayed is only the content of the first child.

What I was wondering is, is there a specific reason for just getting the firstChild nodeValue and not the nodeValue complete result node? Are there problems with some browsers if the "this._initialValue = …" bit was changed to just this:
faulty code removed

Edit:
Oops! Make that:
faulty code removed

Edit:
It seems IE doesn't have textContent, so that's out. Also you may have noticed that my solutions weren't at all what the original code is. Finally I went with miklenusa's solution and it seems to work in IE, Firefox and Chrome. Thanks!

p

vrishali
Champ in-the-making
Champ in-the-making
Hi
I would like to get trained on Alfresco. Please help me to get the details for the same….also let me know if anyone is aware of the trainings conducted on Alfresco…

thanks
vrishali

himanshu
Champ in-the-making
Champ in-the-making
Thanks miklenusa…

Your fix works

Thanks a lot