<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>oykr.com</title>
	<atom:link href="http://www.oykr.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://oykr.com/blog</link>
	<description>The Oykr Blog</description>
	<pubDate>Thu, 24 Jul 2008 12:15:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Can&#8217;t invoke action&#8230;</title>
		<link>http://oykr.com/blog/?p=15</link>
		<comments>http://oykr.com/blog/?p=15#comments</comments>
		<pubDate>Thu, 24 Jul 2008 11:54:06 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
		
		<category><![CDATA[Can't invoke action]]></category>

		<category><![CDATA[metastorm]]></category>

		<guid isPermaLink="false">http://oykr.com/blog/?p=15</guid>
		<description><![CDATA[Sometimes the bain of my life.&#160; It appears as a simple Metastorm BPM error and results in various messages logged in the event log and / or the eLog table.&#160; This time the following event was logged in the application event log and it was looking like SQL Server was throwing a wobbly:
ErrorCode: &#8216;-2147467259&#8242; Description: [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes the bain of my life.&nbsp; It appears as a simple Metastorm BPM error and results in various messages logged in the event log and / or the eLog table.&nbsp; This time the following event was logged in the application event log and it was looking like SQL Server was throwing a wobbly:</p>
<p>ErrorCode: &#8216;-2147467259&#8242; Description: &#8216;Cannot create new connection because in manual or distributed transaction mode.&#8217;&nbsp; Source: &#8216;Microsoft OLE DB Provider for SQL Server&#8217;&nbsp; SQL State: &#8221;&nbsp; NativeErrorCode: &#8216;0, </p>
<p><a href="http://oykr.com/images/blog/Cantinvokeaction_B8A3/ApplicationEvent.gif" ><img style="border-right: 0px; border-top: 0px; margin: 0px 25px 0px 0px; border-left: 0px; border-bottom: 0px" height="260" alt="Application Event Error" src="http://oykr.com/images/blog/Cantinvokeaction_B8A3/ApplicationEvent_thumb.gif" width="233" align="left" border="0"></a> </p>
<p>Sometimes the simple problems slow you down somewhat and it&#8217;s the time it takes searching for the information (that you know is out there) that takes the most of it.&nbsp; Today was one of those days!</p>
<p>After searching on MSDN and other SQL related web sites I went back to the tried and tested <a href="http://metastorm.processmapping.com.au/mb/ework" rel="nofollow" onclick="javascript:pageTracker._trackVisit('/outbound/article/metastorm.processmapping.com.au');">Metastorm forum</a> hosted by ProcessMapping and searched for the following string &#8220;distributed transaction mode&#8221;.</p>
<p>Lo and behold - one result - and the right one to boot!.&nbsp; </p>
<p>The solution - run the script eWorkProcedures.sql found at:<br />C:\Program Files\Metastorm BPM\Engine\Database\SQL scripts\</p>
<p>It looks like I upgraded a test VM a while back but never quite completed the job.&nbsp; I guess the moral of the story is check the Metastorm forums first, then look at other non-metastorm related sites.&nbsp; It&#8217;s far easier that way!</p>
]]></content:encoded>
			<wfw:commentRss>http://oykr.com/blog/?feed=rss2&amp;p=15</wfw:commentRss>
		</item>
		<item>
		<title>Incorrect scripts being delivered to the web client</title>
		<link>http://oykr.com/blog/?p=13</link>
		<comments>http://oykr.com/blog/?p=13#comments</comments>
		<pubDate>Thu, 20 Mar 2008 15:09:02 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
		
		<category><![CDATA[Bug]]></category>

		<category><![CDATA[Designer]]></category>

		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://oykr.com/blog/?p=13</guid>
		<description><![CDATA[I&#8217;ve just wasted a few hours investigating an annoying bug - or possibly just a feature that we&#8217;re not aware of? 
After making changes to a client side script and and trying to debug I was getting puzzled why changes I&#8217;d made in the designer were not being delivered to the client.&#160; 
At first I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just wasted a few hours investigating an annoying bug - or possibly just a feature that we&#8217;re not aware of? </p>
<p>After making changes to a client side script and and trying to debug I was getting puzzled why changes I&#8217;d made in the designer were not being delivered to the client.&nbsp; </p>
<p>At first I though this was just a IE &#8220;feature&#8221; so I cleared out the temporary files and cookies but this did not solve the problem, however it did solve another issue where the web client filters were not working correctly. Out of chance I ran the iisreset command and this allowed the correct version to be delivered, however after the next code change the client again received the older script.</p>
<p>Next under the microscope was IIS, this I assumed must be caching the files on initial delivery. After tweaking a few things it appeared this was in the clear to.&nbsp; Back to the drawing board and running iisreset at every change.</p>
<p>After leaving the issue for a while I was inspecting the DOM of a delivered page and noticed the client script delivery mechanism:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">script</span> <span style="color: #ff0000">type</span><span style="color: #0000ff">="text/JScript"</span> </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        <span style="color: #ff0000">language</span><span style="color: #0000ff">="JScript"</span> </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        <span style="color: #ff0000">src</span><span style="color: #0000ff">="eScript.ashx?AttachmentFile=ClientScript.js&amp;amp;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">             AttachmentOwner=map1&amp;amp;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">             AttachmentType=Procedure&amp;amp;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">             Service=Metastorm BPM Server&amp;amp;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">

             Ver=29"</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">script</span><span style="color: #0000ff">&gt;</span>
</pre>
</div>
</div>
<p>Notice the &#8220;Ver=29&#8243; tag?&nbsp; Now this means that the web client is looking for a specific version of the client side script however if you had turned off versioning in the designer after initially publishing the procedure without really knowing what it does it means that no matter how many times you subsequently publish any newer scripts will not be delivered to the client.</p>
<p>I&#8217;m not sure if this is a bug or what Metastorm would call a feature but it&#8217;s certainly not obvious and surely the web client should then not attempt to retrieve versioned client scripts?&nbsp; Earlier in the day I&#8217;d unchecked many of the check boxes under the Metastorm Designer&#8217;s publisher options section to remove the annoying pop ups that you get when developing.&nbsp; Looks like it was one checkbox too many.&nbsp; Roll on version 7.6&#8230;</p>
<p>Hope this saves you some time if you also get caught by this &#8220;feature&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://oykr.com/blog/?feed=rss2&amp;p=13</wfw:commentRss>
		</item>
		<item>
		<title>Grids Extensions</title>
		<link>http://oykr.com/blog/?p=10</link>
		<comments>http://oykr.com/blog/?p=10#comments</comments>
		<pubDate>Fri, 04 Jan 2008 18:24:01 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
		
		<category><![CDATA[Grids]]></category>

		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://oykr.com/blog/?p=10</guid>
		<description><![CDATA[Extending the functionality of grids in the Metastorm Web Client - examples including adding hyperlinks to cells]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been battling for a while with the web implementation of Grids in the web client. A couple of the features I would like to see included in a standard client include:</p>
<blockquote><p>Standard methods that can be overridden to allow full control of what happens when a user clicks an individual row</p>
<p>Full control of cell content - i.e. let us embed HTML objects such as links &amp; images etc&#8230;</p></blockquote>
<p>A few years back we developed standard routines for expanding and shrinking the size of a grid which also managed the layout alterations that were then necessary. Although the users liked this additional control it was only really useful when designing forms that are constrained by size and contained many fields - it didn&#8217;t really make the actual operation of filling in the form any easier.</p>
<p>During the end of 2007 we have been developing for a client where extra control of the grid would have made the user experience far simpler so it was time to delve deeper into what goes on inside.  A few hours of investigation and we&#8217;ve produced some client-side JScript extensions that covers our needs.  I&#8217;m sure they won&#8217;t be suitable for all situations due to the additional complexity but when you really need to do something special hopefully these routines may be able to help.</p>
<p><span id="more-10"></span></p>
<p>The example that follows is only suitable for read-only grids and although there are a few bits to follow we&#8217;re hopefully going to incorporate most of the hard work into a future release of the Oykr Framework - A Scripting framework that will be supported and will make some of the tips and tricks documented on this site more accessible.</p>
<p>The code here is based upon MBPM version 7.5 but I&#8217;m sure they could be adapted for most of not all of the web clients. We would never claim these are bullet proof but during extended testing everything is looking rosy!</p>
<p>The concept works by creating enhanced focus event handler and overriding the default onFocusEvent method through an initialisation call to the function Init() when the form has loaded.  We override this function as any enhancements made to a grid need to be re-applied whenever the grid is redrawn</p>
<p>To override the FocusCurrentRow() method of our grid, grdUserList we use: </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">eworkData.FieldByName(<span style="color: #006080">"grdUserList"</span>).FocusCurrentRow = myFocusCurrentRow;</pre>
<p>Now that the focus event has been redirected to our new handler we need to re-create the functionality of the original handler and then add the additional steps we would like ran when a grid is re-drawn.</p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #0000ff">function</span> myFocusCurrentRow()</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  <span style="color: #008000">//STANDARD METASTORM FocusCurrentRow() CODE</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  <span style="color: #0000ff">if</span> ( (<span style="color: #0000ff">this</span>.LastSelectedRow != -1) &amp;&amp;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">       (<span style="color: #0000ff">this</span>.LastSelectedPage == <span style="color: #0000ff">this</span>.CurrentPageNo) &amp;&amp;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">       (!UpdateInProgress))</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">    <span style="color: #0000ff">var</span> LCurrentRow = <span style="color: #0000ff">this</span>.HTMLfield.rows(<span style="color: #0000ff">this</span>.LastSelectedRow);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">    <span style="color: #0000ff">this</span>.ChangeRowColors(LCurrentRow,</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">                         SelectedRowBackgroundColor,</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">                         SelectedRowFontColor)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">    <span style="color: #0000ff">if</span>(!RowClicked)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">    {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">      <span style="color: #0000ff">if</span>(LCurrentRow != <span style="color: #0000ff">null</span>)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">      {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">        <span style="color: #0000ff">if</span>( (LCurrentRow.offsetTop + LCurrentRow.clientHeight)&lt;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">                                  <span style="color: #0000ff">this</span>.MainTable.clientHeight )</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">          <span style="color: #0000ff">this</span>.MainTable.scrollTop = 0;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">        <span style="color: #0000ff">else</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">          <span style="color: #0000ff">this</span>.MainTable.scrollTop = LCurrentRow.offsetTop;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">      }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">    }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  <span style="color: #008000">//STANDARD METASTORM FocusCurrentRow() CODE END</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  <span style="color: #008000">//OUR CUSTOM PROCESSING START</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  SetHtmlCellContent();</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  <span style="color: #008000">//OUR CUSTOM PROCESSING END</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">}</pre>
<p>SetHtmlCellContent() gives us a hook from the focus event to add in our enhancements.  In this example we&#8217;ll show how to add a hyperlink to a column.</p>
<p>In the function below we introduce 3 new function calls, disableGridCo<!--more--><!--more-->ntrol, enableGridControl and eworkSetCellInnerHTML.  The first 2 functions allow us to block and re-enable further events from being processed as the standard functions eworkGetCell and eworkSetCell cause further focus events to be fired resulting in recursive events being raised.</p>
<p>SetHtmlCellContent() blocks events from being fired for the grid, and then for each record within the visible grid it will create a hyperlink element and insert it into the 3rd column (index 2). Finally it re-enables event processing.</p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #0000ff">function</span> SetHtmlCellContent()</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  <span style="color: #008000">//Set references</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  <span style="color: #0000ff">var</span> gridName  = <span style="color: #006080">"grdUserList"</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  <span style="color: #0000ff">var</span> COL_LINK  = 2;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  <span style="color: #0000ff">var</span> tbl       = document.getElementById(gridName);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  <span style="color: #008000">//disable event handlers</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  disableGridControl(<span style="color: #006080">"grdUserList"</span>);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  <span style="color: #008000">//iterate over records</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  <span style="color: #0000ff">for</span> (<span style="color: #0000ff">var</span> i=0; i&lt;(tbl.rows.length-1); i++)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">    <span style="color: #0000ff">var</span> a       = document.createElement(<span style="color: #006080">'a'</span>);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">    a.href      = <span style="color: #006080">"http://oykr.com/blog"</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">    a.target    = <span style="color: #006080">"_blank"</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">    a.innerText = <span style="color: #006080">"The Oykr Blog"</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">    eworkSetCellInnerHTML (gridName, COL_LINK, i, a.outerHTML);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  <span style="color: #008000">//restore event handlers</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  enableGridControl(<span style="color: #006080">"grdUserList"</span>);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">}</pre>
<p>The function eworkSetCellInnerHTML is an slightly tweaked version of the Metastorm function eworkSetCell. It is exactly the same as the standard Metastorm version except where the normal function sets the InnerText value this function sets the InnerHTML allowing you extra control over the cells actual content. It then adds the cell index to the parent cell to allow standard functions to still be able to reference it correctly.</p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #0000ff">function</span> eworkSetCellInnerHTML(AGridName, AColIndex, ARowIndex, AValue)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  <span style="color: #0000ff">var</span> LGrid = eworkData.FieldByName(AGridName);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  AColIndex = parseInt(AColIndex);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  <span style="color: #0000ff">if</span>(LGrid.AccessibilityOn)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">      AColIndex++;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  ARowIndex = parseInt(ARowIndex);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  <span style="color: #0000ff">var</span> LRow  = LGrid.HTMLfield.rows(ARowIndex + 1);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  <span style="color: #0000ff">if</span> ( LRow != <span style="color: #0000ff">null</span> )</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">    <span style="color: #0000ff">var</span> LCell = LRow.cells(AColIndex);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">    <span style="color: #0000ff">if</span> (LCell != <span style="color: #0000ff">null</span>)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">    {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">      <span style="color: #0000ff">var</span> LCurrentCell = LCell.children[0];</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">      <span style="color: #0000ff">var</span> LCurColumn   = LGrid.ColumnByName(LCurrentCell.dataFld);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">      <span style="color: #0000ff">if</span> ( <span style="color: #0000ff">null</span> != AValue )</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">      {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">        <span style="color: #008000">//Our code to set the HTML value and set the cellindex value</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">        <span style="color: #008000">//as this isued by some of the standard functions</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">        LCurrentCell.innerHTML = AValue;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">        LCurrentCell.cellIndex = AColIndex;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">      }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">    }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">}</pre>
<p>And the final functions to enable and disable the grids events&#8230;</p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"><span style="color: #0000ff">function</span> disableGridControl(AGridName)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  eworkData.FieldByName(AGridName).XMLData.onrowenter   = <span style="color: #0000ff">null</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  eworkData.FieldByName(AGridName).XMLData.onrowexit    = <span style="color: #0000ff">null</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  eworkData.FieldByName(AGridName).HTMLfield.onkeydown  = <span style="color: #0000ff">null</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">}</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #0000ff">function</span> enableGridControl(AGridName)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  eworkData.FieldByName(AGridName).XMLData.onrowenter   = ReadOnlyGridRowEnter;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">  eworkData.FieldByName(AGridName).XMLData.onrowexit    = ReadOnlyGridRowExit;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px">  eworkData.FieldByName(AGridName).HTMLfield.onkeydown  = checkReadOnlyGridKey;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px">}</pre>
<p>It&#8217;s quite a bit to get down on paper but most of the functions are standardized and in this example only SetHtmlCellContent() needs to be adapted to fit your exact needs.  As a secondary side effect - the function myFocusCurrentRow() also exposes the exact cell and value that was clicked so you can make scripted calls based upon exactly what the user has clicked in the grid.</p>
<p>Feel free to download the working example below complete with the complete and commented JavaScript.</p>
<p style="display: inline; margin: 0px; padding: 0px" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:6186e212-b115-43bb-8e36-c7a7b7dc3447" class="wlWriterSmartContent">Dowload zipped example : <a href="http://oykr.com/images/blog/Grids_10B5C/OGridExtensionDemo.zip"target="_blank"  onclick="javascript:pageTracker._trackVisit('/downloads/images/blog/Grids_10B5C/OGridExtensionDemo.zip');">OGridExtensionDemo.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://oykr.com/blog/?feed=rss2&amp;p=10</wfw:commentRss>
		</item>
		<item>
		<title>How to stop server-side code running when client-side validation fails for a command button</title>
		<link>http://oykr.com/blog/?p=6</link>
		<comments>http://oykr.com/blog/?p=6#comments</comments>
		<pubDate>Wed, 02 Jan 2008 08:05:43 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
		
		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://oykr.com/blog/?p=6</guid>
		<description><![CDATA[At times when developing UI functionality you will want to allow the user the ability to run a server side operation only if certain client side conditions are met.]]></description>
			<content:encoded><![CDATA[<p>At times when developing UI functionality you will want to allow the user the ability to run a server side operation only if certain client side conditions are met.  This can range from tasks such as checking the information entered on a form is sensible and realistic such as checking for a valid postcode or more sophisticated checks such as ensuring all data entered in a grid is valid before carrying out a dependent e-mail operation.</p>
<p>Normally this type of validation is carried out when a form is submitted and we can easily trap these conditions. Return false from a validation script and it will stop the submission and therefore the server side code, however if you try to do something similar from a command button it&#8217;s not so simple.</p>
<p>The routine method is to simply not allow the user the option of pressing the command button prior to all conditions being met - these conditions being calculated by a hidden check box (or series) and having the button&#8217;s visibility set dependent on these.  i.e. When the conditions are okay the button is visible and  when the conditions are not okay the button is not visible.  Personally, I don&#8217;t really like this as it doesn&#8217;t give any opportunity for feeding back to the user to show why things may be wrong. From a design perspective it also creates a more cluttered view in the MBPM designer which can then lead to maintenance issues as a system grows.  Also, one last minor and avoidable niggle, it can leave a &#8220;hole&#8221; in the form&#8217;s design.</p>
<p>I think it would be more beneficial to allow the the client-side script to perform processing and validation before deciding if it should hand control on to the server for server-side processing. Luckily this is quite simple to achieve.</p>
<p>To do this follow these 2 steps:</p>
<ol>
<li>When the form loads associate a new event handler with the command button</li>
<li>Create the new event handler</li>
</ol>
<p>When the form loads ensure it calls the initialisation function:</p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   1:</span> OnLoad=Init ()&amp;Language=JScript</pre>
<p>Create the initialisation function:</p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">function</span> Init()</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   2:</span> {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   3:</span>     <span style="color: #008000">//hook the command button to it's own event handler to allow</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   4:</span>     <span style="color: #008000">//validation before the server side operation is triggered</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   5:</span>     eworkData.FieldByName(<span style="color: #006080">"btnCmd1"</span>).OnClick = btnCmd1Validate;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   6:</span> }</pre>
<p>Now create the event handler:</p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   1:</span> <span style="color: #0000ff">function</span> btnCmd1Validate()</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   2:</span> {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   3:</span>     <span style="color: #0000ff">try</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   4:</span>     {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   5:</span>         <span style="color: #0000ff">var</span> RESULT = doComplexValidation();</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   6:</span> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   7:</span>         <span style="color: #0000ff">if</span> (RESULT==<span style="color: #0000ff">true</span>)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   8:</span>         {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">   9:</span>             ButtonClick(document.getElementById(<span style="color: #006080">"btnCmd1"</span>));</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  10:</span>             alert(<span style="color: #006080">"Server-side functionality processed"</span>);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  11:</span>         }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  12:</span>         <span style="color: #0000ff">else</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  13:</span>         {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  14:</span>             alert(<span style="color: #006080">"Server-side functionality NOT processed"</span>);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  15:</span>         }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  16:</span>     }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  17:</span>     <span style="color: #0000ff">catch</span> (ex)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  18:</span>     {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  19:</span>         alert (ex.message);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  20:</span>     }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px"><span style="color: #606060">  21:</span> }</pre>
<p>Now when the the command button (btnCmd1) is clicked the new event handler is used.  This allows the function doComplexValidation() to be called which determines if we carry out further processing. If control should be passed back to the server then we call the Metastorm function ButtonClick() passing the command button element itself as the argument to invoke the server-side.</p>
<p>This gives the opportunity for full validation, additional opportunities for user feedback and the potential for taking pre-emptive corrective action should you need to.</p>
]]></content:encoded>
			<wfw:commentRss>http://oykr.com/blog/?feed=rss2&amp;p=6</wfw:commentRss>
		</item>
		<item>
		<title>Code highlighting test</title>
		<link>http://oykr.com/blog/?p=4</link>
		<comments>http://oykr.com/blog/?p=4#comments</comments>
		<pubDate>Fri, 14 Dec 2007 15:13:14 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://oykr.com/blog/?p=4</guid>
		<description><![CDATA[OK, before we start posting code examples I think we&#8217;d better check the code highlighting module:



 function hello_world&#40;&#41;&#123; echo &#34;hello world&#34; &#125;



If this works thanks are due to Dean Lee and his WordPress syntax highlighter.
]]></description>
			<content:encoded><![CDATA[<p>OK, before we start posting code examples I think we&#8217;d better check the code highlighting module:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"> <span class="kw2">function</span> hello_world<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span> <a href="http://www.php.net/echo" onclick="javascript:pageTracker._trackVisit('/outbound/article/www.php.net');"><span class="kw3">echo</span></a> <span class="st0">&quot;hello world&quot;</span> <span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>If this works thanks are due to <a href="http://www.deanlee.cn/wordpress/code_highlighter_plugin_for_wordpress/trackback?k=CGXo8F" onclick="javascript:pageTracker._trackVisit('/outbound/article/www.deanlee.cn');">Dean Lee </a>and his WordPress syntax highlighter.</p>
]]></content:encoded>
			<wfw:commentRss>http://oykr.com/blog/?feed=rss2&amp;p=4</wfw:commentRss>
		</item>
		<item>
		<title>Hello</title>
		<link>http://oykr.com/blog/?p=3</link>
		<comments>http://oykr.com/blog/?p=3#comments</comments>
		<pubDate>Fri, 14 Dec 2007 09:01:52 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://oykr.com/blog/?p=3</guid>
		<description><![CDATA[Welcome to our blog - we intend this to be a place we&#8217;re we document our techniques and the tips &#38; tricks that we use when implementing Metastorm BPM solutions on our client sites.&#160; Not all things will be relevant to day to day development and recommended for everyday use, however we&#8217;ll document what can [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to our blog - we intend this to be a place we&#8217;re we document our techniques and the tips &amp; tricks that we use when implementing Metastorm BPM solutions on our client sites.&#160; Not all things will be relevant to day to day development and recommended for everyday use, however we&#8217;ll document what can be done and leave it to you to decide wether it should be done. Some of the benefits will outweigh the additional care &amp; maintenance but this will need to be decided by you the developer on a case by case basis.&#160; </p>
<p>Some of the first things we want to cover in the coming months include grid extensions, using rich text editors, building tag cloud functionality and more&#8230;</p>
<p>If nothing else it will be our bucket for tried and tested techniques that can be re-used where required&#8230;</p>
<p>We hope it&#8217;s useful to others too.</p>
<p>Cheers,</p>
<p>Paul.</p>
]]></content:encoded>
			<wfw:commentRss>http://oykr.com/blog/?feed=rss2&amp;p=3</wfw:commentRss>
		</item>
	</channel>
</rss>
