<div dir="ltr">Hi all, <div><br></div><div>My aim is to manage (adding, deleting, ...) categories through the CategoryWidget. <br>It seems there is not option to allow this (at least, I did not find it). So, I decided to create my own widget : CategoryCustomWidget. <br>
<br>CmsCategoryCustomWidget extends from CmsCategoryWidget, but my method getDialogWidget() is never called, instead of newInstance() is called, returning a CmsCategoryCustomWidget. </div><div><br></div><div>Here is my class code : </div>
<div><br></div><div><div><font color="#0000ff">public class CmsCategoryCustomWidget extends CmsCategoryWidget {</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> public CmsCategoryCustomWidget() {</font></div>
<div><font color="#0000ff"> super();</font></div><div><font color="#0000ff"> }</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> public CmsCategoryCustomWidget(String configuration) {</font></div>
<div><font color="#0000ff"> super(configuration);</font></div><div><font color="#0000ff"> }</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> @Override</font></div><div><font color="#0000ff"> public I_CmsWidget newInstance() {</font></div>
<div><font color="#0000ff"> return new CmsCategoryCustomWidget(getConfiguration());</font></div><div><font color="#0000ff"> }</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> @Override</font></div>
<div><font color="#0000ff"> public String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) {</font></div><div><font color="#0000ff"> StringBuffer result = new StringBuffer();</font></div>
<div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> result.append("<table>");</font></div><div><font color="#0000ff"> result.append("<tr><td>Coucou</td></tr>");</font></div>
<div><font color="#0000ff"> result.append("</table>");</font></div><div><font color="#0000ff"><br></font></div><div><font color="#0000ff"> return result.toString();</font></div><div><font color="#0000ff"> }</font></div>
<div><font color="#0000ff">}</font></div></div><div><br></div><div><font color="#000000">What am I doing wrong ? <br>Did mechanics changed since tuto were written ? </font></div><div><font color="#000000"><br></font></div>
<div><font color="#000000">Thanks for your help. </font></div><div><font color="#000000">LeNouveau</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">PS : If you who a such widget already exists, don't hesitate to tell me ! ^^ </font></div>
</div>