is there a quick way to truncate long texts displayed in h:selectOneMenu without having to code it from scratsh. what i'd like to acheive is truncating long text , and add a tooltip to display the whole text.
thanks
You can create a utility function which will be used for truncation of long text. Example:
function shortText(String data,int length){
return data.subString(0,length);
}
Now, instead of showing the value directly, pass the value and the length to this function, and use the return value on the UI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With