Portlet Factory, Version 6.1.2


 

Adding a context menu to a web chart

You can create a web chart whose data changes when users click on different areas of the chart. Through the use of HTML input controls on the page, data is passed to the back-end system, which returns the appropriate data.

  1. Add two Hidden Input builders to a page location in the model and name them InputA and InputB.

  2. Add a Contextual Menu builder. Place both Hidden Input builders and the Contextual Menu builder inside a specific form (for example, myForm) if you plan to use the Submit form action for the menu.

  3. Select Hidden (manually invoked). The contextual menu can be created only once per builder call because the Builder_NameShowContextualMenu method, which gets the JavaScript method name used to show the contextual menu, is generated once per builder call. If more than one contextual menu is created (for example, by using the Advanced Page Location to place a menu in multiple locations or to place a menu inside a Repeated Region), only the first contextual menu on the page will be available.

  4. Select Specify explicitly as builder input as the Menu Content.

  5. Select Submit form and invoke action as the Action Type.

  6. Select the action and the form.

  7. Click OK.

  8. In the WebCharts builder, add a Chart Click action that uses JavaScript code to initialize values for InputA and InputB. Call Builder_NameShowContextualMenu to get the JavaScript method name used to show the contextual menu. For example:
    document.myForm.InputA.value='$(colLabel)';document.myForm.InputB.value='$(rowLabel)';${MethodCall/<Builder Name>ShowContextualMenu}

  9. Click OK.

Parent topic: Contextual Menu builder


Library | Support |