PDA

View Full Version : [CLOSED] Question about directmethod (another one)



feanor91
Jun 13, 2012, 2:56 PM
Hello

Is it possible to have a directmethod returning a value from the code behind to the javascript call?

I want to have a textarea updated by a database but I want to achive that with a directmethod.

Vladimir
Jun 13, 2012, 6:20 PM
Yes, it is possible, just read result in success handler, see examples in
http://examples2.ext.net/#/Events/DirectMethods/Overview/

feanor91
Jun 14, 2012, 7:22 AM
Hello

It did the tricks here the solution:

In VB code behind



<DirectMethod(ShowMask:=True, SuccessFn:="RefreshCommentJS")> Public Function RefreshComment(ByVal ChartToDraw As String) As String

Return ChartToDraw

End Function


Client side:



var RefreshCommentJS = function ( result )
{
Ext.Msg.alert( 'Return:', result );
};