Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Bernardo Puglia Lima
Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio
October 23, 2012 1:29 PM
Answer

Bernardo Puglia Lima

Rank: Junior Member

Posts: 36

Join Date: January 25, 2012

Recent Posts

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!
Eduardo Lundgren
RE: Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio
October 24, 2012 7:28 AM
Answer

Eduardo Lundgren

LIFERAY STAFF

Rank: Junior Member

Posts: 25

Join Date: June 18, 2008

Recent Posts

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.
Attachments: tree-node-radio.zip (5,334.4k)
Bernardo Puglia Lima
RE: Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio
October 25, 2012 1:01 PM
Answer

Bernardo Puglia Lima

Rank: Junior Member

Posts: 36

Join Date: January 25, 2012

Recent Posts

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:

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


And the following classes to the main.css:

1
2.aui-tree-node-radio .aui-tree-node-checkbox-container {
3    background: transparent url(radios.png) no-repeat 0 50%;
4}
5
6.aui-tree-node-radio-checked .aui-tree-node-checkbox-container {
7    background-position: -16px 50%;
8}


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!
Bernardo Puglia Lima
RE: Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio
November 8, 2012 4:54 AM
Answer

Bernardo Puglia Lima

Rank: Junior Member

Posts: 36

Join Date: January 25, 2012

Recent Posts

Well, due to this bug I had to stick with a jQuery tree solution on this particular case.

Regards!