> Hello,
>
[quoted text clipped - 32 lines]
> (it adds the form name and semicolon). Therefore I can't seem to
> reference it properly...
that's correct. That's how JSF does it. It follows the entire component
hierarchy down to your component, adding, for each component on the
path, the component name and a semicolon
> What am I doing wrong? Is there another, more "JSF-ish" way to do this?
You can just change the id in your javascript call, using the convention
that JSF uses. What I'm not sure about is if the separator will always
be a semicolon.
A more JSF-ish way would probably be to make your own component, and
generate your script in the render phase. I'm not sure it's worth it
Chris Smith - 02 Dec 2005 16:00 GMT
> You can just change the id in your javascript call, using the convention
> that JSF uses. What I'm not sure about is if the separator will always
> be a semicolon.
In fact, it will NEVER be the semicolon. I'm very confused that you and
Erik both seem to see the semicolon used, but that's not in accordance
with the JSF specification. Section 3.2.3 requires that this delimiter
be a colon, not a semicolon. Perhaps there's a major third-party JSF
implementation that I haven't tried which doesn't comply. MyFaces,
perhaps?
So the spec says you ought to be safe... but obviously your use of a
non-compliant JSF implementation negates that guarantee.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Andrea Desole - 02 Dec 2005 16:09 GMT
> In fact, it will NEVER be the semicolon. I'm very confused that you and
> Erik both seem to see the semicolon used, but that's not in accordance
> with the JSF specification. Section 3.2.3 requires that this delimiter
> be a colon, not a semicolon. Perhaps there's a major third-party JSF
> implementation that I haven't tried which doesn't comply. MyFaces,
> perhaps?
sorry, my bad English :-(.
Yes, I meant colon. I assume Erik made the same mistake
swe_dev1 - 05 Dec 2005 07:59 GMT
Chris & Andrea,
You are of course right, it is a colon and nothing else...
However, this still poses a problem since the reference
onchange="menuSelect(this,document.forms.searchform1:county);"
or any other reference with a colon gives an error, and a strange one
too: it says that ")" is missing. I simply assume that component
references can only be made with dot:s (.)
Any ideas?
/Erik
Andrea Desole skrev:
> > In fact, it will NEVER be the semicolon. I'm very confused that you and
> > Erik both seem to see the semicolon used, but that's not in accordance
[quoted text clipped - 5 lines]
> sorry, my bad English :-(.
> Yes, I meant colon. I assume Erik made the same mistake
Andrea Desole - 05 Dec 2005 09:11 GMT
> Chris & Andrea,
>
[quoted text clipped - 9 lines]
>
> Any ideas?
I'm not a javascript expert, but you are probably doing something wrong.
Colons must work, otherwise JSF wouldn't be able to write its own scripts.
Also, looking at your javascript, I think you are directly referencing
the component, without referencing the form. Try
document.forms.searchform1.searchform1:county
or try to use the syntax that JSF uses for the command link:
document.forms['searchform1']['searchform1:county']
Or, even better, ask the javascript newsgroup :-)
swe_dev1 - 05 Dec 2005 14:32 GMT
Andrea,
The follwong worked:
document.forms['searchform1'].elements['searchform1:county']
Thanks for your help!
/Erik