The iFrame widget

The iframe html element is famous for its power of embedding other sites. The iFrame widget has the iframe element as its core; and you can use it in your WebUI to enhance the application experience.

Note

  1. Some sites do not permit embedding.

  2. The iFrame widget is not part of the AIMMS product portfolio. It is provided in this How-To as is.

Downloads

You can add the iframe widget to your collection of widgets to choose from by unzipping iFrameExample and adding this to the folder ./MainProject/WebUI/resources/javascript.

Example details

The example app may look as follows upon opening:

../../_images/example-app.png
  1. Content published on the internet can be shown using the iFrame widget, for instance as follows:

    "<iframe src=\"https://public.tableau.com/views/CBSSportsFantasyFootball2/RunningBacks?:showVizHome=no&:embed=true\" ></ifame>"
    
  2. This how-to site:

    "<iframe src=\"https://how-to.aimms.com\"></ifame>"
    
  3. When referring to contents in the folder ./MainProject/WebUI/resources/, you will need to refer to the folder:

     1StringParameter sp_localHTMLfile {
     2    Definition: {
     3
     4        "<iframe src=\"/app-resources" +
     5        if bp_usePublishedResources then
     6            "/" + pro::ModelName + "/" + pro::ModelVersion + "/"
     7        else
     8                "/"
     9        endif +
    10        "/resources/images/539-which-odbc-drivers.html#which-odbc-drivers\"></iframe>"
    11    }
    12}
    

    where the parameter bp_usePublishedResources is initialized as follows:

    1if ProjectDeveloperMode then
    2    bp_usePublishedResources := 0 ;
    3else
    4    bp_usePublishedResources := 1 ;
    5endif ;
    

    The reason is that the contents are cached on the client device, and the folder adaption provided by the AIMMS WebUI is not part of the iFrame widget.