attach a layout already initialized in a tabbar cell

Hi,

I have two components already initialized : a dhtmlxTabbar with cells, and a dhtmlxLayout object.

I’d like to link those elements. Processing with something like this :

var myLayoutAlreadyCreated = new dhtmlXLayoutObject(divParameter,patternParameter);
[…]
some javascript code
[…]
var myTabbar = new dhtmlxTabbar();
[…]
some javascript code
[…]
myTabbar.cells(idTabbarCell).attachLayout(myLayoutObjectAlreadyCreated);

As you can see, all informations regarding dhtmlxLayout creation (like the pattern) are given before Tabbar creation (it can’t be change, cause this code is generated by J2EE tags, and we are confontred to a cycle : un tabbar can contains a layout, who can contains a tabbar, etc.).

How can I proceed to link my tabbar to my layout ?

Hi,

It is impossible to attach existent layout using attachLayout method. You may other create the new one or use attachObject method:

var myLayoutAlreadyCreated = new dhtmlXLayoutObject(divParameter,patternParameter);

myTabbar.cells(idTabbarCell).attachObject(divParameter);

Hello,

Thanks for this solution. But it can’t work fine in all cases.

Indeed, your are suggesting to use a div paremeter, which is supposed to work with this :

var myLayoutAlreadyCreated = new dhtmlXLayoutObject(divParameter,patternParameter);
...
myTabbar.cells(idTabbarCell).attachObject(divParameter);

But a div parameter wouln’t be present if previous layout is already attached to another object. Example :

var myDhtmlxComponent = new dhtmlX[Component]Object(divParameter); ([Component] could be Layout, Tabbar, etc.)
...
var myLayoutAlreadyCreated = myDhtmlxComponent.attachLayout(patternParameter);
...
myTabbar.cells(idTabbarCell).attachXXXXX(myLayoutAlreadyCreated) => nothing is possible

Is there any other solution ? I’ve looked into all the dhtmlx professional version library we bought, but I didn’t find anything

You may use detachObject() that detaches content from a cell. It returns the array with detached object and id of its container:

var myLayoutAlreadyCreated = myDhtmlxComponent.attachLayout(patternParameter);
var arr = myDhtmlxComponent.detachObject();

myTabbar.cells(idTabbarCell).attachObject(arr[1]);

Hello.

detachObject supposes the object is already attached to another one.

In the solution we are searching for, it is not always the case

Hello,

Due to encountered complications, this need has been bypassed using Java side implementation of our tags, and linking some components.

Then, each component knows its parent, and can ask for a correct attachement.

Thanks having tried to help us.

Regards

There are only two possibilities:

  1. attachLayout - creates new tabbar. You can not pass the object of existent layout in this method

  2. attachObject - attaches existent html container.