Bob,
The point is to separate the model and view and automatically update
the view(s) when the model changes (perhaps in response to a server
call). Hence the binding. The bindable variable would be in a separate
ActionScript class. In the bug report, I just made it a local
variable for simplicity.
Feel free to vote for the bug, anyone.
On Jan 29, 2008 9:51 PM, bobignacio <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
> Hi there,
>
> Snippet of your code...
>
> [Bindable]
> public var contents:String = "";
>
> private function handleChange(event:Event): void {
>
> contents = editor.htmlText;
>
> // My Debug
> trace("Change Fired and Caught");
> trace("Contents: " + contents);
> trace("Editor Updated: " + editor.htmlText + "\n");
> }
>
> Change the following:
>
> <mx:RichTextEditor id="editor" htmlText="{contents}"
> change="handleChange(event)"/>
>
> to this:
>
> <mx:RichTextEditor id="editor" change="handleChange(event)" />
>
> This resolves your issue that you mention.
> If you follow the debug with your original code for the editor,
> you will find that since you have the "htmlText" attribute in the
> editor set to your Bindable variable "contents" you are unnecessarily
> updating the editor's "htmlText." This is causing your issue.
>
> With every keystroke, the editor is already updating
> its htmlText automatically so the Bindable "contents" is
> probably clobbering your editor's automated update.
>
> Hope this helps,
>
> Bob I.
>
>
>
> --- In [email protected], "Richard Rodseth" <[EMAIL PROTECTED]>
> wrote:
> >
> > I have a RichTextEditor with htmlText bound to a property in a model. I
> > update the model property on change events.
> > The problem is that if I type to replace text, the formatting is not
> > preserved. i.e. set font to 48, start typing, and the first
> character is in
> > 48, the next one isn't. Or if I have 48 point text selected and type to
> > replace, the new text is not in 48pt.
> >
> > Any ideas?
> >
>
>