APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

tabbedPanel post and replies

Return to the tabbedPanel thread
Login to post to this thread

tabbedPanel - December 14, 2019 at 9:46
Cleon Teunissen
25 Posts

According to the release notes:
in 2015 a 'tabbedPanel' view element was added

Release notes for ejss:
https://www.um.es/fem/EjsWiki/Main/PreviousReleases
"Changes in release 151219: New Tabbed Panel element"

The attached zip file has the ejss source for a Lagrange point simulation.

Question: what is the syntax to obtain the tabs?

There is no documentation:
Should the titles be entered as an array? Should the titles be enclosed insquare brackets? Curly brackets? Quote signs? Should a separator be used? If so, what separator?

There is little point in trying to guess.

For instance, in EJSS HTMLView elements there is a field for supplying CSS, but the syntax is not the same as CSS syntax.

Attached File: ejss_src_lagrange_point1.zip


Replies to tabbedPanel

Re: tabbedPanel - December 15 2019 10:12
lookang Avatar
lookang
208 Posts

["inertial system"]

or

["overview","closeup"]

The hint did say string[]

attached see the same example

Attached File: ejss_src_lagrange_pointwee.zip


OSP@SG blog
OSP@SG Digital Library


Re: tabbedPanel - December 15 2019 6:23
Cleon Teunissen
25 Posts

lookang wrote:
> The hint did say string[]

Yeah, the tooltip says 'string[]'.
But then I got confused. In Java code, when an array is declared, the syntax looks like this:

String[] stringArray = {"a", "b", "c"};

I started wondering: should I use curly braces in that input field?
I knew I was wrongfooting myself; I was just too annoyed to even try and figure it out.

Cleon Teunissen



Re: tabbedPanel - December 15 2019 10:18
lookang Avatar
lookang
208 Posts

if you want to achieve a pretty 2 panel interface, you can check this out

:)

https://iwant2study.org/ospsg/index.php/interactive-resources/physics/02-newtonian-mechanics/09-oscillations/600-shm22slstype1

 


OSP@SG blog
OSP@SG Digital Library


Re: tabbedPanel - December 15 2019 10:36
Wolfgang
122 Posts

The tapped panel is yet fully developed or documented but it is not hard to use.  Create a tabbed panel and add subpanels to the tabbed panel.  Then define an array with the tapped panel names in the Tabbed Panel inspector as shown in the screen shot.  

See the Rocket Model example in the OSP collection for a ready to run example and source code.

https://www.compadre.org/OSP/items/detail.cfm?ID=15216

Attached File: TabbedPanelExample.jpg



Re: tabbedPanel - December 15 2019 6:30
Cleon Teunissen
25 Posts

Wolfgang wrote:

> See the Rocket Model example in the OSP collection for a ready to run
> example and source code.

> https://www.compadre.org/OSP/items/detail.cfm?ID=15216

Thanks.

Also, when I generated the simulation I had initially left the 'titles' field empty. My expectation was that EJSS would fall back to using the names of the elements in the view elements tree as the tab names. Instead there were no tabs at all.

As I understand from your second message: in EJSS, when the 'titles' field is left empty, EJSS will simply not create the tabbed panel at all, without issuing a warning in the output area.

Cleon Teunissen



Re: tabbedPanel - December 15 2019 10:44
Wolfgang
122 Posts

Additional notes about Tabbed Panel:

Although the Tabbed Panel does not have a "Visible" property in the Inspector, you can hide the tabs by setting the Titles property to an empty String.  

The Selected property has a bug and does not change its value when a user clicks on a new panel.



The OSP Network:
Open Source Physics - Tracker - EJS Modeling
Physlet Physics
Physlet Quantum Physics