Assistance required for custom code mode filter widget

Edgar Kautzner shared this question 8 days ago
In Progress

Hi Peter,

As requested, please find a community ticket on the issue we're having with a custom code mode filter widget.

The widget uses the results from a specified report to provide a list of available options in a filter.


Here's a video demonstrating the issue we're having:

https://drive.google.com/file/d/1yCYt6aVSm8h0Dw0FecdQu4LDn5XBa2qO/view?usp=sharing

Basically the filter widget is showing in "preview" in code mode, however is not showing when the dashboard is published.


We have a production deployment in about 1.5 weeks and this widget is an important part of this. The client is Intermedium.

Please find details from our developer below.

Original question from our developer:

Please find below the analysis of the non-rendering of the widget when the same is placed in the Global area of the dashboard and published.

When the published dashboard is opened by the user, the control enters the javascript (defined in the getMainJavascriptPath() of the ExampleFilter java class) as shown in the attached image below. The object formats inside this.messenger is null which results in the linked report not getting loaded which results in non-loading of the fiter value (as the method renderFilterValue() is never executed)

1?ui=2&ik=1545b67235&attid=0

However if the widget was actually placed inside a subtab of the dashboard and when the published dashboard was opened, there is value present in the formats object and the reportuuid is fetched from the same and the linked report will be loaded which will further execute the renderFilterValue() method which results in the filter widget being displayed. The attached image shows this scenario:

1?ui=2&ik=1545b67235&attid=0

Even after trying several debugging approaches I am unable to figure out from where the messenger object is injected and from where the formats is set to the opts object present in the constructor of this ExampleFilter javascript object.

Any insights to the entire workflow of a widget initialization will be helpful in analysing further.

---

Here's a tip from Ned:

That is a good one, my initial thought would be that the element the filter widget is trying to render into on the page doesn't exist at the time it's trying to render.

Could be a timing issue potentially. Ie the code widget renders before the filter list does

--

More info from our developer

progress?

Also I tried one more thing to confirm this, In the Example Filter.java within the method protected Set<CanvasType> getAvailableOn() , if I add only the CanvasType.STATIC (means the global area where this ExampeFilter will be available)

the widget is not even getting displayed in the widgets panel for selection. Does this mean that this functionality of supporting widgets in global area is partially implemented (which is why iff we add ConvasType.SUBTAB and CanvasType.STATICin the getAvailableOn() method , atleast we can see the widget in Preview mode when dragged to global area which will vanish once in Publish mode)

Could you pass this info to the developer which might also give him some more insights on the issue we are facing? (edited)

Comments (1)

photo
1

Hi Edgar,

I have looped in Peter on this to see if he know anything, or knows someone who knows anything, about this.

I'll keep you posted.

Have a great day,

David