Skip to main content
Keijo Karvonen
Participant
October 17, 2010
Question

Hiding a tab?

  • October 17, 2010
  • 1 reply
  • 722 views

I'd like to show a tab view in a dialog with different amount of tabs depending on some variable.

However, the following code does not seem to work, it always shows two tabs (i.e. the visible -variable in the second tab_view_item is ignored).

f:tab_view {
     f:tab_view_item {
          visible = true,
          title = "Tab 1",
          identifier = "Tab1",
          f:static_text {
               title = "Some text to show"
          },
     },
     f:tab_view_item {
          visible = false,
          title = "Tab 2",
          identifier = "tab2",
     },

},

Is the syntax correct or is there any other way to make a tab with dynamically set number of tabs?

Thank you,

Keijo K.

This topic has been closed for replies.

1 reply

areohbee
Legend
October 17, 2010

I would just assign the items to an array like:

items = { bind_to_object = props }

items[#items + 1] = vf:tab_view_item...

if some_var then

     items[#items + 1] = vf:tab_view_item...

end

-- and then

tab_view = vf:tab_view( items )

Keijo Karvonen
Participant
October 17, 2010

Thank's Rob.

Didn't think it at all like that but it's obvious solution for my problem.