Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Miising function attachErrorLink

$
0
0
Re: Miising function attachErrorLink
Web Connection 5.0
Re: Miising function attachErrorLink
Nov. 12, 2012
02:18 pm
3N50UOOORShow this entire thread in new window
Gratar Image based on email address
From:Tore Bleken
To:Tore Bleken
Problem solved. Included the link to the jquery files for intellisense, but forgot to include the link to the "active" jquery files. Somehow I thought that they were included automatically.


This is the javascript which is injected into the html. I am not an expert on jquery, but I don't see any code here which should move the cursor to the field with an error in it, when I press the error message. That is what happens in the video, video #3 at about 22:45. Or maybe you have later changed the behavior?
<script type="text/javascript">function attachErrorLink(id) {var el = $("#" + id);if (el.length < 1) return;if(typeof(OnBindingErrorLink)!='undefined') OnBindingErrorLink(el.get(0)); el.focus().addClass("errorhighlight") setTimeout(function() { el.removeClass("errorhighlight"); },4000) }


Please pardon my late reply. I investigated further, and see that my first assumption was wrong. However, when I click on the error link, for some reason the focus is not set to the control with error in it, in this case txtName. It seems like the jquery call doesn't run. I have added the jquery files like this:
<ww:wwWebLiteral ID="WwWebLiteral1" runat="server"Visible="false"><!-- these are here for Intellisense support only. Do not use these for embedding scripts! --> <script src="~/scripts/jquery.js"type="text/javascript"></script><script src="~/scripts/ww.jquery.js"type="text/javascript"></script></ww:wwWebLiteral>

Any suggestions?

It's part of the validation routines. It comes from BindingErrorCollection.ToHtml() and can be found in WebControl.prg.
This should only be added automatically if there is in fact an error that occurs.

+++ Rick ---



Rick,

I am watching your old WC videos, while trying out for myself. Half way into video no. 3, in EditDeveloper, your error routine for missing or wrong data, calls a javascript function called attachErrorLink, however I can't find this function in any of the files which are shipped with wc5.64. This is from the created html when I leave txtName blank:

<td><span style="font-weight:Normal">Please correct the following</span><hr><ul><li><a href="javascript:;" onclick="attachErrorLink('txtName')">Name cannot be left empty</a></li>






Viewing all articles
Browse latest Browse all 10393

Trending Articles