Spell Check Control Collection

13 posts, 0 answers
  1. Balaji
    Balaji avatar
    14 posts
    Member since:
    Dec 2008

    Posted 30 Sep 2009 Link to this post

    Hi,
     
            I'm using Rad spell in Rad tab strip, Its working fine in First tab once i navigated to second tab ,though the controlstocheck to have different 2nd tab strip text box clientID, it wil checking first Tabstrip Textbox or Some times shows spell check complete.Pls help me to solve this problem.


    Thank you in advance...


    By Balaji.T
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 30 Sep 2009 Link to this post

    Hi Balaji,

    Please open a ticket and send us a sample project where we could examine your exact setup and logic. Once we have a better view over your case, we will do our best to help.

    Greetings,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    11 posts
    Member since:
    Aug 2007

    Posted 18 Jan 2010 Link to this post

    Hello,

    I am having the exact same problem.  I have a rad tab strip, with a rad multi-view.  Each page view has a text area on it.  Each text area has a corresponding link to 'spell check that text area'. There is a single Rad Spell control on th web page, and a single javascript function as such:

    function

     

    SpellCheck(id)

     

    {

     

        var spell = $find('<%= splCheck.ClientID %>');

     

        alert(spell.get_controlToCheck());

        spell.set_controlToCheck(id);

        alert(spell.get_controlToCheck());

        spell.startSpellCheck();

    }

    Naturally, the 'alerts' are not normally in there, but I used them to 'see' what the control thought its 'controlToCheck' was.  Sure enough, whichever control 'goes first', remains 'the control to check' from there on.  However, the alerts DO show that the control *thinks* the controlToCheck has changed, i.e., it reports the 'new' control's ID.  However, the spell check still goes against the old (first) control.

    Has this been addressed - we are using the Q3 '08 version (I know, we should upgrade)?  Is there a work-around?

    Thanks,

    -David

  5. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 19 Jan 2010 Link to this post

    Hi David,

    You should try adding the following statement:

    spell.set_textSource(null);

    before you call set_controlToCheck(). This way the spell checker will clear the previous checked element and should pick up the new one you set.

    All the best,
    Lini
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. David
    David avatar
    11 posts
    Member since:
    Aug 2007

    Posted 20 Jan 2010 Link to this post

    Thanks Lini, that worked great.

    Now, another related question:  I have another web page where I allow users to spell check *either* one text area, or "all the fields on the page".  In my code-behind, I 'assemble' all of the check-able fields as such:

    //build up and set the spell checker fields...

     

     

     

    _spellFields += txtProfExperience.TxtBox.ClientID + ",";

     

    _spellFields += txtOtherQualifications.TxtBox.ClientID +

    ",";

     

    _spellFields += txtAccomplishments

    .ClientID + ",";

     

     

    foreach (RepeaterItem jobRow in rptJobs.Items)

     

    {

     

        TextBox txtContactNotes = jobRow.FindControl("txtJobContactNotes") as TextBox;

     

        _spellFields += txtContactNotes.ClientID +

    ",";

     

    }

    _spellFields = _spellFields.Substring(0, _spellFields.Length - 1);

    //strip final comma

     

    splCheck.ControlsToCheck = _spellFields.Split(

    new Char[] { ',' });

     

     

    Then, on the front-end, when the user wants to check *all* of the fields at once, a button simply triggers the following:

    function StartSpellBio(){

     

        GetRadSpell(

    '<%= splCheck.ClientID %>').startSpellCheck();

     

    }

     

    When a user wants to spell check *one* field though, we have a link next to each checkable text area that calls the following (passing in the text area's ID):

     

    var

     

    allSpellFields; //global var

     

     

    //spell check a single field (id provided in the call)
    function
    SpellCheck(id)

     

    {

     

        var spell = $find('<%= splCheck.ClientID %>');

     

        allSpellFields = spell.get_textSource(); //grab the current textSource and store it away in a global var

        spell.set_textSource(

    null); //clear out the textSource

     

        alert(spell.get_textSource()); //normally not here, but shows 'object' as being there, though it should be null

        spell.set_controlToCheck(id);

        spell.startSpellCheck();

    }

     

     

    //the following is called when RadSpell is finished
    function
    SpellFinished(sender, args)

     

    {

        sender.set_textSource(allSpellFields);

    }

     

    The problem is, using your previous approach of 'clearing out' the textSource does not seem to work.  Instead, all fields are checked every time.  Any advice on how to fully clear out the textSource?

     

    Thanks again,

     

    -David

  7. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 21 Jan 2010 Link to this post

    Hello David,

    Calling the get_textSource() method automatically generates a new text source based on what you have set in the ControlsToCheck/ControlToCheck properties. The reason why I instructed you to set_textSource(null) is that the get_textSource() call will always try to use a previously generated source (cached) instead of picking up a change in the control to check properties. You should not try to set the textsource - instead, use the controlsToCheck property.

    The reason why it failed in your case even after you set_textSource(null) is that you had both controlToCheck (from the client code) and controlsToCheck (from the server code) set to different values. When both properties are set, controlsToCheck has priority. This is why setting controlToCheck was overridden and the spell always checked all controls. To fix this, you should clear the value of controlsToCheck when you set a single control or simply overwrite it and don't set controlToCheck. For example:

    //clearing the value
    var originalControlsToCheck = spell.get_controlsToCheck();
    spell.set_controlsToCheck(null);
     
    spell.set_controlToCheck(id);
     
    //....
    //restore the value when you wish to check all again
    spell.set_controlsToCheck(originalControlsToCheck);


    Kind regards,
    Lini
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. David
    David avatar
    11 posts
    Member since:
    Aug 2007

    Posted 21 Jan 2010 Link to this post

    Thanks Lini - however your solution did not work in practice.  Here is my new js based on your suggestions:

    var

     

    allSpellFields; //global var

     

     

    var allSpellText; //global var

     

     

    function StartSpellAllFields(){

     

     

        var spell = $find('<%= splCheck.ClientID %>');

     

     

        if (allSpellFields != null){

     

            spell.set_controlsToCheck(allSpellFields);

     

            //spell.set_textSource(allSpellText); <--If I DO this line then I can never spell check only ONE field again

     

        }

        spell.startSpellCheck();

    }

     

     


    function
    SpellCheckSingleField(id)

     

    {

     

        var spell = $find('<%= splCheck.ClientID %>');

     

        allSpellFields = spell.get_controlsToCheck();

        allSpellText = spell.get_textSource();

        spell.set_controlsToCheck(

    null);

     

     

        //spell.set_textSource(null);  <-- If I do NOT do this line, then I cannot spell check only ONE field

     

        spell.set_controlToCheck(id);

        spell.startSpellCheck();

    }


    So....using your recommendation, I could not get ONE field to be checked...it always would check them all.
    Once I put in the "spell.set_textSource(null)" line, then I COULD check just one field... but... I could then NOT check ALL the fields again.  I tried storing off the "textSource" and then re-setting it, but that never allowed me to go back to just ONE field again.

    -David
  9. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 25 Jan 2010 Link to this post

    Hi David,

    Here are my suggestions for your code:

    1) always call set_textSource(null) before you modify the control(s) to check.
    2) if you want to check a single control, do a set_controlsToCheck(null)  (note plural of controls) before you do a set_controlToCheck(id)

    More specifically, you do not need the allSpellText variable to store textSource value. Here is the revised version of the code you sent:

    var allSpellFields; //global var
     
    function StartSpellAllFields(){
        var spell = $find('<%= splCheck.ClientID %>');
        spell.set_textSource(null);
        if (allSpellFields != null){
            spell.set_controlsToCheck(allSpellFields);
        }
        spell.startSpellCheck();
    }
     
    function SpellCheckSingleField(id)
    {
        var spell = $find('<%= splCheck.ClientID %>');
        if (allSpellFields == null) allSpellFields = spell.get_controlsToCheck();
        spell.set_controlsToCheck(null);
        spell.set_textSource(null);
        spell.set_controlToCheck(id);
        spell.startSpellCheck();
    }


    All the best,
    Lini
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  10. David
    David avatar
    11 posts
    Member since:
    Aug 2007

    Posted 25 Jan 2010 Link to this post

    Thanks Lini, for hanging in there with me... you solution worked perfectly!  Consider this issue closed.

    -David Baron
  11. Brad
    Brad avatar
    39 posts
    Member since:
    Aug 2010

    Posted 11 Nov 2010 Link to this post

    <quote>
    You should try adding the following statement:

    spell.set_textSource(null);

    before you call set_controlToCheck(). This way the spell checker will clear the previous checked element and should pick up the new one you set.
    </quote>

    THIS NEEDS TO BE ADDED TO THE DOCUMENTATION.
  12. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 15 Nov 2010 Link to this post

    Hi,

    If you are using a more recent version of the RadControls for ASP.NET AJAX (Q1 2010 or later) there should be no need to manually call set_textSource(), since the text source is cleared automatically when you use set_controlToCheck() or set_controlsToCheck(). The workaround is only intended for versions Q3 2009 and earlier.

    Sincerely yours,
    Lini
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  13. Bibha
    Bibha avatar
    4 posts
    Member since:
    Jan 2011

    Posted 24 Jan 2011 Link to this post

    Hello, I am using RadSpell controll n wanna return true once the dialog box closes after makin changes ie

     

     

    var spellChecker = GetRadSpell('<%= telSpellChecker.ClientID %>');

     

     

     

    spellChecker.startSpellCheck();
    return true;

    But the above code immediately gets back to the parent method irrespective of dialog box closed result.
    Let me know how can i return true only when the RadSpell dialog box has been closed after modification as the server side click event will be followed after this.

     

  14. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 26 Jan 2011 Link to this post

    Hi,

    The RadSpell dialog is not blocking like a browser alert - it will not stop other JavaScript execution while open. This is why we have a client event, which is fired when the dialog is closed. If you want to perform some action (e.g. make a postback) after spellchecking, you should use the RadSpell OnClientCheckFinished property to set the event. For more information, see the following RadSpell demo - http://demos.telerik.com/aspnet-ajax/spell/examples/clientsideevents/defaultcs.aspx

    All the best,
    Lini
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017