FreeTextBox tabs are not preserved at postback - richtextbox

We are using the FreeTextBox 3.1.6 on an intranet. The control appears on an ASP.Net project built in Visual Studio 2008.
When clients enter tabs in the text box, those tabs do not get preserved at postback. Rather, the tabs are lost. Other text formatting, like bold, italics, or font size are preserved.
Even when the postback event that occurs on the web page does not save anything to a database we are loosing the tabs. According to http://wiki.freetextbox.com/default.aspx/FreeTextBoxWiki.Installation the JavaScript and XML used by FreeTextBox are stored in a dll. So I cannot edit the contents of those files.
Has anyone encountered this issue with FreeTextBox? If so, how did you resolve it?
Here is the behavior that occurs. Enter text with tabs in the FreeTextBox control.
alt text http://img132.imageshack.us/img132/4826/ftb1postcz4.gif
Then select the "Save" button. This is a command button that posts back the page. In my test scenario nothing gets saved and loaded from a database. The FreeTextBox control is strictly displaying text that was posted. My guess is that the mechanism handling that is in ViewState, but I'm not sure about that.
alt text http://img132.imageshack.us/img132/175/ftb2postbd6.gif
As you can see, all of the tabs are gone. Even the tabs inserted between words are gone.
Thanks for your help.
Ken

Setting TabMode to "InsertSpaces" did not resolve this. My source code for instantiating the control is below. Pictures I posted didn't previously show up. Visit these links to see them.
http://img132.imageshack.us/img132/4826/ftb1postcz4.gif
http://img132.imageshack.us/img132/175/ftb2postbd6.gif

<FTB:FREETEXTBOX id="txtDocument" EnableHtmlMode="False" Width="100%" runat="server" AllowHtmlMode="True"
StripAllScripting="True" Height="400px" FormatHtmlTagsToXhtml="False"
AutoGenerateToolbarsFromString="true"
ToolbarLayout="ParagraphMenu, FontFacesMenu, FontSizesMenu, FontForeColorsMenu, FontForeColorPicker| Bold, Italic, Underline, Strikethrough; Superscript, Subscript, RemoveFormat| JustifyLeft, JustifyRight, JustifyCenter, JustifyFull; BulletedList, NumberedList, Indent, Outdent; CreateLink, Unlink, InsertImage, InsertRule| Cut, Copy, Paste; Undo, Redo, Print"
TabMode="InsertSpaces"
>

I found the answer. The original programmer had code that intercepted the contents of the textbox when it was submitted. That code reformatted the text for special currency characters like the Yen, Euro, and Pound.
Here is what the code looked like.
Dim hstrg As String = txtDocument.Text
Dim f As New FreeTextBoxControls.Support.Formatter
hstrg = f.HtmlToXhtml(hstrg)
What fixed the issue was commenting out that HtmlToXhtml() method. We don't need the contents to be Xhtml compatible, so this was a viable option for us.

i've been using free text box in some of my former development, but it had some quirks and wouldn't work right in IE.
try moving to FCKEditor, or TinyMCE. they seem like much better experience than FTB. i've chosen FCK, and i think WordPress uses TinyMCE. try them if a switch of editor is an option.

Related

Infopath 2010 TextArea not wrapping text, browser view source reveals "white-space: pre"

I have a strange problem with InfoPath 2010. It seems that when using a text with multiline the default formatting will be "white-space: pre" which prevents the text to break at the end of the field. It will only break if enter is manually pressed.
In my case, this is not acceptable. I do not know if it is possible to attache any CSS with my form. This would of course solve my problem.
Any other ideas that could help me crack this one?
Well, I had to solve this quickly so I had to do it the "ugly" way... I opened the xsl-files that had the problem and added the following code:
<style>
textarea{
white-space: normal !important;
}
</style>
Then I right-clicked on my "manifest.xsf", selected "design" and published... And voilĂ !
Let's hope the form won't break later due to those changes. (Hint: Always back up your code before doing changes to the source-files in InfoPath)...
You can open view*.xsl from this form package and replace current control css from "WHITE-SPACE: NORMAL" to "WHITE-SPACE: pre-line !important;".
In this way you don't need add any css file and it works fine for O365 as well.
Only small issues: then you edit form in the Infopath designer this textaria doesn't look pretty but it only on designer.

Orbeon changed behavior for xforms:alert / xforms:h3lp

[Stackoverflow disallows the word help in the title. Hence the h3lp]
We are in the proces of moving our code from Orbeon 3.9 to Orbeon 4.x. One of the many things that changed is the behavior for display of xforms:alert and xforms:help. Example code:
<xforms:input ref="#code">
<xforms:alert ref="$resources/required-field"/>
<xforms:help ref="$helptext"/>
</xforms:input>
In Orbeon 3.9 the alert is displayed as a red img with a white exclamation mark that has the text as tooltip, only if the binding fails. The help is displayed as a blue-ish image with a question that activated a tiny pseudo window containing the (potentially large) help text.
In Orbeon 4.7 the alert text is displayed as-is, no image and no condition based on binding. This interferes with a carefully designed interface as it takes up a lot more space. The help text is not displayed at all because .xforms-help has display: none;. Overriding that doesn't work because the text would then just be displayed inline.
I could not find documentation for these changes. Does anyone know the rationale and how to make "alert" and "help" useful yet again?
There are two changes with Orbeon Forms 4.x which might be relevant to this:
The HTML layout of elements has changed a bit. This means existing CSS might have to be adapted. You can check this by comparing the HTML produced by 3.9 vs. 4.x for a given page. With 4.x, all form elements, for example, are wrapped within a <span> or <div> element.
Form Runner uses Twitter Bootstrap as a CSS library. But the Bootstrap CSS files are also included for non-Form Runner pages.
This said, "red icon" alerts should still work, see for example the good old Espresso Order or Bookcast demos.
If you see alerts inline and unconditionally, it means that somehow the proper CSS doesn't apply, either because of the HTML layout change mentioned above, or because some CSS files are missing.
Look at this post : http://blog.orbeon.com/2014/01/improving-how-we-show-help-messages.html
and this : http://discuss.orbeon.com/how-to-use-the-quot-new-quot-xforms-help-in-4-5-td4658348.html
julien

