Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Dynamically added input box not supported - RapidSpell Web Java - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
arvindbhoir
#1 Posted : Tuesday, May 27, 2014 1:13:11 PM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
Hi, I am facing an issue to use spell checker with dynamically added input field.

In my application their is need to create some dynamic (client side) input box at run time and want spell checker on that input text box. but it is not working on it. It's working fine with the static input box which were present at the time of page loading.

Can anyone tell me how to bind spell checker with dynamically added input box.

ArvindB
ArvindB
Jim
#2 Posted : Tuesday, May 27, 2014 1:36:43 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Hi Arvind, please call

rapidSpell.ayt_setupTextBoxes(true);

in Javascript after you add your textbox. If that doesn't help then please provide more context for your scenario, such as how you're adding the textbox (I assumed DHTML).

Best
Jim

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


arvindbhoir
#3 Posted : Tuesday, May 27, 2014 2:18:08 PM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
Hi Jim,

Thanks for the prompt reply,

It worked with rapidSpell.ayt_setupTextBoxes(true); but it doesn't works all the time.

I mean, I am having modal popup, in which I have some 2-3 input text box. When I open that popup first time, it worked with your solution. but if I open the popup second time then again spell checker stopped working on same input box. Do i need to call something like rapidSpell.ayt_setupTextBoxes(false); after closing the popup or something else.

And one more thing, when it works first time, the spellchecker code adds some default padding and border to my control (basically inside it adds iframe). Is there any way so that it will not add any style to the input box and styles of my old input box will remain same.

I am using jQuery to dynamically add popup into the DOM.

ArvindB
ArvindB
arvindbhoir
#4 Posted : Tuesday, May 27, 2014 6:25:37 PM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
I am able to resolved the above mentioned issue by giving different id to those text box each time. Now facing another issue, My autocomplete doesn't working fine with spell checker and I want to only use custom dictionary and not the default English dictionary. Jim can you help me out to resolve this.

ArvindB
ArvindB
Jim
#5 Posted : Tuesday, May 27, 2014 7:20:21 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Sure. About dictionaries, please see
http://keyoti.com/produc...rGuide/Dict%20Files.htm
http://keyoti.com/produc.../The%20Dictionaries.htm

If you have a custom dictionary that should replace English, then you should use Dict Manager to create a .dict file (Dict Manager came with the download ZIP). If you build your .dict file from a text file containing words one per line, then just make sure the text file is UTF16 encoded. Here's a how to http://keyoti.com/kb/Def...iew&questId=66&catId=45

You can then use that .dict file like this

rapidSpell.setParameterValue('default', 'DictFile', '\\serverside\\path\\to\\dictfile.dict');


Jim

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


arvindbhoir
#6 Posted : Thursday, May 29, 2014 9:15:44 AM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
Hi Jim,
I tried using rapidSpell.setParameterValue('default', 'DictFile', '~/userdictionaries/1.dict'); this command instead of rapidSpell.setParameterValue('default', 'UserDictionaryFile', '~/userdictionaries/1.txt'); but it doesn't worked for me.

In http://keyoti.com/produc...rGuide/Dict%20Files.htm link they have asked to set the attribute dictFile of RapidSpellWebLauncher or RapidSpellWInline. can you tell me where to set this attribute. and will absolute path of the file can have path like '~/userdictionaries/1.txt'.


and also can you tell me how can I use jQuery autocomplete with the same input box with which I am using Spell Checker.


ArvindB
ArvindB
Jim
#7 Posted : Thursday, May 29, 2014 1:47:41 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
quote:

I tried using rapidSpell.setParameterValue('default', 'DictFile', '~/userdictionaries/1.dict'); this command instead of rapidSpell.setParameterValue('default', 'UserDictionaryFile', '~/userdictionaries/1.txt'); but it doesn't worked for me.



This, "rapidSpell.setParameterValue('default', 'DictFile', '~/userdictionaries/1.dict');" is wrong, DictFile is the binary main dictionary. So it's not going to be able to read a userdictionary.
Did you make the .dict file with Dict Manager?
What did you name it?
Where is it in relation to your app root folder?

quote:

