RichEditableText textFlow attribute not updating properly

Was having an issue with the RET component as described in the adobe form:
textFlow (RichEditableText) not updating properly

I had created a popup window to display Bibliography references and it was not always updating when new text was injected into the textflow attribute. The view would refresh if I clicked on the text area. Based on the information in the adobe forum, I changed the initial component implementation:

<s:RichEditableText id="biblioInfo"
						textFlow="{TextConverter.importToFlow(pageInfo, TextConverter.TEXT_FIELD_HTML_FORMAT)}"
						width="100%"
						paragraphStartIndent="10"
						paragraphEndIndent="10"
						editable="false"
						selectable="true"
						/>

to the following:

<s:RichEditableText id="biblioInfo"
						textFlow="{updateFlow(pageInfo)}"
						width="100%"
						paragraphStartIndent="10"
						paragraphEndIndent="10"
						editable="false"
						selectable="true"/>

Where updateFlow was a function which was defined in the script section of the mxml file in the following manner:

private function updateFlow(clip:String):TextFlow {
				
		if (this.biblioInfo){
			this.biblioInfo.textFlow = null;
			this.biblioInfo.validateNow();
		}
				
		//  Converts html text into a TextFlow
		var flow:TextFlow = TextConverter.importToFlow(clip, TextConverter.TEXT_FIELD_HTML_FORMAT);
				
		return flow;
	}

I found this approach solved the refresh problem for my RichEditableText component.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: