<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Kai,<br>
      <br>
      thanks for your response.<br>
      If you don't bother, a stripped example would be great!<br>
      <br>
      Best,<br>
      Tobias<br>
      <br>
      Am 08.07.2014 11:04, schrieb Kai Widmann:<br>
    </div>
    <blockquote
cite="mid:http:%2F%2Fpermalink.gmane.org%2Fgmane.comp.cms.opencms.devel%2F38974@localhost.localdomain"
      type="cite"><base
        href="http://permalink.gmane.org/gmane.comp.cms.opencms.devel/38974">
      <title>Re: OpenCms 9 custom widgets</title>
      <base
        href="http://permalink.gmane.org/gmane.comp.cms.opencms.devel/38974">
      <pre>Hi there,

there is a way to create custom widgets for OpenCms 8.5 (and I guess it should work in 9 as well, but I’m not sure), but it’s not documented.
With OpenCms 8.5 you get a module named org.opencms.dev.demo.customwidget that contains the source code for a Java Class (CustomWidget.java, it doesn’t do much) and a sample JavaScript widget (mywidget.js).
Using this sample you can create custom widgets in Plain JavaScript, no GWT required (that’s why I chose this method).

The JavaScript contains two functions:
  createNativeWidget: creates the widget for the form based XML editor
  createNativeWrapedElement: creates the widget for the inline editor

Besides others there are two notable functions for each of the widgets:
  getElement: returns a DOM element that is or contains your widget, this might be a simple editable DIV or a complex multi-select widget.
  setValue: must be called whenever the value of your widget changes, (e.g. if the value of a select box changes)

I got some custom widgets working that way, but it wasn’t easy.
Get the module, have a look at the source code. If you think that this is a way you could go then you can contact me again, I might be able to strip down one of my widgets to provide working sample code.

Cheers

Kai


Von: opencms-dev-bounces< at >opencms.org [<a class="moz-txt-link-freetext" href="mailto:opencms-dev-bounces">mailto:opencms-dev-bounces</a>< at >opencms.org] Im Auftrag von Tobias Karrer
Gesendet: Freitag, 4. Juli 2014 11:34
An: The OpenCms mailing list
Betreff: Re: [opencms-dev] OpenCms 9 custom widgets

Someone from Alkacon?

Am 12.06.2014 15:20, schrieb Tobias Karrer:

Hi!



Looking for a solution to migrate my old widgets, I went through the

recent topics.



Seems that a lot of people have problems with Custom Widgets in 8.5. and 9:



<a class="moz-txt-link-freetext" href="http://opencms.996256.n3.nabble.com/OpenCms-9-custom-widgets-tt24244.html">http://opencms.996256.n3.nabble.com/OpenCms-9-custom-widgets-tt24244.html</a>

<a class="moz-txt-link-freetext" href="http://opencms.996256.n3.nabble.com/Custom-widgets-and-the-new-acacia-editor-tt18313.html">http://opencms.996256.n3.nabble.com/Custom-widgets-and-the-new-acacia-editor-tt18313.html</a>

<a class="moz-txt-link-freetext" href="http://opencms.996256.n3.nabble.com/Custom-Widget-opencms-9-0-1-tt24186.html">http://opencms.996256.n3.nabble.com/Custom-Widget-opencms-9-0-1-tt24186.html</a>

<a class="moz-txt-link-freetext" href="http://opencms.996256.n3.nabble.com/GWT-custom-widgets-and-dev-demo-customwidget-tt24113.html">http://opencms.996256.n3.nabble.com/GWT-custom-widgets-and-dev-demo-customwidget-tt24113.html</a>

<a class="moz-txt-link-freetext" href="http://opencms.996256.n3.nabble.com/Custom-widget-with-GWT-tt23612.html">http://opencms.996256.n3.nabble.com/Custom-widget-with-GWT-tt23612.html</a>

<a class="moz-txt-link-freetext" href="http://opencms.996256.n3.nabble.com/Creating-a-CustomeCategoryWidget-tt23473.html">http://opencms.996256.n3.nabble.com/Creating-a-CustomeCategoryWidget-tt23473.html</a>

<a class="moz-txt-link-freetext" href="http://opencms.996256.n3.nabble.com/Custom-widgets-in-latest-versions-tt23251.html">http://opencms.996256.n3.nabble.com/Custom-widgets-in-latest-versions-tt23251.html</a>

<a class="moz-txt-link-freetext" href="http://opencms.996256.n3.nabble.com/Custom-XmlContent-Widget-in-8-5-1-tt23181.html">http://opencms.996256.n3.nabble.com/Custom-XmlContent-Widget-in-8-5-1-tt23181.html</a>

<a class="moz-txt-link-freetext" href="http://opencms.996256.n3.nabble.com/I-Custom-widgets-and-the-new-acacia-editor-SOLVED-tt18800.html">http://opencms.996256.n3.nabble.com/I-Custom-widgets-and-the-new-acacia-editor-SOLVED-tt18800.html</a>

<a class="moz-txt-link-freetext" href="http://opencms.996256.n3.nabble.com/Opencms-8-5-Custom-Widgets-tt14097.html">http://opencms.996256.n3.nabble.com/Opencms-8-5-Custom-Widgets-tt14097.html</a>



Maybe someone knows how to do it and gives us an hint :-)



Best,

Tobias



Am 09.06.2014 20:07, schrieb Tobias Karrer:



_______________________________________________

This mail is sent to you from the opencms-dev mailing list

To change your list options, or to unsubscribe from the list, please visit

<a class="moz-txt-link-freetext" href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a>







_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev">http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev</a>



</pre>
    </blockquote>
    <br>
  </body>
</html>