Fórum

Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio

thumbnail
Bernardo Puglia Lima, modificado 11 Anos atrás.

Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio

Junior Member Postagens: 41 Data de Entrada: 25/01/12 Postagens Recentes
Hello everyone!

I'm trying to use a feature that I have noticed to be found only on Alloy UI 1.5 (http://deploy.alloyui.com/api/classes/TreeNodeRadio.html) but I need it to work on a Liferay 6.0 SP2 environment.

Is there a way to upgrade the Alloy UI 1.0.1 -> 1.5 to use it on versions prior to Liferay 6.1?

Or if anyone knows a way to allow just a single selection on a TreeNodeCheck on 1.0.1 would solve my problem as well!

Thanks in advance!
thumbnail
Eduardo Lundgren, modificado 11 Anos atrás.

RE: Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio

Junior Member Postagens: 25 Data de Entrada: 18/06/08 Postagens Recentes
Hello Bernardo,

Alloy 1.0.x doesn't have TreeNodeRadio out of the box.

One recommendation is that you create that class, copying A.TreeNodeRadio from the 1.5.x source, and place it in any javascript file from your portlet.

I have attached a zip file with an example.
thumbnail
Bernardo Puglia Lima, modificado 11 Anos atrás.

RE: Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio

Junior Member Postagens: 41 Data de Entrada: 25/01/12 Postagens Recentes
Worked perfectly!

For those who need it, copy the tree-node-radio.js to the js folder and the radios.png to the css folder. Add the following line to liferay-portlet.xml:

<header-portlet-javascript>/js/tree-node-radio.js</header-portlet-javascript>


And the following classes to the main.css:


.aui-tree-node-radio .aui-tree-node-checkbox-container {
	background: transparent url(radios.png) no-repeat 0 50%;
}

.aui-tree-node-radio-checked .aui-tree-node-checkbox-container {
	background-position: -16px 50%;
}


Just one little issue: when I select a node that has children, the selected (parent) and the last child are selected, but if I select the last child of some other node, the parent isn't selected. Is this a normal behaviour?

Once again, thanks!
thumbnail
Bernardo Puglia Lima, modificado 11 Anos atrás.

RE: Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio

Junior Member Postagens: 41 Data de Entrada: 25/01/12 Postagens Recentes
Well, due to this bug I had to stick with a jQuery tree solution on this particular case.

Regards!