How to use Authentic Client Event Functions

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Introduction to ASP.NET Server Control for Authentic Browser >

How to use Authentic Client Event Functions

The properties of category "Authentic Client Event Functions" can be used to specify a function name, which is called when the relevant event of the Authentic Browser Plugin occurs.

 

The user is responsible for implementing that function in the client script code.

 

The ASP.NET Server Control automatically attaches all necessary callbacks to the plugin and calls the specified function on the client (also see attachCallback _PLUGIN_ for a list of events).

 

 

Example: How to customize the toolbar with a custom button

 

Add two functions in your aspx-file:

 

<script language="javascript">

 var bCheckBtn = false; // helper To toggle the button state

 

 function MyOnInitBeforeStartEditing()

 {

         // get Browser Plugin

         var oPlugin = document.getElementById('AuthenticDocumentView1_objPlugIn');

         var nBtns = oPlugin.ToolbarRows.Item(1).Buttons.Count;

         // append a separator

         oPlugin.ToolbarRows.Item(1).Buttons.NewSeparator( nBtns + 1);

         // append your custom button

         oPlugin.ToolbarRows.Item(1).Buttons.NewCustomButton(nBtns + 2, "YourFunction", "Tooltip describing function", "YourFunction.bmp");

 }

 function MyOnDocEditCommand()

 {

         // get the Browser Plugin

         var oPlugin = document.getElementById('AuthenticDocumentView1_objPlugIn');

         if ( oPlugin.event.type == 'update' ) // button state is retrieved

         {

                 if ( oPlugin.event.srcElement.Name == 'YourFunction' )

                 {

                         oPlugin.event.cancelBubble = true;

                         if ( bCheckBtn )

                                 oPlugin.event.returnValue  = 3; // enable and check button

                         else

                                 oPlugin.event.returnValue  = 1; // enable button

                 }

         }

         else if ( oPlugin.event.type == 'command' ) // button was pressed

         {        

                 if ( oPlugin.event.srcElement.Name == 'YourFunction' )

                 {

                         bCheckBtn = !bCheckBtn;

                         window.alert("Your function");

                 }

         }

 }

</script>

 

Specify your function names in the properties of the AuthenticDocumentView ASP.NET Control:

 

Prop_CustomizeToolbar

 


© 2019 Altova GmbH