Tabview lose dynamic content when changing tab

Hi,

I’m trying to build an app with a tabview. Due to an expensive and asynchronous operation (several AJAX calls to collect and prepare information) I need to change the tab’s content dynamically. It works as expected but when I change the tab, the dynamic content is either lost or not rendered.

Check this URL for an example:
http://webix.com/snippet/153352d2

Any thought about how can I fix this?

Also, if you change your tab before the content has been changed, it rises an “Script error.”.

Thank you very much.

Carlos

Hi,

I can confirm bug with replacing the view in hidden state, fix will be included in the next public build.

As for problem with view preserving - it does occurs because of the way how tabview works ( tab button is linked to the visible content by content’s id, which is not preserved in your sample )

The simplest way to workaround the issue - use nested layout in the tabview.
http://webix.com/snippet/f3a92678
I have added the lines 13 and 18 here

Hi maksim,

Your solution works perfectly :slight_smile:

It also seems to fix the “Script error.” issue (I cannot replicate it with your patch).

Is there any URL to subscribe for new version updates?

Thank you very much.

Carlos

You can use rss of http://webix.com/blog or email subscription at bottom of http://webix.com

Cheers. Already done :slight_smile:

maybe it works just the first time?

I add a row after “webix.ui(content, $$(‘content’));”
and call a function Again()
the function Again changes the content-variable and does
“webix.ui(content, $$(‘content’));”
again, but nothing changes to the content!
could it be that the id “content” is overwritten one you substitute the content of that part with another content? I also tried to insert the “id” tag with the same value (“content”) in the overwriting structure; but didn’t manage to do it;
I have a similar problem: once overwritten, there’s no correct “id” anymore; and thought I could find the solution in this answer, but it doesn’t work;
what’s the correct way to overwrite a content n-times?

webix.ui( config, view ) command will replace view with new one, so yes, calling the same command second time will not cause any changes, as view already removed from the layout and replaced with a new ui.

If you need to use constant updates - use layout and slightly different syntax

webix.ui([config], view)

where view points to some layout

http://webix.com/snippet/70adb7f0

This command will replace the content of layout, but layout itself will stay in place, so the command can be reused again and again.

I found this snippet generated many reduplicative className, webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line webix_layout_line

Yep, it is a known issue, will be adressed in the oncoming Webix 2.2