Skip to main content
Solved

Conditionally Making a Side Panel Active or Hidden

  • July 11, 2024
  • 1 reply
  • 54 views

Forum|alt.badge.img+4

Hi Folks,
I have a string parameter sp_CommonButtonsStatus which is defined as either “Active” or “Hidden” based on a simple if-else condition and I want to use it to determine the state of a side panel as follows:

data { ( 1, displayText ) : "Common Actions",  ( 1, pageId ) : "common_buttons",  ( 1, tooltip ) : "Common Actions",  ( 1, icon ) : "aimms-play"  ,  ( 1, state ) : "sp_CommonButtonsStatus"}

Doesn’t work. Please tell me there is a simple way to do it, but I am missing it somehow 😁
Best,
Gorkem

Best answer by gorkem

Ok, I don’t know how I achieved this, but I’ve found it by trial-error. Just to help out the ones who will struggle in the future, you need to remove the word “data” and write the properties in between single quotes. After doing that, you can take the parameter out the double quotes and it won’t give any error. So it should be as follows:
 

​​​​​​​{ ( 1, 'displayText' ) : "Common Actions",  ( 1, 'pageId' ) : "common_buttons",  ( 1, 'tooltip' ) : "Common Actions",  ( 1, 'icon' ) : "aimms-play"  ,  ( 1, 'state' ) : sp_CommonButtonsStatus}

It works magically 🤣

1 reply

Forum|alt.badge.img+4
  • Author
  • Ace
  • 14 replies
  • Answer
  • July 11, 2024

Ok, I don’t know how I achieved this, but I’ve found it by trial-error. Just to help out the ones who will struggle in the future, you need to remove the word “data” and write the properties in between single quotes. After doing that, you can take the parameter out the double quotes and it won’t give any error. So it should be as follows:
 

​​​​​​​{ ( 1, 'displayText' ) : "Common Actions",  ( 1, 'pageId' ) : "common_buttons",  ( 1, 'tooltip' ) : "Common Actions",  ( 1, 'icon' ) : "aimms-play"  ,  ( 1, 'state' ) : sp_CommonButtonsStatus}

It works magically 🤣



Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator