Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

Jump to content

Using JavaScript to interact with dropdown lists in WebFOCUS Designer - Assemble Visualizations.


Guest David White 5

Recommended Posts

Guest David White 5

Hello,

Does anyone happen to have a simple working example of using JavaScript to dynamically populate a second dropdown list based on the selection in the first?

The examples I've seen in the documentation don't access dropdown lists as far as I've seen:

-https://kb.informationbuilders.com/topic/applying-custom-javascript-page 

-https://kb.informationbuilders.com/topic/designer-javascript-api-classes

Thanks in advance for any help!

David

Link to comment
Share on other sites

You can do this without JavaScript. It is accomplished with a feature called chaining. You can try this example:

-DEFAULT &REGION = '_FOC_NULL';-DEFAULT &ST = '_FOC_NULL';-DEFAULT &CITY = '_FOC_NULL'; TABLE FILE GGSALESSUM DOLLARS UNITSBY REGIONBY STBY CITYWHERE REGION EQ '&REGION.(FIND REGION IN GGSALES|FORMAT=A11).' AND ST EQ '&ST.(FIND ST IN GGSALES|FORMAT=A2,WITHIN=REGION).' AND CITY EQ '&CITY.(FIND CITY IN GGSALES|FORMAT=A20,WITHIN=ST).';ON TABLE SET PAGE-NUM NOLEADON TABLE SET STYLE * INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,$ENDSTYLEEND

The important part is the the WITHIN keyword in the extended definition of the variables.

When the above code is saved in a fex and used in Designer, you can select a REGION then see only the ST for that REGION, etc.

image.thumb.png.5c8988a6e935be101ef3cc94aff35d19.png 

Link to comment
Share on other sites

Guest David White 5

Hi David,

Unfortunately, the data I'm working with is not hierarchical, so I would still love to see a JavaScript example if someone has one.

That said, in most cases the data will be hierarchical, so I will look to implement the technique you shared in those scenarios... thank you!

David

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...