Hi All,
There is a requirement to have a RTE component where it is working properly in the interface, But when I open that from the site. RTE Component is refreshing with the key press with the below code.
Can someone suggest a way why it is refreshing with key press in the RTE component?
a!localVariables( local!data: a!refreshVariable( value: a!forEach( items: ri!qmcData, expression: if( search("<html>",fv!item,1)=0, null, fv!item) ), refreshOnReferencedVarChange: false() ), local!emailData: a!refreshVariable( value: reject(fn!isnull(_),index(ri!qmcData,wherecontains(null,local!data),{})), refreshOnReferencedVarChange: false() ), local!linksData: a!refreshVariable( value:tostring(reject(fn!isnull(_),local!data) ), refreshOnReferencedVarChange: false() ), { richTextEditorField( label: "Query Management Links", richTextValue:local!linksData, richTextSaveInto: { local!linksData, a!save(ri!qmcData,append(local!emailData,local!linksData)), a!save( ri!policy.segment, a!forEach( items: ri!policy.segment, expression: if( fv!item.sgmntTypeCde = cons!PAM_TEXT_LIST_POLICY_NAVIGATION_CODE[14], a!update( fv!item, "sgmntText", concat( "<!DOCTYPE html><html><head></head><body><ul>", a!forEach( items: ri!qmcData, expression: concat("<li>", fv!item, "</li> ") ), "</ul></body></html>" ) ), fv!item ) ) ), a!save( ri!segmentToSave, union( append( ri!segmentToSave, cons!PAM_TEXT_LIST_POLICY_NAVIGATION_CODE[14] ), append( ri!segmentToSave, cons!PAM_TEXT_LIST_POLICY_NAVIGATION_CODE[14] ) ) ) } ) })
Thanks in Advance!
Discussion posts and replies are publicly visible
In Appian, the saveInto of a Rich Text Editor (RTE) is triggered with every keystroke, which means any variable saved there gets updated constantly. If you're saving into an input like ri!qmcData, and other local variables depend on it (even through refreshVariable), the whole interface can refresh on every key press. This leads to performance issues and flickering. To prevent this, use a local variable for the RTE, and only save to inputs on form submission. Also, remove refreshVariable if the value doesn't need to auto-update, this keeps the interface stable and clean.
saveInto
ri!qmcData
refreshVariable
Any reason to not use the new Styled Text Editor Component?