Welcome Guest Search | Active Topics | Sign In | Register

Spellcheck in a repeater Options
DonL
Posted: Friday, August 26, 2011 9:08:08 AM
Rank: Member
Groups: Member

Joined: 12/3/2010
Posts: 10

I haven't found any examples of this - is it possible to include spellchecker controls inside a repeater/grid/etc to check a textbox there? I'm guessing there's a way to do it with some client-side code attached during the ItemCreated event; I haven't dug into it yet, but I'm wondering if there's prior art out there somewhere that I've missed.



eo_support
Posted: Friday, August 26, 2011 10:00:08 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You probably don't want to do that. A SpellChecker is a rather "heavy" control that you don't want to repeat 100 times on the same page. Besides, a SpellChecker control may require other controls to function ---- for example, for dialog based SpellChecker control, it would require a dialog. That should not be repeated either.

Your best option is to have a single SpellChecker control and then use JavaScript to check your textbox when needed. The code would be something like this:

Code: JavaScript
//Get the SpellChecker object
var spellChecker = eo_GetObject("SpellChecker1");

//Check the content of your textbox
spellChecker.start(your_text_box_object);


Note here you would pass the DOM textbox object to the SpellChecker's start method.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
DonL
Posted: Tuesday, August 30, 2011 9:39:10 AM
Rank: Member
Groups: Member

Joined: 12/3/2010
Posts: 10
This isn't working for me... I call start() with a textbox object that has some gibberish typed into it, and it errors out with "'this.abqh.length' is null or not an object".

The online docs don't mention start() having any arguments - is this a recently added feature? We haven't updated our version in a while.



eo_support
Posted: Tuesday, August 30, 2011 11:38:05 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Yes. This is one of the later added features. It is not documented either because we weren't sure whether anybody would be using it. In any case, if you haven't been updating your version, you may want to update to the current version since browsers have been updating rather frequently, so earlier versions may not work as well on the latest browsers. If you had purchased within one year, then the upgrade should be free for you.

Thanks!
DonL
Posted: Wednesday, August 31, 2011 5:13:49 PM
Rank: Member
Groups: Member

Joined: 12/3/2010
Posts: 10
I downloaded the current EO install but it looks like it's .NET 2.0+ only; unfortunately we're stuck in a 1.1 world for the time being on this application. Any hope of finding a 1.1 version of spellcheck that supports a start() with arguments?
eo_support
Posted: Wednesday, August 31, 2011 5:22:18 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

EO.Web Controls 8.0 supports ASP.NET 1.1. I've sent the download location to you through private message. You can click "inbox" on the top of the forum to view the message.

Thanks!
DonL
Posted: Thursday, September 1, 2011 4:21:37 PM
Rank: Member
Groups: Member

Joined: 12/3/2010
Posts: 10
Okay, I've updated to the latest 8.0 version and am still getting the error mentioned above. I haven't dropped this into a repeater yet; I'm just trying to fire off client-side a spellcheck on a random text field as a proof-of-concept.

The relevant bits:
Code: JavaScript
function SpellCheck(target) {
		
		var spellChecker = eo_GetObject('scSpellChecker');
		
		spellChecker.start(document.getElementById(target));

	}


.....