Is there a way to get Sublime Text 2 to autocomplete HTML attributes?

I was wondering if there is a way to get Sublime Text 2 to autocomplete HTML attributes like in Aptana?
Autocomplete is enabled by default when you use "<" and your tag and then hit enter. So if you enter <p and then hit enter it will finish out the tag pair for you... where you will end up with <p></p> and your cursor will be in the middle. You can change this to tab if you prefer by pasting the following into your Preferences -> Settings - User file:
{
"auto_complete_commit_on_tab": true
}
This will override the default value of false for completion on tab. Again that is only if you wish to use tab instead of enter.
Hey you may try https://github.com/agibsonsw/HTMLAttributes or install trought package control package called "HTMLAttributes" ;). Its works for me. For example you type:
<p then press space bar then ctrl+space and you got list of attributes.
You can try to use emmet package. It was made specifically for html&css code completion. For more information you should read the documentation.
I was having the same issue; although I use both plugin packages HTMLAttributes and Emmet, neither one provides the auto-complete functionality I was looking for that's similar to Dreamweaver's.
Solution: I found a package called SublimeCodeIntel that does exactly what I needed.
Example: I code html emails and do a lot of inline CSS. End goal:
<td style="vertical-align:top;">
After installing SublimeCodeIntel, I typed <td style="v and a list of CSS properties starting with "v" displays.
Using my arrow keys, I select vertical-align and press tab to confirm, then type the letter "t" and a list of CSS values now displays.
I select top and then press tab to again confirm my selection.
Note: You can create predefined snippets for Emmet for undefined CSS properties but I wanted something "out of the box" instead of having to a) learn how to create them via the documentation (though I'm sure it's simple), and b) create a snippet each time I came across an undefined CSS property/value like vertical-align.
Hope this helps.

how to drag a text string and its hyperlink from an HTML page to a TEdit

I hope to to drag a text string and its hyperlink from an HTML page to a TEdit.
For example
displays aaa
actual string is <a href=somewhere.html>aaa</a>
I try to use drag&drop vcl, but found that it only can catch aaa itself rather than the string and its hyperlink.
Welcome any comment
Thanks
interdev
Go download Anders Melander's free Drag and Drop Component Suite. In it you'll find TDropURLTarget to put on your form. Set its Target property to refer to your TEdit control, and when a URL is dropped there, the component's URL and Title properties will be updated so you can inspect them during the OnDrop event handler. The suite comes with several examples; TargetDemo has the basics.
Another good library is Raize DropMaster.
Anyway, I believe that it IS possible to do what you want, but maybe it'll turn out to be HTML or RTF drag/drop? Hard to say. I can, for example, drag/drop the list of hyperlinks on this page (over there to the right, under "RELATED") into Word, and they all show up, with hyperlinks on board.
So it IS possible. But I suspect that WinWord is dropping as HTML.
Anyway, Rob's suggestion of looking at examples is a good one - between that library and Raize, you should find something that you can use as a prototype.

How to blank out a field in an MVC app using TinyMCE

I've got an MVC app that gives the user textarea's to update some description fields. It's strongly-typed to a table object, and the fields are wrapped in a form with a Submit button.
Occaisionally they don't want any data in a field, but when they delete the text and try to save, the blanked-out field comes back with its original text (i.e. the table object passed to the Save action contains other edits, but attempts to blank out fields result in the original text staying in the field).
I'm assuming this is LINQ trying to determine which fields have been edited, but how do you tell it that it's blank on purpose?
UPDATE: It appears this may be a problem with the TinyMCE jQuery plugin. It adds rich-text functionality to textarea controls. If I turn it off, I can remove text with no problems.
UPDATE 2: It seems to be some kind of javascript bug or something. If I put another dummy field after the problem fields, they work. If I move them to another place in my code, they work. They just don't want to work where they are. Very peculiar.
I'm pretty sure that TinyMCE, by default, puts in <p></p> when the control is emptied.
So if you are checking for "" then you may be disapointed.
This initially caused me some issues but never with saving. I was checking if the field was "" and then doing something else. Once I realised that "" was never going to happen, I adapted my validation accordingly.
I just check that on a recent project using TinyMCE editor, but it indeed send "" for an empty input, and during the implementation we had no issues with that.
alt text http://diarioplus.com/files/pictures/tiny.PNG
The body property is the one with a tinyMCE editor on the client side.
I really think it will be something with the modelBinder or the way you set the values back to the model.

Resources