I tried to give a ListBox validation. The standardways over “AllProperties” “validator” does not work in my application.So i tried to handle this with an Clientside javascript and discovered the following:
I entered javascript to the "onchange"client-event in the listbox. For testing the script I got this picture in the IE.
The Richtextfield is limited to one sign. And the refresh of the field “subcategory” does not work anymore.
Code in the web:
RICHTEXT
(Equal to the correct representation)
LISTBOX
(Equal to the correct representation)
SCRIPTING
new ibm.domino.widget.layout.DominoRichText({}, 'view:_id1:_id25:inputRichText1').initForEdit();
function view__id1__id25__id30_clientSide_onchange(thisEvent) {
var sc = document1.getItemValue("cmbKategorie")
var bool = "false";
if (sc =="" || sc =="<Bitte eine Kategorie auswählen>") bool = false else bool = false;
if (bool) alert("fehler") else alert("alles gut")
}
............
new ibm.domino.widget.layout.DominoRichText({}, 'view:_id1:_id25:inputRichText1').initForEdit();
.....
Code in the XPage:
CSS:
out of oneUI
Can anyone tell me, what happens here?
Im sure, that the script is not correct, but it should not have this effect.
When I remove the script, the representation ist correct again.
Thank you
Wolfgang
Subject: Is your client side script correctly formatted?
Hi,I think I’m able to reproduce this issue, and fix it.
When I tried your source, the Rich Text Editor (RTE) didn’t display. Is that what you’re seeing?
I then changed…
var sc = document1.getItemValue(“cmbKategorie”)
var bool = “false”;
if (sc ==“” || sc ==“<Bitte eine Kategorie auswählen>”) bool=false else bool=true;
if (bool) alert(“fehler”) else alert(“alles gut”)
…to…
var sc = document1.getItemValue(“cmbKategorie”)
var bool = “false”;
if (sc ==“” || sc ==“<Bitte eine Kategorie auswählen>”)
bool=false
else bool=true;
if (bool)
alert(“fehler”)
else alert(“alles gut”)
…and it worked.
But I don’t know why putting page returns after ‘sc ==“<Bitte eine Kategorie auswählen>”)’, ‘bool=false’, ‘if (bool)’, and ‘alert(“fehler”)’ might make things work?!
So could there be something amiss from the formatting?