Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2006

Tip: Looking for answers? Try searching our database.

Programmatically inserting/removing buttons and corresponding event handlers in InfoPath at run time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
soumitra.mishra@gmail.com - 12 Jan 2006 20:19 GMT
Here is what I want to achieve. In my InfoPath form I am getting some
data from a web service. Based on this data I need to
dynamically(programmatically) insert buttons on my form. In addition to
this I also want to link these buttons to correspoing click event
handlers which would contain some code (namely to delete an item from
SP site). I will describe the actual senario to give a better idea of
what I am trying to achieve.

In my InfoPath form I call a web sevice which returns a list of
documents on a SP document library. I display this list on my form (as
a list of document names). Now I need to add corresponding buttons
through which I could delete the corresponding document from SP
document library. As you can see this requires me to dynamically create
buttons as well as their button click event handlers and then hook the
two together - remember all at run time. Just to let you know - in the
button click event handler (vbscript function) I will call another web
service that will delete the corresponding document from the document
library. After doing this I would like to remove the corresponding
document row including the button from the form. Seems like I am asking
too much from poor InfoPath. But I hope some of you experts might have
solution/hack to my problem. If you do then hats off to you.

Thanks,

Soumitra
Bojana Marjanovic [MSFT] - 16 Jan 2006 21:15 GMT
Here's a stab at it:
Create a repeating table with one of the columns containing the button that
will be doing the deleting. Write an onClick event on the button that
accesses the form name that the button is trying to delete. Keep in mind
that you'll have to pass the form name based on the location of the button.
Then do the deleting.
You'll most likely have to copy over the list of items from your web service
into the main DOM.

I'm not sure if this will do the trick for you or not. Let me know how it
goes.

-Bojana

> Here is what I want to achieve. In my InfoPath form I am getting some
> data from a web service. Based on this data I need to
[quoted text clipped - 21 lines]
>
> Soumitra
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.