Search

What the Quote?

"If a dog eats a cracker in Paris at 4 AM, what time does little Billy fall asleep in New Brunswick?"

Laura Tripcony

"I made a song from your confusion."

Laura Tripcony

"Smell it. Smell it! Smell it!!!"

Scott Hooks

« XPages namepicker using standard typeahead | Main| Another VIEW article about XPages is live »

XPages safety tip - avoid using hyphens in control ID names

Category xpages
Never, EVER use a hyphen in a control ID (i.e. "repeat-SomeCollection").

Comments

Gravatar Image1 - And also make sure that you don't cross the streams! That's bad too! Emoticon

Gravatar Image2 - Sheesh. Could you please just cut to the point? Emoticon

Gravatar Image3 - For those who are a little dense (like me), could you explain why?

Gravatar Image4 - @3 - Actually, he can't. But I assure you that it's very good advice.

Gravatar Image5 - Admittedly, this particular bug probably won't be an issue after the next fixpack, so the "never, ever" part probably should have been "for the time being".

Gravatar Image6 - Had to try it myself to see why and it reverted my servers back to version 5 :)

Gravatar Image7 - Hyphens are bad in any kind of names. Not in variables, or anywhere. Its confusing to see hyphens in someone else's code and I can't see why someone would use it.

Use underscore instead.


Gravatar Image8 - @7 - That's precisely what I recommended to a colleague who came to me for advice after encountering an error message that was so not indicative of the root cause.

You might find it intriguing to know that both Google and Yahoo have HTML elements on their home page that contain a hyphen in the ID attribute. So, while I don't advise it, it does happen... this post was my attempt at a "public service announcement" in the hopes that it would spare others some avoidable confusion.

P.S. You forgot to enter your name... I nearly deleted your comment before I noticed it wasn't spam.

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)