Code: HTML/ASPX
<eo:spellcheckerdialog id="dlgSpellChecker" MinimizeButtonUrl="00070102" CloseButtonUrl="00070101" AllowResize="True"
	ShadowColor="LightGray" ResizeImageUrl="00020014" RestoreButtonUrl="00070103" ControlSkinID="None"
	BorderStyle="Solid" Height="200px" BorderColor="#335C88" ShadowDepth="3" BorderWidth="1px" HeaderHtml="Check Spelling"
	Width="300px" runat="server">
	<ContentTemplate>
		<TABLE cellSpacing="0" cellPadding="3" border="0">
			<TR>
				<TD colSpan="3" class="label">Content:
				</TD>
			</TR>
			<TR>
				<TD vAlign="top" width="330" colSpan="2">
					<asp:Panel id="TextPanel" CssClass="TextBox" style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; BORDER-BOTTOM: gray 1px solid" 
 Height="150" Width="330" runat="server"></asp:Panel></TD>
				<TD vAlign="top">
					<asp:Button id="IgnoreOnceButton" Width="120px" runat="server" Text="Ignore Once"></asp:Button>
					<P>
						<asp:Button id="IgnoreAllButton" Width="120px" runat="server" Text="Ignore All"></asp:Button></P>
					<P> </P>
				</TD>
			</TR>
			<TR>
				<TD colSpan="3" class="label">Suggestions:
				</TD>
			</TR>
			<TR>
				<TD vAlign="top" width="330" colSpan="2">
					<asp:Panel id="SuggestionPanel" CssClass="TextBox" style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; BORDER-BOTTOM: gray 1px solid" 
 Height="100" Width="330" runat="server"></asp:Panel></TD>
				<TD vAlign="top">
					<asp:Button id="ChangeButton" Width="120px" runat="server" Text="Change"></asp:Button>
					<P>
						<asp:Button id="ChangeAllButton" Width="120px" runat="server" Text="Change All"></asp:Button></P>
				</TD>
			</TR>
			<TR>
				<TD noWrap class="label">Change to:
				</TD>
				<TD align="right">
					<asp:TextBox id="ChangeToText" Width="220" runat="server" CssClass="TextBox"></asp:TextBox></TD>
				<TD></TD>
			</TR>
			<TR>
				<TD align="right" colSpan="3">
					<asp:Button id="CloseButton" Width="120px" runat="server" Text="Close"></asp:Button></TD>
			</TR>
		</TABLE>
	</ContentTemplate>
	<FooterStyleActive CssText="background-color: #e5f1fd; padding-bottom: 8px;"></FooterStyleActive>
	<HeaderStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 11px; background-image: url(00070104); padding-bottom: 3px; padding-top: 3px; font-family: tahoma"></HeaderStyleActive>
	<ContentStyleActive CssText="border-top: #335c88 1px solid; background-color: #e5f1fd"></ContentStyleActive>
</eo:spellcheckerdialog>
<eo:SpellChecker id="scSpellChecker" runat="server" DialogID="dlgSpellChecker"></eo:SpellChecker>


....

Code: HTML/ASPX
<asp:TextBox id=txtEdtOccupation runat="server" CssClass="TextBox" Visible="True" MaxLength="50" Columns="25"></asp:TextBox>
<asp:Image id="imgCheckEdtOccupation" style="VERTICAL-ALIGN: top;cursor: hand;" Runat="server" imageurl="~/images/spellcheck-icon.gif" ></asp:Image>


....

In Page_Load:
Code: Visual Basic.NET
AddSpellCheckButtonHandler(imgCheckEdtOccupation, txtEdtOccupation)



And last but not least:

Code: Visual Basic.NET
Private Sub AddSpellCheckButtonHandler(ByVal trigger As System.Web.UI.WebControls.Image, ByVal CheckField As Control)
            trigger.Attributes.Add("onclick", "SpellCheck('" + CheckField.ClientID & "');")
        End Sub



SpellCheck(target) gets called when the image is clicked and I've verified that spellChecker and document.getElementById(target) are returning valid objects; but the error happens when .start() is invoked.




eo_support
Posted: Thursday, September 1, 2011 4:38:21 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Have you checked document.getElementById(target) in your code indeed returns you an valid HTML element? It must be a textbox (HTML input type="text" element).

Thanks
DonL
Posted: Thursday, September 1, 2011 5:02:20 PM
Rank: Member
Groups: Member

Joined: 12/3/2010
Posts: 10
Yes, document.getElementById(target).type = 'TEXT'.

eo_support
Posted: Thursday, September 1, 2011 5:16:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

In that case please try to create a full test project that demonstrates the problem and send it to us. Make sure the test project runs independently and contains only code needed to reproduce the problem. Once we have that, we will debug it here and see what we can find. We will PM you as to where to send the test project.

Thanks!
DonL
Posted: Friday, September 2, 2011 9:14:37 AM
Rank: Member
Groups: Member

Joined: 12/3/2010
Posts: 10
Just occurred to me - you specified input type text, which is what I'm currently testing this with - but there are multi-line textboxes on the form which get rendered as TextAreas. Will these also work the way you've suggested above?
eo_support
Posted: Friday, September 2, 2011 9:35:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Please follow through on the previous issue by providing a test page first. We will work on one issue at a time and we won't be running around with you.

Thanks
DonL
Posted: Friday, September 2, 2011 10:48:07 AM
Rank: Member
Groups: Member

Joined: 12/3/2010
Posts: 10
It worked fine in a test project using the same code ripped out of the original where the problem happens. Couldn't figure out why until I noticed the EO dll version in the project had reverted back to 8.0.25. I removed it again, added the reference to 8.0.60, ran the project... and it was back at 8.0.25 again. The "real" project is under source control and I suspect there's something strange happening on that side.

The good news is that is looks like I can get spellcheck to work the way I need it to.

(Tried it against a multi-line textbox and that worked too.)

eo_support
Posted: Friday, September 2, 2011 11:04:22 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great. Glad that it works for you.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.