Thursday, December 20, 2007

Ever heard of Silverlight !!!

Huh, seems like nothing to do with technology stuff...
But strangely though, you won't believe Microsoft has adopted a fascinating way of grabbing your attention.
Unlike, Mac guys, who name something like Jaguar, Tiger, Leopard, etc. to their OS, Microsoft is in the blues with Vista and now Silverlight.
Silverlight, in essence, is a cross-browser, cross-platform plugin for delivering next-generation media experiences and rich interactive applications for the Web solutions.
It offers a very flexible programming model that can supports any of the JavaScript, Visual C#, Visual Basic, and other languages.
So now you know about Silverlight. Go ahead and download its 1.1 version currently available.
Want to have a quick look at what Silverlight has to offer, check out the Tim Sneath's blog, who has several short webcasts for Silverlight:
http://blogs.msdn.com/tims/archive/2007/04/30/silverlight-screencasts.aspx

Cool stuff from Microsoft !!!

Monday, December 17, 2007

Definition for 'ExecuteAction' not found in InfoPath assembly

Today I came across a kind of weird error, which really should be handled by InfoPath Team.
I had created a InfoPath 2007 browser enabled form with just the following two controls:
- A checkbox.
- An Optional Section with few textboxes.
My intention was to show/hide the optional section based upon the check box selection.
So, when I select the checkbox, the section would show up and hide when unselected.
To implement such a simple logic, I had the below code fragment in VSTA from one of the Microsoft Labs:
//*******************************************************************************//
public void chkStatus_Changed(object sender, XmlEventArgs e)
{
// Write your code here to change the main data source.
if (e.NewValue.Equals("true")) //if selected
CurrentView.ExecuteAction(ActionType.XOptionalInsert, "group2_2");
else //if not selected
{
XPathNavigator node =
MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group2",
NamespaceManager);
CurrentView.SelectNodes(node, node, "CTRL5");
CurrentView.ExecuteAction(ActionType.XOptionalRemove, "group2_2");
}
}
//*******************************************************************************//

But when compiled in VSTA, it throws the below error:
'Microsoft.Office.InfoPath.View' does not contain a definition for 'ExecuteAction'.

Found a relevant resolution at this location:
http://blogs.msdn.com/infopath/archive/2007/05/17/how-to-integrate-the-net-framework-sdk-documentation-with-vsta.aspx

But it talks about changing the Forms compatibility, which I donot need.
Instead, I must agree, that there is a multiple existence of the 'Microsoft.Office.InfoPath.dll', one of 47KB and other of 59KB.
So I got this resolved by removing the refrence of this (47KB) dll and adding it back again from the other location with 59KB.
Compile it again...and I have my browser enabled form back again, compiling successfully.

Suggestions for InfoPath Team:
- Keep a single copy of this DLL ('Microsoft.Office.InfoPath.dll').
- or Modify the reference to the Dll whenever the Compatibility checkbox is selected/unselected to point to the correct DLL.

Hope this is helpful to someone getting the same error.