In
the first article of the blog I wrote about displaying field values in (Render Pattern) Display Pattern using web-services and JavaScript. This method is good enough… However, if we have large volume of data to display the productivity will be low. The reason is that every time field value isn’t filled a web-service is called and a wsdl answer is parsed. Probably this method of displaying values by this type of field can satisfy an end-user it’s unlikely that metadata field will be widely used). However, it won’t work with
Extended Lookup Field.
The first idea for automation is a onetime call of a web-service to transfer an array of nonrecurring field values. And it’s better to choose another data format instead of XML. Using
jQuery is one of the best ways to select necessary items on a HTML page. Choosing this framework it’s better to send and receive data in
JSON format. Moreover there are all necessary metadata for it in NET Framework 3.5 SP1.
As far as web-service call will be made only once it’s better to make this via element event in HeaderPattern. Such element will be iframe element with onload event. A part of the HeaderPattern code for this decision is given below.
<RenderPattern Name="HeaderPattern">
<HTML><![CDATA[<script src="/_layouts/jQuery/jquery-1.6.4.js"></script>]]></HTML>
<HTML><![CDATA[<script src="/_layouts/jQuery/json2.js"></script>]]></HTML>
<HTML><![CDATA[<script src="/_layouts/ExtLookup.js"></script>]]></HTML>
<HTML><![CDATA[<iframe id="Header]]></HTML>
<List/>
<Property Select="Name"/>
<HTML><![CDATA[" height="0" width="0" onl oad="GetExtValueAJAX("div_]]></HTML>
<List/>
<Property Select="Name"/>
<HTML><![CDATA[", "]]></HTML>
<HttpVDir/>
<HTML>
<![CDATA[", "]]>
</HTML>
<List/>
<HTML>
<![CDATA[", "]]>
</HTML>
<Property Select="Name"/>
<HTML>
<![CDATA[");"></iframe>]]>
</HTML>
</RenderPattern>