SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

InfoPath button with simple rule attached doesn't work!
All About SharePoint - S.S. Ahmed - MVP Microsoft SharePoint

I had a button in my form and there was a simple rule attached to this button. Rule was that If someone clicked the button, a (hidden) textbox would appear in the form, a very simple rule! Problem?? The button was not working. Somehow the event was not firing. I had this problem even before but simply changing the ID of the button resolved my problem but this time, changing the ID didn't work. I spent a couple of hours trying to find the cause but in the end, I needed a quick solution as I was short of time (as usual). The problem was resolved when I added an empty event handler for the button in the form.

 ((ButtonEvent)EventManager.ControlEvents["Button"]).Clicked += new ClickedEventHandler(Button_Clicked);

  public void Button_Clicked(object sender, ClickedEventArgs e)
        {
            // Write your code here.
        }

Now, I don't understand why some buttons work without an event handler and the others don't. I added two buttons to the form, one is firing the other is not! Why? I don't have time to find the cause at the moment, will spend some time on this on the weekend.


Posted 10-16-2007 12:18 PM by ssa

Comments

Blogger Loser » InfoPath button with simple rule attached doesn’t work! wrote Blogger Loser » InfoPath button with simple rule attached doesn’t work!
on 10-17-2007 12:48 PM

Pingback from  Blogger Loser » InfoPath button with simple rule attached doesn’t work!

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.