Wednesday, 15 February 2012

Its true Sharepoint DataForm Webparts are incredibly easy to develop if you need to query lists or data without the need to create fully grown webparts from scratch in SharePoint they are definitely the way to go. However there is a but and that is that most of the SharePoint Universe appears to believe that everyone creates DW webparts on their production environment using SharePoint Designer. In many production environments SharePoint Designer is disabled as default. If you have stand alone webparts this may not be an issue, but if you have a set of DataForm webparts that need to be linked to each other you're going to face all kinds of problems when you try to link them to each other on a target environment.

So for example lets say I have developed some webparts on my development SharePoint box. I access a list from my webparts, I have also had the sense to take the list from the production environment as a template so I won't have any conflicts with field names. All works fine my webparts talk to each other but then when I deploy them and try to get them to talk to each other they just refresh the page. Even if I've created connections between the webparts, what happened?

Enter what I feel is the Achilles heal of the DataForm Webpart. If you created those webparts in SharePoint Designer and created the webpart connection between them in there you probably didn't realise that it places a bit of code in there which looks something like this.

 

<xsl:value-of select="ddwrt:GenFireConnection(concat('g_cb4fe2eb_738d_4bbb_8ec7_ce81633092a5*',$fields),string(''))"></xsl:value-of>
 

The problem in the above bit of code, is that when you make a webpart connection in SharePoint Designer with DataForm Webparts it hard codes the GUID of the target webpart. When you deploy your webparts the target environment will give them different GUID's. Even if you try to re-establish the connections in SharePoint's Web Interface this won't make a difference at all.

If you are wondering what GenFireConnection does and I appreciate there is precious little documentation about it, most of it being on previous versions of SharePoint. Its creates an ASP.NET post back link which contains the consumer webpart  GUID (highlighted above) and the data we are sending to our consumer webpart such as the value of a field.

Work Around
The only work arounds I have found to this little problem, unless anyone else has a better method, is to.

  1. Create the link in the SharePoint web interface on the target environment after the webparts are deployed and placed on the page.
  2. Select "Edit Webpart" and use the XSL Editor to change the GUID on the "GenFireConnection" on the calling webpart  to the new GUID of the target webpart.

The other option is to just use query strings in your lists. SharePoint Designer will quite happily accommodate this using parameters you can then pass this around in links around fields.

The above seems to always work for me, although I would love to know if there is a more elegant solution to this.

posted on Wednesday, 15 February 2012 13:15:51 (GMT Standard Time, UTC+00:00)  #    Comments [0]

 Sunday, 12 February 2012
Watching SkyPlayer and other content from your PC on your TV

This article can apply to just about any content that you can watch on your PC but just can't watch on your TV be it via XBOX, PS3 or some type of set top box we have to face the facts that some services are either limited on these devices or have content restrictions.

So for example lets say I want to watch a show that is on SkyPlayer on my TV via my XBOX. You may discover that that show is restricted for viewing via Xbox on your TV but you are perfectly free to view that content on your PC. Sounds silly doesn't it?

Anyway the next option is to connect your laptop or PC to your TV and that can often be pretty impractical especially if you want to use the laptop at the same time.

The Solution
Enter this lovely box of tricks by StarTech called a Ethernet to VGA Over IP Converter, so how does this help?

StarTech

This clever little device plugs into your home network and has a VGA connector on the back that plugs into your TV or monitor. You then install drivers for the device on your laptop which will discover this device on your network and treat it as an extra monitor!

But it doesn't just stop there, the device is also a USB server. That means you can plug any USB device into it and your laptop will think its plugged into one of its local USB ports. You're probably wondering why? Well you may want to plug a USB mouse and keyboard in there so you can control what's happening on the screen from near the TV.

I basically use it by dragging the video I am watching onto the extended display my laptop suddenly has via this device and can carry on using my laptop while at the same time its playing a video in the other window.

So just how good is this?
There is a "but" though, your were expecting one weren't you? You can use this device over WiFi but to get a good quality broadcast I resorted to both my machine and the device being on a 100meg wired network. In theory if I had a 300meg WiFi network instead of 54meg it would have had the same result?

posted on Sunday, 12 February 2012 20:47:00 (GMT Standard Time, UTC+00:00)  #    Comments [0]