Closed ahenket closed 9 years ago
Currently, the component doesn't support ref
pointing to a string. As a workaround, you can use xxf:element('e', xxf:serialize(.,'xml'))
. Also, I'd use the xml
rather than html
serialization, otherwise you might missing end tags for elements where end tags are not allowed in HTML. You'll let us know if this works for you.
37dc132 solves the issue, closing.
Yes! This works: <fr:code-mirror ref="xxf:element('e', replace(xxforms:serialize(.,'html'),'(^<example[^>]>\s)|(\s*</example>$)',''))"/>
My code is wrapped inside an <example/> element that I cannot unwrap before serializing because it might be a series of nodes, so I remove those start/end tags after serialization.
Excellent, and thank you for confirming!
On Thu, Jul 2, 2015 at 12:59 PM, Alexander Henket notifications@github.com wrote:
Yes! This works:
— Reply to this email directly or view it on GitHub https://github.com/orbeon/orbeon-forms/issues/2280#issuecomment-118150702 .
I've been asked to produce a reproduction page for a code-mirror initialization problem. The problem I'm trying to demonstrate in a toned down version of the pages we have is that when you replace the contents of an instance that code-mirror reads from, it does not update it's contents in the page. Only a page refresh/load seems to trigger code-mirror. However: in creating the page I keep running into another problem I cannot get past. From the orbeon.log:
Since I'm not doing anything with readonly, I'm assuming a bug somewhere else. I have no reason to believe the page below has any trouble like that.
Anyway to cut this short: I believe the page below will demonstrate my code-mirror problem but I cannot verify that because of ... well another code-mirror problem. Deactivate the fr:code-mirror line and activate the xf:output line below it to see how it should have worked.