-
1. Re: What am i doing wrong in rich:editor and a4j:support?
joseberardo Jan 18, 2009 2:18 PM (in response to joseberardo)Without a4j:support, it works fine, but only reloading all the page
-
2. Re: What am i doing wrong in rich:editor and a4j:support?
joseberardo Jan 19, 2009 4:58 AM (in response to joseberardo)How can I make ajax requests?
I made a test with onsave attribute, but I don't know how it works.
Just for a test, I did:<script type="text/javascript"> <![CDATA[ function testar() { alert('foi!'); } ]]> </script>
And onsave="testar()" in rich:editor tag.
I've inserted editor inside a dataTable which brings only two registers, but my function testar() was called 5 or 6 times () and the two editors were changed to undefined.
Can I use a4j:support or a have to use onsave attribute?
How can I use onsave?
Is there any other event, like onblur (the documentation cites only onchange, oninit, onsave and onsetup)? -
3. Re: What am i doing wrong in rich:editor and a4j:support?
ilya_shaikovsky Jan 19, 2009 5:40 AM (in response to joseberardo)1) all the event are standard tinyMCE callbacks. So just check their documentation.
2) if you want to save it via a4j:support - check richfaces demo sample. preview done in this manner there.
3) you could also add simple button or link "save" and save via the control . -
4. Re: What am i doing wrong in rich:editor and a4j:support?
joseberardo Jan 19, 2009 7:40 AM (in response to joseberardo)Ok Ilya, thank you for your response.
But, I'm having some troubles with the demo version.
When I use the attribute:onsubmit="if (! #{rich:element('form:editorvalue')}) return false;"
My editor doesn't appear in the view.
My rich:editor id is editor too, but it is inside a rich:dataTable, so I believe I have to change the form:editorvalue, but I don't know what to use in replacement.
My Code:<rich:dataTable rendered="#{perguntasAction.listaAberta}" value="#{perguntas}" var="_pergunta"> <rich:column> <f:facet name="header">Title</f:facet> <rich:editor id="editor" width="200" autoResize="true" height="50" value="#{_pergunta.titulo}" immediate="true" theme="advanced" plugins="save"> <f:param name="theme_advanced_buttons1" value="bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,save,cancel"/> <f:param name="theme_advanced_buttons2" value=""/> <f:param name="theme_advanced_buttons3" value=""/> <f:param name="theme_advanced_buttons4" value=""/> <f:param name="theme_advanced_toolbar_location" value="top"/> <f:param name="theme_advanced_toolbar_align" value="left"/> <f:param name="save_enablewhendirty" value="true"/> <a4j:support event="onchange" ajaxSingle="true" requestDelay="1000" onsubmit="if (! #{rich:element('form:editorvalue')}) return false;"/> </rich:editor> </rich:column> </rich:dataTable>
What am i doing wrong? -
5. Re: What am i doing wrong in rich:editor and a4j:support?
ilya_shaikovsky Jan 19, 2009 7:45 AM (in response to joseberardo)just remove this one. It was used at demo in order not to submit the form if the preview turned of.
-
6. Re: What am i doing wrong in rich:editor and a4j:support?
joseberardo Jan 19, 2009 8:53 AM (in response to joseberardo)As far as I can see, my problem was about using event="onsave".
When I replace it by event="onchange" the editor passed to work.
With onsave, my browser throws a Too much recursion in firebug console. with onsave and requestDelay, simply nothing works (neither error).
Now, with onchange, it's ok. Thank you. -
7. Re: What am i doing wrong in rich:editor and a4j:support?
joseberardo Jan 22, 2009 2:10 PM (in response to joseberardo)Hi ilya.
Few days of testing and my editor seems to not work fine.
I found an issue even in editor at demo pages. Try to turn on the Toggle Preview and type a text (letters, spaces, numbers). It will not fire the request, only when you click or use arrows. Is it a bug?
In my codes, sometimes the editor simply stops ajax requests. Other times, it fires a "too much recursion" exception in firefox.
Code:<rich:editor height="60" width="300" value="#{perguntasAction.perguntaAtual.titulo}" configuration="#{perguntasAction.editor}" id="titulo"> <a4j:support event="onsave" requestDelay="1000" reRender="questionsList" ignoreDupResponses="true" limitToList="true" ajaxSingle="true"/> </rich:editor>
Properties (pseudo-code):theme="advanced" plugins="save ... and many others" several buttons at four lines save_enablewhendirty="true"
-
8. Re: What am i doing wrong in rich:editor and a4j:support?
ilya_shaikovsky Jan 23, 2009 8:25 AM (in response to joseberardo)I found an issue even in editor at demo pages. Try to turn on the Toggle Preview and type a text (letters, spaces, numbers). It will not fire the request, only when you click or use arrows. Is it a bug?
Not a bug of rich editor. We just use the event which tinyMCE provides. We do not rewrite their basic functionality so the event works just as desinged in tinyMCE.In my codes, sometimes the editor simply stops ajax requests. Other times, it fires a "too much
recursion" exception in firefox.
Need the details on the case.