Foren

liferay-ui:asset-categories-selector getting current selected categories

Jeremy Trudel, geändert vor 7 Jahren.

liferay-ui:asset-categories-selector getting current selected categories

New Member Beiträge: 9 Beitrittsdatum: 17.05.16 Neueste Beiträge
I have a a fundamental issue using liferay-ui tag libs that I can't seem to get around.

I originally had a liferay-ui:asset-categories-selector within a form used for asset searches. The form had a render URL and a button, who's onClick function would call the toString() on the render url.

Somehow, I can't explain, behind the scenes the currently selected categories were being added to the render url of that form so that when my page loaded again(same page) the currently selected category id's were remembered, applied to the search and all was well.

My problem is that I had a whole bunch of dynamic parameters that I needed to add to the render URL as well, that I couldn't seem to add when my render URL was created as a tag (ie. <liferay-portlet:renderURL var="searchURL">

So I went down the road of creating the render url in javascript, adding my dynamic parameters as needed and all was well again.

The issue is that now that I am creating my render url in javascript, I am losing the currently selected categories that I gained by having the liferay-ui:asset-categories-selector within the same form as my search button.

I have absolutely no idea how to get access to the categories selector from within javascript to get the currently selected categories so that I can add them to my newly constructed renderURL. I can't seem to assign the tag an id, so that I can call document.getEelementById(). I tried getElementsByTagName but that didn't seem to work either. Anyone have any idea on how to achieve this?

If there is another way to create the render url tag and add dynamic parmeters to it I would be open to suggestions.
thumbnail
Byrån Zaugg, geändert vor 7 Jahren.

RE: liferay-ui:asset-categories-selector getting current selected categorie

Expert Beiträge: 252 Beitrittsdatum: 06.04.12 Neueste Beiträge
You will probably get more help under Portal Development. This forum is for the AUI JavaScript library.