-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I need your help ... I need to select text by code, ie make a kind of shadow on a text.
For example: If my text is "acetaminofen" and I want to select only a portion of it for shade, "Acet".
Greatly appreciate your help!
Hi!!
This solution work perfect!.... Thank's so much!.
Here I post my code!.. I hope help anybody..
Code before..................................................................
setSelectedIndex(pos);
getItemAtIndex(pos).setSelected(true);
Map mapa = getItemAtIndexApi(pos).getAttributes();
for (Iterator it = mapa.keySet().iterator(); it.hasNext();) {
Object key = (Object) it.next();
if (key.toString().equalsIgnoreCase("zkplus.databind.TEMPLATEMAP")) {
Map mapaAux = (Map) mapa.get("zkplus.databind.TEMPLATEMAP");
for (Iterator itAux = mapaAux.keySet().iterator(); itAux.hasNext();) {
Object keyAux = (Object) itAux.next();
if (keyAux.toString().equalsIgnoreCase("<Textbox txtDescripcionP>")) {
Textbox txtDesc = (Textbox)mapaAux.get(keyAux);
txtDesc.setSelectionRange(0, txtDesc.getValue().length());
}
}
}
}
.....................................Code after
PD: (Sorry my english is so bad.. I'm from Lara-Venezuela)
Hi ~~
Maybe you need write client side javascript code, get input dom node, and use "selectionStart", "selectionEnd" to get text
link
No, seems that is a kind of javaScript functionality that you need.
Be patient, somebody will helps you. If not after two days. write a push!
Please put next time both languages in one thread.
Asked: 2009-12-03 14:21:15 +0800
Seen: 391 times
Last updated: Dec 04 '09