Foren

Fallo en generación de pestañas con Dojo

Ramón Jardón, geändert vor 11 Jahren.

Fallo en generación de pestañas con Dojo

New Member Beiträge: 2 Beitrittsdatum: 11.04.13 Neueste Beiträge
Buenas,

Estamos teniendo problemas al generar JSP’s que tienen pestañas con Dojo en Liferay. No se están visualizando las pestañas, y la información de cada pestaña aparecen seguidas.

La biblioteca Dojo la estamos importando correctamente con el Tema.

La creación del contenedor de pestañas y las propias pestañas las estamos creando de manera declarativa como indica la documentación de Dojo:

(…)
require(["dojo/parser", "dijit/layout/TabContainer", "dijit/layout/ContentPane"]);
(…)
<div data-dojo-type="dijit.layout.TabContainer" style="width:100%; height:100%;"> //Contenedor de pestañas
<div data-dojo-type="dijit.layout.ContentPane" title="Bureau" selected="true"> //Cada pestaña
(…)

Cuando se genera el HTML con el Dojo observamos que no se crean los objetos corresponientes en el DOM, simplemente indica la información del Dojo como texto HTML. Ejemplo:
(...)
<div style="width: 100%; height: 100%;" data-dojo-type="dijit.layout.TabContainer">
<div data-dojo-props="selected:true" title="My first tab" data-dojo-type="dijit.layout.ContentPane"> Lorem ipsum and all around... </div>
<div title="My second tab" data-dojo-type="dijit.layout.ContentPane"> Lorem ipsum and all around - second... </div>
<div data-dojo-props="closable:true" title="My last tab" data-dojo-type="dijit.layout.ContentPane"> Lorem ipsum and all around - last... </div>
(...)

Si generamos el contenedor de pestañas y cada pestaña de manera programática, si que logramos mostrar las pestañas, pero tendríamos que conseguirlo de manera declarativa.

¿Nos podrían indicar donde podemos cometer algún error o como se debería de hacer ?

Muchas gracias.
thumbnail
Vaibhav Tayde, geändert vor 11 Jahren.

RE: Fallo en generación de pestañas con Dojo

New Member Beiträge: 7 Beitrittsdatum: 21.02.11 Neueste Beiträge
привет

Вы говорите по-английски?
Ramón Jardón, geändert vor 11 Jahren.

RE: Fallo en generación de pestañas con Dojo

New Member Beiträge: 2 Beitrittsdatum: 11.04.13 Neueste Beiträge
Good Moorning, I expose my problem in English.

We're having trouble building JSP's that have tabs Dojo in Liferay. The tabs are not displayed, and the information on each tab are followed.

We are importing the library "Dojo" correctly with the Theme.

We are creating the container tabs and tabs declaratively, as the documentation will indicate.

(…)
require(["dojo/parser", "dijit/layout/TabContainer", "dijit/layout/ContentPane"]);
(…)
<div data-dojo-type="dijit.layout.TabContainer" style="width:100%; height:100%;"> //Container tabs
<div data-dojo-type="dijit.layout.ContentPane" title="Bureau" selected="true"> //tab
(…)



When generating HTML with Dojo, we observe that the corresponding objects aren't created in the DOM. It simply indicates Dojo information as HTML text. example:

(...)
<div style="width: 100%; height: 100%;" data-dojo-type="dijit.layout.TabContainer">
<div data-dojo-props="selected:true" title="My first tab" data-dojo-type="dijit.layout.ContentPane"> Lorem ipsum and all around... </div>
<div title="My second tab" data-dojo-type="dijit.layout.ContentPane"> Lorem ipsum and all around - second... </div>
<div data-dojo-props="closable:true" title="My last tab" data-dojo-type="dijit.layout.ContentPane"> Lorem ipsum and all around - last... </div>
(...)


We do generate the container tabs and each tab programmatically, but we should get it declaratively.


Do we might indicate where we can make a mistake or should do?

Thank you very much.
thumbnail
Vaibhav Tayde, geändert vor 11 Jahren.

RE: Fallo en generación de pestañas con Dojo

New Member Beiträge: 7 Beitrittsdatum: 21.02.11 Neueste Beiträge
Dear Ramón,

It appears that the issue lies in your JavaScript. It is recommended to debug your Client-Side Code in a neat Script Console (Firebug; if you are using Firefox) provided that DoJo does a little co-operation. You may enable DoJo Debugging using debugAtAllCosts

e.g.;
<script type="text/javascript" src="/dojoroot/dojo/dojo.js" djconfig="parseOnLoad: true, debugAtAllCosts: true"> </script>


The procedure is well described on DoJo Website under Debugging. However, it is not recommended in Production for performance issues.