rich text editor in xf:repeat

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

rich text editor in xf:repeat

David Voňka
Hello,

the yui rich text editor does not seem to work correctly when inserted
dynamically into a xf:repeat block.

Example:
-------------

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xf="http://www.w3.org/2002/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
      xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      lang="en">
    <head>
        <xf:model id="data-model">
            <xf:instance id="texty">
                <data xmlns="">
                    <text>hi</text>
                    <text>hello</text>
                </data>
            </xf:instance>
        </xf:model>
    </head>
    <body>
        <xf:trigger>
            <xf:label>New</xf:label>
            <xf:insert ev:event="DOMActivate"
                       nodeset="instance('texty')/text"
                       at="index('rte-repeat')"
                       position="after"/>
        </xf:trigger>
        <ul>
            <xf:repeat nodeset="instance('texty')/text" id="rte-repeat">
                <li>
                    <xf:textarea ref="." style="width:600px"
mediatype="text/html">
                        <xf:label>Rich Text</xf:label>
                    </xf:textarea>
                </li>
            </xf:repeat>
        </ul>
        <widget:xforms-instance-inspector
xmlns:widget="http://orbeon.org/oxf/xml/widget"/>
    </body>
</html>

The two pre-existing editors work ok. But if you add one by pressing
the "new" button, someting goes wrong.
In our application, where Orbeon is used as filter, a client-side
javascript error is triggered:
this._getDoc().body is undefined
[Break on this error]
}else{R=this._getDoc().body;}}if(R){F=M(...gi,'<span
style="font-weight: bold;"');\n

In Orbeon sandbox, there is no error, but the added field is no
richtext, just a simple text area.

Everything works well for plain textareas, ie if you remove the
mediatype attribute.

Do I do anything wrong or is this a bug ?

Thanks in advance for any inputs,

Regards,
David Vonka


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: rich text editor in xf:repeat

Jeremiah Jahn-4
it's not just you. I think it must be a bug.

I haven't checked the latest nightly build yet, have you?


On Jan 27, 2010, at 1:48 PM, David Voňka wrote:

> Hello,
>
> the yui rich text editor does not seem to work correctly when inserted
> dynamically into a xf:repeat block.
>
> Example:
> -------------
>
> <html xmlns="http://www.w3.org/1999/xhtml"
>      xmlns:xf="http://www.w3.org/2002/xforms"
>      xmlns:ev="http://www.w3.org/2001/xml-events"
>      xmlns:xs="http://www.w3.org/2001/XMLSchema"
>      xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
>      xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>      lang="en">
>    <head>
>        <xf:model id="data-model">
>            <xf:instance id="texty">
>                <data xmlns="">
>                    <text>hi</text>
>                    <text>hello</text>
>                </data>
>            </xf:instance>
>        </xf:model>
>    </head>
>    <body>
>        <xf:trigger>
>            <xf:label>New</xf:label>
>            <xf:insert ev:event="DOMActivate"
>                       nodeset="instance('texty')/text"
>                       at="index('rte-repeat')"
>                       position="after"/>
>        </xf:trigger>
>        <ul>
>            <xf:repeat nodeset="instance('texty')/text" id="rte-repeat">
>                <li>
>                    <xf:textarea ref="." style="width:600px"
> mediatype="text/html">
>                        <xf:label>Rich Text</xf:label>
>                    </xf:textarea>
>                </li>
>            </xf:repeat>
>        </ul>
>        <widget:xforms-instance-inspector
> xmlns:widget="http://orbeon.org/oxf/xml/widget"/>
>    </body>
> </html>
>
> The two pre-existing editors work ok. But if you add one by pressing
> the "new" button, someting goes wrong.
> In our application, where Orbeon is used as filter, a client-side
> javascript error is triggered:
> this._getDoc().body is undefined
> [Break on this error]
> }else{R=this._getDoc().body;}}if(R){F=M(...gi,'<span
> style="font-weight: bold;"');\n
>
> In Orbeon sandbox, there is no error, but the added field is no
> richtext, just a simple text area.
>
> Everything works well for plain textareas, ie if you remove the
> mediatype attribute.
>
> Do I do anything wrong or is this a bug ?
>
> Thanks in advance for any inputs,
>
> Regards,
> David Vonka
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: rich text editor in xf:repeat

David Voňka
In reply to this post by David Voňka
With my code we have the issues with 1/25 night build (and with the
stable 3.7.1 version too).
I'll download the really latest thing now and check.

We also need to add more than one RTE.

BTW I don't mind some javascript hacking if neccessary, because our
project deadline is
coming close. Does anyone have an idea about where to look for a fix ?
Somewhere in forms.js ?

Thanks for your help,
David Vonka

2010/1/28 Jeremiah Jahn <[hidden email]>:

> With the 1/26 build the rich text editor no longer crashes things.  I can remove it and add it dynamically. Having issues have more than one added that way though. this code be my code though, as this was just a quick test.
> On Jan 27, 2010, at 1:48 PM, David Voňka wrote:
>
>> Hello,
>>
>> the yui rich text editor does not seem to work correctly when inserted
>> dynamically into a xf:repeat block.
>>
>> Example:
>> -------------
>>
>> <html xmlns="http://www.w3.org/1999/xhtml"
>>      xmlns:xf="http://www.w3.org/2002/xforms"
>>      xmlns:ev="http://www.w3.org/2001/xml-events"
>>      xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>      xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
>>      xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
>>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>      lang="en">
>>    <head>
>>        <xf:model id="data-model">
>>            <xf:instance id="texty">
>>                <data xmlns="">
>>                    <text>hi</text>
>>                    <text>hello</text>
>>                </data>
>>            </xf:instance>
>>        </xf:model>
>>    </head>
>>    <body>
>>        <xf:trigger>
>>            <xf:label>New</xf:label>
>>            <xf:insert ev:event="DOMActivate"
>>                       nodeset="instance('texty')/text"
>>                       at="index('rte-repeat')"
>>                       position="after"/>
>>        </xf:trigger>
>>        <ul>
>>            <xf:repeat nodeset="instance('texty')/text" id="rte-repeat">
>>                <li>
>>                    <xf:textarea ref="." style="width:600px"
>> mediatype="text/html">
>>                        <xf:label>Rich Text</xf:label>
>>                    </xf:textarea>
>>                </li>
>>            </xf:repeat>
>>        </ul>
>>        <widget:xforms-instance-inspector
>> xmlns:widget="http://orbeon.org/oxf/xml/widget"/>
>>    </body>
>> </html>
>>
>> The two pre-existing editors work ok. But if you add one by pressing
>> the "new" button, someting goes wrong.
>> In our application, where Orbeon is used as filter, a client-side
>> javascript error is triggered:
>> this._getDoc().body is undefined
>> [Break on this error]
>> }else{R=this._getDoc().body;}}if(R){F=M(...gi,'<span
>> style="font-weight: bold;"');\n
>>
>> In Orbeon sandbox, there is no error, but the added field is no
>> richtext, just a simple text area.
>>
>> Everything works well for plain textareas, ie if you remove the
>> mediatype attribute.
>>
>> Do I do anything wrong or is this a bug ?
>>
>> Thanks in advance for any inputs,
>>
>> Regards,
>> David Vonka
>>
>> --
>> You receive this message as a subscriber of the [hidden email] mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: rich text editor in xf:repeat

Jeremiah Jahn-4
I was mistaken, this is still happening to me as well, and only when I insert.
On Jan 28, 2010, at 5:38 AM, David Voňka wrote:

> With my code we have the issues with 1/25 night build (and with the
> stable 3.7.1 version too).
> I'll download the really latest thing now and check.
>
> We also need to add more than one RTE.
>
> BTW I don't mind some javascript hacking if neccessary, because our
> project deadline is
> coming close. Does anyone have an idea about where to look for a fix ?
> Somewhere in forms.js ?
>
> Thanks for your help,
> David Vonka
>
> 2010/1/28 Jeremiah Jahn <[hidden email]>:
>> With the 1/26 build the rich text editor no longer crashes things.  I can remove it and add it dynamically. Having issues have more than one added that way though. this code be my code though, as this was just a quick test.
>> On Jan 27, 2010, at 1:48 PM, David Voňka wrote:
>>
>>> Hello,
>>>
>>> the yui rich text editor does not seem to work correctly when inserted
>>> dynamically into a xf:repeat block.
>>>
>>> Example:
>>> -------------
>>>
>>> <html xmlns="http://www.w3.org/1999/xhtml"
>>>      xmlns:xf="http://www.w3.org/2002/xforms"
>>>      xmlns:ev="http://www.w3.org/2001/xml-events"
>>>      xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>      xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
>>>      xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
>>>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>      lang="en">
>>>    <head>
>>>        <xf:model id="data-model">
>>>            <xf:instance id="texty">
>>>                <data xmlns="">
>>>                    <text>hi</text>
>>>                    <text>hello</text>
>>>                </data>
>>>            </xf:instance>
>>>        </xf:model>
>>>    </head>
>>>    <body>
>>>        <xf:trigger>
>>>            <xf:label>New</xf:label>
>>>            <xf:insert ev:event="DOMActivate"
>>>                       nodeset="instance('texty')/text"
>>>                       at="index('rte-repeat')"
>>>                       position="after"/>
>>>        </xf:trigger>
>>>        <ul>
>>>            <xf:repeat nodeset="instance('texty')/text" id="rte-repeat">
>>>                <li>
>>>                    <xf:textarea ref="." style="width:600px"
>>> mediatype="text/html">
>>>                        <xf:label>Rich Text</xf:label>
>>>                    </xf:textarea>
>>>                </li>
>>>            </xf:repeat>
>>>        </ul>
>>>        <widget:xforms-instance-inspector
>>> xmlns:widget="http://orbeon.org/oxf/xml/widget"/>
>>>    </body>
>>> </html>
>>>
>>> The two pre-existing editors work ok. But if you add one by pressing
>>> the "new" button, someting goes wrong.
>>> In our application, where Orbeon is used as filter, a client-side
>>> javascript error is triggered:
>>> this._getDoc().body is undefined
>>> [Break on this error]
>>> }else{R=this._getDoc().body;}}if(R){F=M(...gi,'<span
>>> style="font-weight: bold;"');\n
>>>
>>> In Orbeon sandbox, there is no error, but the added field is no
>>> richtext, just a simple text area.
>>>
>>> Everything works well for plain textareas, ie if you remove the
>>> mediatype attribute.
>>>
>>> Do I do anything wrong or is this a bug ?
>>>
>>> Thanks in advance for any inputs,
>>>
>>> Regards,
>>> David Vonka
>>>
>>> --
>>> You receive this message as a subscriber of the [hidden email] mailing list.
>>> To unsubscribe: mailto:[hidden email]
>>> For general help: mailto:[hidden email]?subject=help
>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email] mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: rich text editor in xf:repeat

Erik Bruchez
Administrator
Jeremiah,

This definitely is a bug. We have a bug here:

http://forge.ow2.org/tracker/index.php?func=detail&aid=313690&group_id=168&atid=350207

There is a related bug here as well:

http://forge.ow2.org/tracker/index.php?func=detail&aid=314608&group_id=168&atid=350207

I think that yes, the key is likely in xforms.js! We have some doc on
how to work with JavaScript in XForms:

http://wiki.orbeon.com/forms/doc/contributor-guide/javascript-development

Please post here if you have any questions.

-Erik

On Sun, Jan 31, 2010 at 6:55 AM, Jeremiah Jahn <[hidden email]> wrote:

> I was mistaken, this is still happening to me as well, and only when I insert.
> On Jan 28, 2010, at 5:38 AM, David Voňka wrote:
>
>> With my code we have the issues with 1/25 night build (and with the
>> stable 3.7.1 version too).
>> I'll download the really latest thing now and check.
>>
>> We also need to add more than one RTE.
>>
>> BTW I don't mind some javascript hacking if neccessary, because our
>> project deadline is
>> coming close. Does anyone have an idea about where to look for a fix ?
>> Somewhere in forms.js ?
>>
>> Thanks for your help,
>> David Vonka
>>
>> 2010/1/28 Jeremiah Jahn <[hidden email]>:
>>> With the 1/26 build the rich text editor no longer crashes things.  I can remove it and add it dynamically. Having issues have more than one added that way though. this code be my code though, as this was just a quick test.
>>> On Jan 27, 2010, at 1:48 PM, David Voňka wrote:
>>>
>>>> Hello,
>>>>
>>>> the yui rich text editor does not seem to work correctly when inserted
>>>> dynamically into a xf:repeat block.
>>>>
>>>> Example:
>>>> -------------
>>>>
>>>> <html xmlns="http://www.w3.org/1999/xhtml"
>>>>      xmlns:xf="http://www.w3.org/2002/xforms"
>>>>      xmlns:ev="http://www.w3.org/2001/xml-events"
>>>>      xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>>      xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
>>>>      xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
>>>>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>>>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>      lang="en">
>>>>    <head>
>>>>        <xf:model id="data-model">
>>>>            <xf:instance id="texty">
>>>>                <data xmlns="">
>>>>                    <text>hi</text>
>>>>                    <text>hello</text>
>>>>                </data>
>>>>            </xf:instance>
>>>>        </xf:model>
>>>>    </head>
>>>>    <body>
>>>>        <xf:trigger>
>>>>            <xf:label>New</xf:label>
>>>>            <xf:insert ev:event="DOMActivate"
>>>>                       nodeset="instance('texty')/text"
>>>>                       at="index('rte-repeat')"
>>>>                       position="after"/>
>>>>        </xf:trigger>
>>>>        <ul>
>>>>            <xf:repeat nodeset="instance('texty')/text" id="rte-repeat">
>>>>                <li>
>>>>                    <xf:textarea ref="." style="width:600px"
>>>> mediatype="text/html">
>>>>                        <xf:label>Rich Text</xf:label>
>>>>                    </xf:textarea>
>>>>                </li>
>>>>            </xf:repeat>
>>>>        </ul>
>>>>        <widget:xforms-instance-inspector
>>>> xmlns:widget="http://orbeon.org/oxf/xml/widget"/>
>>>>    </body>
>>>> </html>
>>>>
>>>> The two pre-existing editors work ok. But if you add one by pressing
>>>> the "new" button, someting goes wrong.
>>>> In our application, where Orbeon is used as filter, a client-side
>>>> javascript error is triggered:
>>>> this._getDoc().body is undefined
>>>> [Break on this error]
>>>> }else{R=this._getDoc().body;}}if(R){F=M(...gi,'<span
>>>> style="font-weight: bold;"');\n
>>>>
>>>> In Orbeon sandbox, there is no error, but the added field is no
>>>> richtext, just a simple text area.
>>>>
>>>> Everything works well for plain textareas, ie if you remove the
>>>> mediatype attribute.
>>>>
>>>> Do I do anything wrong or is this a bug ?
>>>>
>>>> Thanks in advance for any inputs,
>>>>
>>>> Regards,
>>>> David Vonka
>>>>
>>>> --
>>>> You receive this message as a subscriber of the [hidden email] mailing list.
>>>> To unsubscribe: mailto:[hidden email]
>>>> For general help: mailto:[hidden email]?subject=help
>>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>
>>>
>>>
>>> --
>>> You receive this message as a subscriber of the [hidden email] mailing list.
>>> To unsubscribe: mailto:[hidden email]
>>> For general help: mailto:[hidden email]?subject=help
>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>
>>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email] mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws