Custom toolbar button click events are not firing with infopath 2007

V

v-srkati

I use VS 2008, Infopath 2007 with C#.

The declaration in the manifest:
<xsf:toolbar caption="MyToolbar" name="MyToolbar">
<xsf:button name="Save" caption="Save"></xsf:button>
</xsf:toolbar>


The link to the event in the internal startup:
((ButtonEvent)EventManager.ControlEvents["Save"]).Clicked += new
ClickedEventHandler(Save_Clicked);

the event in my code:
public void Save_Clicked(object sender, ClickedEventArgs e)
{
MessageBox.Show("Hello world");
}

There are no compile time errors, also I am able to publish the
template. But the event handler is never fired.

With Infopath form 2003, the toolbar button click events used to work
perfectly.

Appreciate your help in resolving my issue with infopath 2007.
 
B

Ben Walters

Hey v-Srkati
Where are you publishing your form to? if your publishing the form to form
services and viewing it through the browser then the dialog box won't show.
if your running the form through the rich client then you shouldn't have any
issues.

Hope this helped but if not ping me a message and let me know

Cheers,
Ben Walters
 
N

Neeraj

i have a view in which i have a button named update. After click on update it works and it goes to the code if i run only that part from the code.

AFter publishing the same code and saving the form to the form library, when i try to add new then i clicking on the same button and it doesn't goes to the server.

Appreciate your help ......
Hey v-Srkati
Where are you publishing your form to? if your publishing the form to form
services and viewing it through the browser then the dialog box won't show.
if your running the form through the rich client then you shouldn't have any
issues.

Hope this helped but if not ping me a message and let me know

Cheers,
Ben Walters


On Saturday, December 06, 2008 5:17 AM v-srkat wrote:
I use VS 2008, Infopath 2007 with C#.

The declaration in the manifest:
<xsf:toolbar caption="MyToolbar" name="MyToolbar">
<xsf:button name="Save" caption="Save"></xsf:button>
</xsf:toolbar>


The link to the event in the internal startup:
((ButtonEvent)EventManager.ControlEvents["Save"]).Clicked += new
ClickedEventHandler(Save_Clicked);

the event in my code:
public void Save_Clicked(object sender, ClickedEventArgs e)
{
MessageBox.Show("Hello world");
}

There are no compile time errors, also I am able to publish the
template. But the event handler is never fired.

With Infopath form 2003, the toolbar button click events used to work
perfectly.

Appreciate your help in resolving my issue with infopath 2007.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top