In http://keyoti.com/produc...rGuide/Dict%20Files.htm link they have asked to set the attribute dictFile of RapidSpellWebLauncher or RapidSpellWInline. can you tell me where to set this attribute. and will absolute path of the file can have path like '~/userdictionaries/1.txt'.



That's for developers using the older JSP Tag based approach. You use it if you are using <RapidSpellWebLauncher> tags, but doing things that way is a different methodology and I don't suggest you switch.

quote:

and also can you tell me how can I use jQuery autocomplete with the same input box with which I am using Spell Checker.



Because this thread is branching here, please post a new thread about the jquery autocomplete - in the post include as simple as possible a page that reproduces the issue. Mostly because I need to know how your autocomplete is working. Be sure to include either the URL to the autocomplete scripts and CSS, or the entire code.

Thanks
Jim


-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


arvindbhoir
#8 Posted : Thursday, May 29, 2014 2:09:32 PM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
Hi Jim,
I have created .dict file using the Dict manager and have saved the file as 1.dict into userdictionaries folder which is inside the approot folder. Can you tell me is that right way to save it inside that folder.

ArvindB
ArvindB
Jim
#9 Posted : Thursday, May 29, 2014 4:53:43 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Ok, yes that is right Arvind, it's just a bit confusing to put it in userdictionaries, but no matter.

rapidSpell.setParameterValue('default', 'DictFile', '~/userdictionaries/1.dict');

should work, assuming that our code can find the approot itself. Sometimes this isn't possible such as with WAR deployments that aren't 'exploded' (files extracted from the WAR). There should be a log message when that is the case.

When you say 'it hasn't worked for me', what happened exactly, an error? Defaults to our English dictionary?

For a test it would be good to try using a full path, eg.
Code:

rapidSpell.setParameterValue('default', 'DictFile', 'c:\\myapp\userdictionaries\\1.dict');


and see what happens.

Best
Jim

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


arvindbhoir
#10 Posted : Thursday, May 29, 2014 6:16:01 PM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
Hi Jim,
You are correct when I am using that command, I am getting long error msg, and I tried with the absolute path of .dict file. But that too didn't worked.

As per that long error msg it was searching file in dictionary folder defined in web.xml but didn't found file.

ArvindB
ArvindB
Jim
#11 Posted : Thursday, May 29, 2014 6:48:59 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Can you copy/paste the error from when you used absolute path please?

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


arvindbhoir
#12 Posted : Friday, May 30, 2014 4:46:54 AM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
Hi Jim,

This is the exact address which I am using
rapidSpell.setParameterValue('default', 'DictFile', 'D:\\Setup\\apache-tomcat-6.0.32_Black\\webapps\\jKool\\userdictionaries\\jKoolWords.dict');

and following is the error I am getting in alert box

An error occurred in RapidSpell; java.lang.RuntimeException: (3) The userDictionaryFile specified is not located within one of the directories specified in RapidSpellUserDictionaryDirs in the web.xml - please see the user guide.

@ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425 @ [Ljava.lang.StackTraceElement;@1204425


ArvindB
ArvindB
Jim
#13 Posted : Friday, May 30, 2014 1:16:23 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Thanks, that error is related only to the setting of UserDictionaryFile

rapidSpell.setParameterValue('default', 'UserDictionayFile', .....);

Please follow http://keyoti.com/produc...ode/User_dictionary.htm

If you're still stuck let me know what path you're using for UserDictionaryFile and also what setting you have in the web.xml for RapidSpellUserDictionaryDirs

Thanks

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


arvindbhoir
#14 Posted : Monday, June 2, 2014 11:10:13 AM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
Hi Jim,
I want to use .dict file and not the .txt file. Because when I am using .txt file then I am getting my words but with that it also supports normal English dictionary. In our application I just want to use our own words for dictionary and hence wants to exclude the default English dictionary to be used by spell checker.

In simple words if a word is not present in our own dictionary the spell checker should show error, even if the word is correct as per English grammar. That's why as per your suggestion I am trying to use .dict file which I have created from the dictionary manager.

Please tell me way to use .dict file. what will be my command to include .dict file on my .jsp page and what will be settings for the same in web.xml file.

I have already tried rapidSpell.setParameterValue('default', 'DictFile', '~/userdictionaries/1.dict'); this method but it gives me long error msg.

ArvindB
ArvindB
Jim
#15 Posted : Monday, June 2, 2014 12:44:30 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Hi Arvind, I understand what you're trying to do. What I'm saying is that the error is not actually caused by the dict file setting, that looks to be correct.

The error is the user dictionary parameter. It's a security feature we had to implement to stop forged user dictionary paths allowing files to be written anywhere.

You need a setting like this in your web.xml

Code:

<?xml version="1.0" encoding="UTF-8"?>

<web-app ...>

    <context-param>
<b>
        <param-name>RapidSpellUserDictionaryDirs</param-name>
        <param-value>~/userdictionaries</param-value>
</b>
    </context-param>

....
</web-app>

And either set

[code]
rapidSpell.setParameterValue('default', 'UserDictionaryFile', '');


to disable the user dictionary, or

Code:

rapidSpell.setParameterValue('default', 'UserDictionaryFile', '~/userdictionaries/userdict.txt');



to enable it.

Jim

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


arvindbhoir
#16 Posted : Monday, June 2, 2014 5:26:58 PM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
Jim I have set these parameters, and I can use my custom dictionary, It is working fine.

But I don't want that my sentence should be spell checked as per English language. How can I get this? Is it possible?
i.e : Take an example of word "flight". This is correct word as per English language. But if this word is not present in my custom dictionary then I want to show error with this word and show the suggestions only from my custom dictionary. Is it possible to get this functionality.

ArvindB
ArvindB
Jim
#17 Posted : Tuesday, June 3, 2014 1:24:34 AM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Hi Arvind, thanks for sending us your files - the problem was that the file you imported from '1.txt' was not in UTF16 encoding - I mentioned the encoding before but it's easily overlooked.

Usually you can specify the encoding when you save the text file, eg in notepad's 'save as...'.

Here's a working version of your .dict file - if you have any trouble let us know.
https://www.dropbox.com/...jkrgkz/jKoolWords2.dict

Jim

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


arvindbhoir
#18 Posted : Tuesday, June 3, 2014 11:12:33 AM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
Hi Jim,
I am now using the jKoolWords2.dict file but still getting following error

"An error occurred in RapidSpell; java.lang.RuntimeException: (3) The userDictionaryFile specified is not located within one of the directories specified in RapidSpellUserDictionaryDirs in the web.xml - please see the user guide.

@ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1 @ [Ljava.lang.StackTraceElement;@959fa1"

I am using following method to link .dict file
rapidSpell.setParameterValue('default', 'DictFile', '~/userdictionaries/jKoolWords2.dict');

I tried with absolute path too, but it didn't worked.

ArvindB
ArvindB
Jim
#19 Posted : Tuesday, June 3, 2014 1:24:20 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
That's odd, now you're back to the UserDictionaryFile problem again, did you change the code since you had it working?

Have you tried

Code:

rapidSpell.setParameterValue('default', 'UserDictionaryFile', '~/userdictionaries/1.txt');


or if you don't want the user dictionary at all

Code:

rapidSpell.setParameterValue('default', 'UserDictionaryFile', '');


We're going round in circles a bit, so just to clarify this, you've seen two problems, the latest problem you posted is about where the user dictionary is, and this is not related to your other problem which was about creating the dict file (which is solved).

Please post or send your code again if you're still stuck.
Thanks
Jim

-your feedback is helpful to other users, thank you!

-your feedback is helpful to other users, thank you!


arvindbhoir
#20 Posted : Tuesday, June 3, 2014 2:08:40 PM
Rank: Member

Groups: Registered

Joined: 5/27/2014
Posts: 32
Since I am using .dict file which you have given me, I had removed UserDictionaryFile parameter.
Now I had just added

rapidSpell.setParameterValue('default', 'UserDictionaryFile', '');
rapidSpell.setParameterValue('default', 'DictFile', '~/userdictionaries/jKoolWords2.dict');

and it worked as I wanted.
Thanks for your help Jim...

ArvindB
ArvindB
Forum Jump  
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.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.