You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Werner Punz <we...@gmx.at> on 2005/06/01 01:33:16 UTC

Re: spell checker with javascript

A vague one, check your code for subviews form names etc...
jsf plugs together the ids by combining all those parent elements
with a ':' in between, you might have missed one of those ids in your
control name you try to access.
that line looks like a possible candidate for having this problem:
  'forms[0].elements[\'frmClassNotes:language\']'



Srikanth Madarapu wrote:
> Hi
> 
>   Seems like this is related to javascript.  I have a spellchecker which works fine with struts with the following code.
> 
>  
> 	<a href="javascript:doSpell(this,
> 					'forms[0].language',
> 					'forms[0].elements[\'<%="comment" + studentGradeInd + "_" + gradingMetaInd%>\']',
> 					true,
> 					'<%= acct.getWebUserNo() %>',
> 					'');">
> 		<img src="xde/spellcheck.gif" border="0">
> 	</a> 
> 
> When I put the same piece of code (pasted below, not exactly same..) with in a verbatim tab in a JSF page I get javascript error "Object expected" at line 1 char 1.
> 
> <f:verbatim>
>         <a href="javascript:doSpell( this, 'forms[0].elements[\'frmClassNotes:language\']',
>                                               'forms[0].elements[\'frmClassNotes:classNote\']', true, '132', '');" >
>                 Spell Check
>         </a>
> </f:verbatim>
> 
> Any ideas why?
> 
> Thanks in advance.
> -Srikanth Madarapu
> 


Re: spell checker with javascript

Posted by Sean Schofield <se...@gmail.com>.
Yes first step is to check you html and make sure the ids are what you
expected them to be.  JSF can wreak havoc on those.  You may have to
use 'forceId' to fix the problem.

sean

On 5/31/05, Werner Punz <we...@gmx.at> wrote:
> A vague one, check your code for subviews form names etc...
> jsf plugs together the ids by combining all those parent elements
> with a ':' in between, you might have missed one of those ids in your
> control name you try to access.
> that line looks like a possible candidate for having this problem:
>   'forms[0].elements[\'frmClassNotes:language\']'
> 
> 
> 
> Srikanth Madarapu wrote:
> > Hi
> >
> >   Seems like this is related to javascript.  I have a spellchecker which works fine with struts with the following code.
> >
> >
> >       <a href="javascript:doSpell(this,
> >                                       'forms[0].language',
> >                                       'forms[0].elements[\'<%="comment" + studentGradeInd + "_" + gradingMetaInd%>\']',
> >                                       true,
> >                                       '<%= acct.getWebUserNo() %>',
> >                                       '');">
> >               <img src="xde/spellcheck.gif" border="0">
> >       </a>
> >
> > When I put the same piece of code (pasted below, not exactly same..) with in a verbatim tab in a JSF page I get javascript error "Object expected" at line 1 char 1.
> >
> > <f:verbatim>
> >         <a href="javascript:doSpell( this, 'forms[0].elements[\'frmClassNotes:language\']',
> >                                               'forms[0].elements[\'frmClassNotes:classNote\']', true, '132', '');" >
> >                 Spell Check
> >         </a>
> > </f:verbatim>
> >
> > Any ideas why?
> >
> > Thanks in advance.
> > -Srikanth Madarapu
> >
> 
>