Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 21061

How to trigger a TCXButtonEdit OnButtonClick event

$
0
0

 

Hi,

 

 

   I am having a problem trying to trigger the OnButtonClick event and the help/manual doesn't seem to help/work, and would like some feed back to see if its possible.

 

 Here's what I am hoping to accomplish.

 

  I have the above TCXButtonEdit on a UserForm.

  I have exported that form to a file *.aqfm

 

  I have a description.xml and a dialog.js file  that the description file is referencing as the script name.

  I have setup the KDTOperation so that my form comes up when I drag the keywork operation onto the keyword test script.

 

What I want to be able to do is, when the KDTOperation is drag into the test script, it shows the form, and on that form i want to click the button on the Text Editor field, (the button is part of tcxbuttonedit control), and opens up a OpenDialog. This allows me to select a file , and fill in the Text portion of the TCXButtonEdit with the filename.

 

Below is the desription.xml file - the OnButtonClick has been place inside the <Events> tag as well. This is the current code i have while testing for ways to make it work.

 

<ScriptExtensionGroup Name="EA"><Category Name="EA Extensions"><ScriptExtension Name="Common Dialog Controls" Author="" Version="" HomePage=""><Script Name="dialogs.js" InitRoutine="" FinalRoutine=""><RuntimeObject Name="Dialog Controls" Namespace="EA"><Method Name="OpenFile" Routine="OpenFile" /><Method Name="SaveAs" Routine="SaveAs" /><Description>Dialog Controls</Description></RuntimeObject><KDTOperation Name="Open File" Category="Dialogs" ICON="" OperationType="Group"><Data><Field Name="FileName" DefaultValue="" /><Field Name="OpenOrSave" DefaultValue="Open" /></Data><Events><Event Name="OnExecute" Routine="OpenFile_OnExecute" /><Event Name="OnSetup" Routine="OpenFile_OnSetup" /><Event Name="OnCreate" Routine="OpenFile_OnCreate" /></Events><Columns><Column Name="Item" Value="Open a File"  /><Column Name="Operation" Value="Open dialog window to select a file" ><Event Name="OnButtonClick" Routine="OpenSaveFileDialog_OnClick" /></Column></Columns></KDTOperation></Script><Description>Dialog Controls</Description></ScriptExtension></Category></ScriptExtensionGroup>

 

 

Here's the code for the above function of the OnButtonClick

 

function OpenSaveFileDialog_OnClick(Sender,AButtonIndex)
{
var frm=UserForms["DialogWindow"];
var OD=frm["OD"];
if(OD["Execute"]())
{
frm["txtFileName"]["Text"]=OD["FileName"];
return true;
}
return false;
}

function test()
{
if(UserForms["DialogWindow"]["ShowModal"]()!=mrOk || UserForms["DialogWindow"]["txtFileName"]["Text"]=="")
return false;

return true;
}

 

If i run the above test it works fine ( i had to assign the OnSaveFileDialog_OnClick function into the TCXButtonEdit's event for OnButtonClick. So I know there's no issue with the codes section.

 

But I cannot figure out yet how to run the OnSaveFileDialog_OnClick function when I am in the keyword testing design mode. 

 

Any help appreciated


Viewing all articles
Browse latest Browse all 21061

Trending Articles