Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Issues in Customization in VF for userdefined classes
PD007
Hi,
I am adding custom drop down in VF like
1)classLowerFont
2)classMiddleFont
3)classUpperFont
currently if i click on 1st drop down item(classLowerFont), the proper code with Span tag is appearing like
"span class="Lowertext">Widgets Inc/span>"
This is working proper
but Problem is "Widgets Inc" Text is hard coded in JS. i want to do or apply style for selected text.
eWebEditProExecCommandHandlers["companyinfo"] = function(sEditorName, strCmdName, strTextData, lData) {
if ("classLowerFont" == strTextData)
{
eWebEditPro.instances[sEditorName].editor.pasteHTML("
Widgets, Inc
");
alert("in Lower");
}
else if ("classMiddleFont" == strTextData)
{
eWebEditPro.instances[sEditorName].editor.pasteHTML("
1 Main Street, New York, New York
");
alert("in middle");
}
else if ("classUpperFont" == strTextData)
{
eWebEditPro.instances[sEditorName].editor.pasteHTML("
1-800-111-2222
");
alert("in Upper");
}
}
I already define classes in css. this is also working fine.
I want to capture selected text(highlited) by user to apply style.
Could any one please provide me that line can get selected html text from VF?
Find more posts tagged with
Comments
PD007
Please reply someone
ISCBorisB
Please reply someone
String getSelectedText() and
String getSelectedHTML()
PD007
Thank you ISCBorisB, its working and here i am pasting code for others reference..
Thank you once again.
eWebEditProExecCommandHandlers["companyinfo"] = function(sEditorName, strCmdName, strTextData, lData) {
if ("classLowerFont" == strTextData)
{
var ret = eWebEditPro.instances[sEditorName].editor.getSelectedText();
alert("ret:"+ret);
eWebEditPro.instances[sEditorName].editor.pasteHTML("
"+ret+"
");
alert("in Lower");
}
else if ("classMiddleFont" == strTextData)
{
var ret = eWebEditPro.instances[sEditorName].editor.getSelectedText();
alert("ret:"+ret);
eWebEditPro.instances[sEditorName].editor.pasteHTML("
"+ret+"
");
alert("in middle");
}
else if ("classUpperFont" == strTextData)
{
var ret = eWebEditPro.instances[sEditorName].editor.getSelectedText();
alert("ret:"+ret);
eWebEditPro.instances[sEditorName].editor.pasteHTML("
"+ret+"
");
alert("in Upper");
}
}