[ 2 posts ]

gfk

  • Joined: Mon Aug 15, 2011 1:44 pm
  • Posts: 2
  • Offline
  • Profile

false callback in asyncSubmitter?

Post Posted: Tue Feb 14, 2012 11:02 am
+0-
Hi guys,

I have a question about the asyncSubmitter of the TextareaCellEditor in yui2...

I do some validations in the asyncSubmitter and call "fnCallback(false, oNewValue);" when the validation fails.

However, the textarea is emptied when I callback.

How could I leave the content as it is and let the user try to resubmit instead?

Thanks a lot,
Guillaume

Todd Smith

YUI Contributor

  • Username: stlsmiths
  • Joined: Thu Nov 05, 2009 10:03 am
  • Posts: 675
  • GitHub: stlsmiths
  • Gists: stlsmiths
  • IRC: t_smith
  • Offline
  • Profile

Re: false callback in asyncSubmitter?

Post Posted: Tue Feb 14, 2012 11:28 am
+1-
Hi Guillaume,

Hopefully you have reviewed the DT User's Guide standard reference at the top by Satyam. It is at http://yuiblog.com/blog/2008/10/27/datatable-260-part-two/ and is REQUIRED READING and UNDERSTANDING for anything 2.x DataTable.

Also, you may want to read through his many examples at http://www.satyam.com.ar/yui/.

Version 2.x of the YUI is no longer supported, so if you haven't considered migrating to version 3 it might be a good time to look into that.

In the meantime, if you still have issues related to this asyncSubmitter issue, maybe posting a link to a pastie or gist of your code would be helpful.

Also, on re-reading your question ... are you using client-side validation or server-side validation? For example, most of the inline editors like TextboxCellEditor and TextareaCellEditor have a "validator" function http://developer.yahoo.com/yui/docs/YAHOO.widget.BaseCellEditor.html, Satyam's first reference above also mentions it. If you validate client-side, that is the way to go !

Todd
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum