Showing posts with label dataform. Show all posts
Showing posts with label dataform. Show all posts

Sunday, October 19, 2014

Form was customized not working with attachment


Share/Save/Bookmark

Are you troubled with this error? then 99% of chance that you have done something very similar to what i did, building a custom list form(new/edit) where custom list form(dataform)  webpart is added. Also, i believe this is happen to be in only in SharePoint 2007(did not test in 2010/2013).

So when a custom list form webpart is added in the sharepoint designer, it supposed to work as is without any customizations but attachment functionality is broken as it was never completely built. MSFT has released a fix for it. There is a XSLT code snippet you need to copy from here to get this fixed, its pretty straightforward.


Subscribe

Sunday, February 20, 2011

Access Page field in Dataform webpart

Share/Save/Bookmark

It’s the first time i got a chance to work on the so called, Swiss knife of SharePoint "Dataform" webpart .
I have a requirement to pull the data (different sitecollection) using dataform webpart
and filter the data based on the field value of the page(created based on page layout) where the webpart is placed on.

As it is cross site querying, I have to add a new SOAP datasource and configure it to dataform webpart. I could pull the data,
so how to access the page field value inside the dataform webpart xsl?
ParameterBinding is the solution for it.
It allows you to declare the external parameters that can be accessed by dataform webpart.

So how do we get this work??
  
Create datasource :

There are many feeds lying out there on web that would help you to create a soap datasource and pull data using dataform webpart with the help of Sharepoint Designer.

Define ID attribute:

Make sure ID attributes are set for the page fields that you want to access in dataform webpart. For example i want to access a look up field that is part of a pagelayout which is defined as

ParameterBinding:

In Sharepoint designer 2010 click on the dataform webpart to see the its properties/settings
on the ribbon. Click on parameters on options tab as shown below


Name the parameter "lookupFieldParam" that should be binded to the pagefield control
holding the id PageFieldSrc as selected in the screen. Default value for this new param can also be selected.



After you click on ok, designer adds the necessary param definition xsl tags to the dataform webpart. The place you should care about to have it is under

<parameterbindings>
 ....
<ParameterBinding Name="lookupFieldParam"  Location="Control(PageFieldSrc,ItemFieldValue)" DefaultValue="ABC" />
</parameterbindings>

Now it’s time to test our efforts...

Add the below xsl tag under row template and create a page based on that pagelayout to see if the parameter is fetching the value.

<xsl:value-of select="$lookupFieldParam" />
 Note $ reference here.

So now we have page field value in dataform webpart, how to use this to filter the data in dataform webpart will be drafted in my next version of this post.

 Subscribe