Jump to content

How to get element id in HTML and set fixed height for text area when page tab is clicked


Sven Eimertenbrink

Recommended Posts

Hi everyone,

I started working withSpotfire (7.10) twoweeks ago and Iam new to HTML as well as Java and basically everything around it. So please assume that I need an explanation for a newbie.

I have several tabs and most of them include two text areas in the top (one with a company branding and title for thatpage and one with some general data). I want these two text areas to have the exact same size on every page so that it does not look like they are "jumping" when switching between tabs.

Is there a possibility to assign the height and width of these two text areas everytime the user clicks on the tab (like in this case "Sensitivity: Quantity") by a script Is this actually the best way to do this or is there another solution to it

I tried to assign heigthsbut encountered the problem that the id's (like the one in the screenshot: id="id16939")of the text areas seemto be changing everytime the tab is opened. How do i get the id's of such elements

These dashboards will be used by colleagues and I am assuming they will adjust some of the bar charts that are place below the text areas. But I for sure want these textareas in the dashboards to look nice and clean without different heights and widths when they are clicking through them.

Hopefully, I am on the right track.

Thanks in advance!

Sven

Link to comment
Share on other sites

I was able to figure out a work around with theLayoutDefinition Class

I was using these two sources to set up the layout I wanted it to look like:

https://community.spotfire.com/wiki/how-set-layout-visualizations-page-tibc...

https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/TIB_sfire-a...

Espacially, the second link and the expamples further down on that side were helpful on how to nest the different sections.

My code looks like this now (just posting to provide more examples for people with similar problems):

Script parameters (in this code e.g.: textAreaTitle) being the visualisations on the page (code only works when there are all parameters visible and no additional visualisations are visible).

from Spotfire.Dxp.Application.Layout import LayoutDefinition

page = Document.ActivePageReference

layout = LayoutDefinition()

# + - -- - + - +

# | 1 | 2 |

# + - + - - + - +

# | 3| |

# + - + 5 +

# | 4| |

# + - +- - -- +

 

layout.BeginStackedSection() # seperating sections 1+2 and 3+4+5

layout.BeginSideBySideSection(1) # seperating sections 1 and 2

layout.Add(textAreaTitle, 5.2)

layout.Add(textAreaGeneralData, 1)

layout.EndSection() # ending section 1+2

layout.BeginSideBySideSection(7) # seperating sections 3+4 and 5

layout.BeginStackedSection() # seperating sections 3 and 4

layout.Add(textAreaAdjustment, 1)

layout.Add(textAreaExplanation, 6.2)

layout.EndSection() # ending section 3+4

layout.Add(tblArticle, 6)

layout.EndSection() # ending section 3+4 and 5

layout.EndSection() # ending sections 1+2 and 3+4+5

page.ApplyLayout(layout)

Link to comment
Share on other sites

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...