[xwiki-users] XWiki document with textarea
Hi guys, I need in my XWiki page a TextArea whose content I can edit and save. Currently I have a normal Textarea in HTML macro and whenever I edit the content of this box inwysiwyg or inline mode it will not be saved. Here is the document content: {{velocity}} $xwiki.jsfx.use("js/xwiki/wysiwyg/xwe/XWikiWysiwyg.js", {'forceSkinAction': true, 'lazy': true}) {{html}}<br/> <div class='container'> <div class='delegation_container'> <a href='/xwiki/bin/view/MySpace/MyPage'>MyPage</a> </div> <div class='shadow_box'> <table class='activity_table'> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>ID</div> </td> <td><input id='ID' type='text' class='task_page_text_content' value='84978164'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Name</div> </td> <td><input id='Name' type='text' class='task_page_text_content' value='Projektmanagment'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Arbeit</div> </td> <td><input id='Arbeit' type='text' class='task_page_text_content' value='10.0'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Startzeit</div> </td> <td><input id='Startzeit' type='text' class='task_page_text_content' value='02.10.2013'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Endzeit</div> </td> <td><input id='Endzeit' type='text' class='task_page_text_content' value='17.10.2013'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Einschrenkung</div> </td> <td><input id='Einschrenkung' type='text' class='task_page_text_content' value='none'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Art</div> </td> <td><input id='Art' type='text' class='task_page_text_content' value='work'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Kommentar</div> </td> <td>*<**textarea **id='84978164_ta' title='Comment' class='task_page_comment_container'></**textarea**>*</td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Vorgänger</div> </td> <td><input id='Vorgänger' type='text' class='task_page_text_content' value=''/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Projekt</div> </td> <td><input id='Projekt' type='text' class='task_page_text_content' value='00122'/></td> </tr> </table> </div> </div> <br/> ** This was just a attempt ** <script type="text/javascript"> Wysiwyg.onModuleLoad(function() { alert("HELLO WOLRD"); new WysiwygEditor({hookId:'84978164_ta'}); }); </script> ************************* {{/html}} {{/velocity}} What should I do so that I can save the contents of the textarea? About help I would be very grateful. Yours sincerely, Michael Born
Where do you want the content of the text area to be saved? Your text area doesn't even have a name so it isn't submitted to the server when you save the page. I suggest you read http://platform.xwiki.org/xwiki/bin/view/DevGuide/FAQTutorialManual . Hope this helps, Marius On Mon, Oct 7, 2013 at 4:43 PM, Michael Born <[email protected]> wrote:
Hi guys, I need in my XWiki page a TextArea whose content I can edit and save.
Currently I have a normal Textarea in HTML macro and whenever I edit the content of this box inwysiwyg or inline mode it will not be saved.
Here is the document content:
{{velocity}} $xwiki.jsfx.use("js/xwiki/wysiwyg/xwe/XWikiWysiwyg.js", {'forceSkinAction': true, 'lazy': true})
{{html}}<br/> <div class='container'> <div class='delegation_container'> <a href='/xwiki/bin/view/MySpace/MyPage'>MyPage</a> </div> <div class='shadow_box'> <table class='activity_table'> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>ID</div> </td>
<td><input id='ID' type='text' class='task_page_text_content' value='84978164'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Name</div> </td>
<td><input id='Name' type='text' class='task_page_text_content' value='Projektmanagment'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Arbeit</div> </td>
<td><input id='Arbeit' type='text' class='task_page_text_content' value='10.0'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Startzeit</div> </td>
<td><input id='Startzeit' type='text' class='task_page_text_content' value='02.10.2013'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Endzeit</div> </td>
<td><input id='Endzeit' type='text' class='task_page_text_content' value='17.10.2013'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Einschrenkung</div> </td>
<td><input id='Einschrenkung' type='text' class='task_page_text_content' value='none'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Art</div> </td>
<td><input id='Art' type='text' class='task_page_text_content' value='work'/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Kommentar</div> </td>
<td>*<**textarea **id='84978164_ta' title='Comment' class='task_page_comment_container'></**textarea**>*</td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Vorgänger</div> </td>
<td><input id='Vorgänger' type='text' class='task_page_text_content' value=''/></td> </tr> <tr style='border: 0px;'> <td style='border: 0px;'> <div class='body_identifier'>Projekt</div> </td>
<td><input id='Projekt' type='text' class='task_page_text_content' value='00122'/></td> </tr> </table>
</div> </div> <br/>
** This was just a attempt **
<script type="text/javascript"> Wysiwyg.onModuleLoad(function() { alert("HELLO WOLRD"); new WysiwygEditor({hookId:'84978164_ta'}); }); </script>
************************* {{/html}} {{/velocity}}
What should I do so that I can save the contents of the textarea?
About help I would be very grateful.
Yours sincerely, Michael Born _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Thanks for the quick reply, unfortunately I could not answer quickly because I was the last day at the vocational school. I just want that the entered content into the textarea is saved along with the page. The HTML code is automatically generated, I've dont't created an object on the textarea in the document. Is it still possible to save the contents of this box? -- View this message in context: http://xwiki.475771.n2.nabble.com/XWiki-document-with-textarea-tp7587427p758... Sent from the XWiki- Users mailing list archive at Nabble.com.
If you want to save the content of the text area along with the page content then you need an object added to the page and you need the text area to point to a property of that object using the name attribute. Again, I recommend you read the FAQ tutorial I previously linked. Hope this helps, Marius On Thu, Oct 10, 2013 at 9:43 AM, Michael Born <[email protected]> wrote:
Thanks for the quick reply, unfortunately I could not answer quickly because I was the last day at the vocational school.
I just want that the entered content into the textarea is saved along with the page. The HTML code is automatically generated, I've dont't created an object on the textarea in the document. Is it still possible to save the contents of this box?
-- View this message in context: http://xwiki.475771.n2.nabble.com/XWiki-document-with-textarea-tp7587427p758... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Thank you very much -- View this message in context: http://xwiki.475771.n2.nabble.com/XWiki-document-with-textarea-tp7587427p758... Sent from the XWiki- Users mailing list archive at Nabble.com.
I have now created a class "Aktivity.Comment". This class now has a property textarea with the name "comment". Now comes my question, what do you mean by link the property? Do you mean this: <textarea id='0' name='comment'></textarea> or should i do $doc.display('comment'). Display works when it is outside of the html tag. Every time i replace my html textarea with the $doc.display function it will paste {{html clean="false" wiki="true"}} here my content {{/html}}. Sorry for my stupid questions, but i'm a little bit desperate. I have read the FAQ Tutorial but for my question I don't found a answer in it. -- View this message in context: http://xwiki.475771.n2.nabble.com/XWiki-document-with-textarea-tp7587427p758... Sent from the XWiki- Users mailing list archive at Nabble.com.
On Fri, Oct 11, 2013 at 12:57 PM, Michael Born <[email protected]> wrote:
I have now created a class "Aktivity.Comment". This class now has a property textarea with the name "comment".
Now comes my question, what do you mean by link the property?
Do you mean this:
<textarea id='0' name='comment'></textarea>
or should i do $doc.display('comment').
Display works when it is outside of the html tag. Every time i replace my html textarea with the $doc.display function it will paste {{html clean="false" wiki="true"}} here my content {{/html}}.
If you look closely at the output you'll notice that the textarea has a name attribute which value is a bit special: Aktivity.Comment_0_comment which refers to the 'comment' property of the first object of type Aktivity.Comment. So you either hard-code this in your HTML or you put wiki=true to your outer HTML macro and use $doc.display('comment'). Of course in this later case you need to make sure you don't have special wiki syntax symbols in your HTML (and if you have you need to escape them; check the syntax help). Hope this helps, Marius
Sorry for my stupid questions, but i'm a little bit desperate. I have read the FAQ Tutorial but for my question I don't found a answer in it.
-- View this message in context: http://xwiki.475771.n2.nabble.com/XWiki-document-with-textarea-tp7587427p758... Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
Marius Dumitru Florea -
Michael Born