Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
VisualFormat
System
Does anyone know:
1) How to determine the current location of the cursor within a piece of text included in a VisualFormat field?
2) How to reproduce the out of the box functionality with VisualFormat where the cursor is positioned within a link, the link edit button is thrn selected and the entire link is automatically highlighted. We have written our own link handler as we have a specific requirement, but have been unable to find how to provide this out of box selection functionality.
Thanking you in advance :-)
Find more posts tagged with
Comments
Bowker
VF uses an object method of .pasteHTML(text) which appears to be a standard object method (I didn't look too far into that) to insert text. That method must know where the insertion point it.
You may be able to do what you want by:
Get the current field value.
Insert something identifiable (like ~we are here!~)
Get the current field value again.
Find where you are in the string
move back to the beginning of the link
call the method to select text (probably something like .selectHTML(start,end), but that's a wild guess)
then do what you need to do.
I don't know if that's even possible, but you could it.
Migrateduser
Thanks for the reply. If there was an API call such as .selectHTML(startpos, length) or similar then what you are suggesting would be possible. It is the lack of such a method that makes this problematic, unless Ektron have some functions squirrelled away that they are not publically advertising. Is it possible to find out from them exactly how they did this as it would significantly improve the functionality we offer to our customer.