iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
I am evaluating the WebTextEditor and would like to know if this scenario can be accomplished with it.
If possible steps 3 and 4 would be done programatically by the WebTextEditor and the process would be invisible to the user. They would complete the form in step 2, click a button, and steps 3 and 4 would take place in the background.
Thnank you very much,
Randy
Unfortunately, our WebTextEditor could only save to or open HTML file for now.
Showing merged template document is achievable using a workaround, normally you will need to display the preview section in order to display the merge document. Here is the snippet, you will need to implement the Initialize client side event handler:
function WebTextEditor_OnInitialize(controlId){ var WebTextEditor = ISGetObject(controlId); WebTextEditor.SwitchToPreview(); setTimeout(function () { var previewText = WebTextEditor.GetPreviewIFrameElement().contentWindow.document.body.innerHTML; WebTextEditor.SwitchToDesignView(); WebTextEditor.SetValue(previewText); WebTextEditor.GetPreviewTabElement().style.display = "none"; var hiddenToolBar = ["cmdInsertLabel", "cmdPreview", "cmdSendMail", "cmdSeparator4", "cmdSeparator5"]; for (var i = 0; i < hiddenToolBar.length; i++) { var toolbarElem = document.getElementById(WebTextEditor.ToolBar[1].Name + "_" + hiddenToolBar[i]); toolbarElem.style.display = "none"; } }, 150);}
The snippet will move the preview text from the preview to design view. Afterward it will hide the mail merge toolbar and preview tab. I am using the MailMerge_CustomCollection provided sample in order to test my snippet
I tried this code on both provided mailmerge samples; but it does not seem to work as intended. Only the preview tab in the bottom bar of the editor disappears (
WebTextEditor.GetPreviewTabElement().style.display = "none";
). Nothing else happens: the merged data does not transfer to the design view, and the editor does not switch from preview to design view; the mail merge toolbar remains visible; the design view toolbars do not show. I initialized as follows:
<ClientSideEvents OnInitialize="WebTextEditor_OnInitialize" />
Regards
Jean
Re-testing the workaround in the latest build of WebTextEditor, I encounter the same issue. Based on on my discussion with the developer, the snippet must be modified to work in the latest build of WebTextEditor, here is the modified snippet:
function WebTextEditor_OnInitialize(controlId) { var WebTextEditor = ISGetObject(controlId); setTimeout(function () { WebTextEditor.SwitchToPreview(); setTimeout(function () { var previewText = WebTextEditor.GetPreviewIFrameElement().contentWindow.document.body.innerHTML; WebTextEditor.SwitchToDesignView(true); WebTextEditor.SetValue(previewText); WebTextEditor.GetPreviewTabElement().style.display = "none"; var hiddenToolBar = ["cmdInsertLabel", "cmdPreview", "cmdSendMail", "cmdSeparator4", "cmdSeparator5"]; for (var i = 0; i < hiddenToolBar.length; i++) { var toolbarElem = document.getElementById(WebTextEditor.ToolBar[1].Name + "_" + hiddenToolBar[i]); toolbarElem.style.display = "none"; } }, 500); },500);}
You will need to set another delay before invoking the SwitchToPreview method.
Thanks. Works beautifully.
Glad it could help solve your issue. However our developer also has an alternative snippet without using nested timeout. Here is the alternative snippet:
function WebTextEditor_OnInitialize(controlId) { var WebTextEditor = ISGetObject(controlId); WebTextEditor.SwitchToPreview(); setTimeout(function () { var previewText = WebTextEditor.GetPreviewIFrameElement().contentWindow.document.body.innerHTML; var el = WebTextEditor.GetDesignViewTabElement(); el.attributes["isactive"].value = "false"; WebTextEditor.SwitchToDesignView(true); WebTextEditor.SetValue(previewText); WebTextEditor.GetPreviewTabElement().style.display = "none"; var hiddenToolBar = ["cmdInsertLabel", "cmdPreview", "cmdSendMail", "cmdSeparator4", "cmdSeparator5"]; for (var i = 0; i < hiddenToolBar.length; i++) { var toolbarElem = document.getElementById(WebTextEditor.ToolBar[1].Name + "_" + hiddenToolBar[i]); toolbarElem.style.display = "none"; } }, 500);}
Thanks. I like this latest version even better.
I need to use this snippet in a scenario that requires loading new documents in the editor on the fly, with a click on something. This works perfectly using WebButton, but in FullPostBack. Is there a way, using any controls (WebButton, WebToolBar, or WebListBox), to do this in FlyPostBack as well?
Using one of your provided mailmerge samples, I have tried the following, with no success:
C#
protected void WebButton1_Clicked(object sender, ISNet.WebUI.WebDesktop.WebButtonClickedEventArgs e)
{
if (WebButton1.IsFlyPostBack)
WebTextEditor.LoadContentFromFile(server.MapPath(./SampleHtml/Invitation.html"), true);
WebButton1.ClientAction.RefreshModifiedControls();
}
ASPX
<ISWebDesktop:Button ID="WebButton1" runat="server" height="20px" Text="Web Button" Width="100px" AutoPostback="true" OnClicked="WebButton1_Clicked">
<ISWebDesktop:WebButton>
Never mind. I got this working beautifully with WebFlyPostBackManager.
Thanks
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname