Forum Discussion

ogonzalez's avatar
ogonzalez
New Contributor II
3 days ago

Modifying SQL Editor component in Dynamic Dashboards not working

Hi there,

I'm working on a client using the version 8.5.2 and I'm trying to use the Dynamic Dashboards functionallity to modify a property from a SQL Editor Component.

The purpose of this logic is to set a dashboard in "ReadOnly" mode when the parameter is set, and in this case, the read only mode I want to achieve is by setting "ShowDataManipulationButtons = False".

The BR logic used is the following:

If Component.DashboardComponentType = DashboardComponentType.SqlTableEditor Then
Dim sqlDefinition = XFSqlTableEditorDefinition.ReadXmlString(si,Component.XmlData)
sqlDefinition.ShowDataManipulationButtons = False
Component.XmlData = sqlDefinition.WriteXmlString(si)
End If
 
I have checked that after this point the component XmlData has changed, however, despite returning the modified component, the changes as not being displayed in the dashboard.
If instead of modifying an SqlEditor component, I change any property on a Button component, the changes are being displayed correctly.
 
Is this a known issue for the version 8.5.2 or is there any specific thing I might be missing for the SqlEditor component?
 
PD: I know I can achieve creating a copy of the component, but it doesn't makes sense to do something twice (or ten times) when there is a way to solve it dynamically once for all.
 
Thank you in advance!

2 Replies

  • sameburn's avatar
    sameburn
    Icon for OneStream Employee rankOneStream Employee

    Hi ogonzalez

    I think you need to save the dynamic component after you've changed it.

    Im not in front on my PC at the moment but there is a method on the api called something like SaveDynamicComponentState

    That should ensure any changes you make are reflected in the component collection returned 

    Hope this helps

    Sam

    • sameburn's avatar
      sameburn
      Icon for OneStream Employee rankOneStream Employee
      api.SaveDynamicComponentState(si, dynamicDashboardEx.DynamicDashboard,dynamicComponent.DynamicComponentEx, WsDynamicItemStateType.EntireObject);