留言板

Concerning the deprecation of AlloyUI and Forms

Julian Pfeil,修改在7 年前。

Concerning the deprecation of AlloyUI and Forms

Junior Member 帖子: 72 加入日期: 16-3-1 最近的帖子
According to this article from september AlloyUI is deprecated as of Liferay 7.

Because at the moment i am making some portlets containing forms in their front end, i was wondering what all those <aui:...> - tags were doing behind the scenes to make the forms created with them work.
So i checked the page source and found those long strings containing the module path and some hash in the name tags of a lot of elements created with <aui:...>-tags.

Now i think that i want to get rid of all the <aui:...>-tags and create my portlet's UI by "simply" using HTML, BootStrap & CSS.
That's why i have a few questions:
  • In which HTML attributes do i need to use the <portlet:namespace /> tag to keep my forms, etc working as before with the aui-tags? (Is putting <portlet:namespace /> in the name-attribute enough?)
  • To make the localization features of Liferay modules work, i have to use the ResourceBundle class, right?
  • Do i have to prefix every JavaScript function with <portlet:namespace />, too?
  • Do i have to do anything else?


Kind Regards,
Julian
thumbnail
David H Nebinger,修改在7 年前。

RE: Concerning the deprecation of AlloyUI and Forms

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
Oh, best laid plans...

It is not deprecated. It is still alive and well in Liferay 7.

And I don't believe it's going anywhere. Certainly they may change the underlying tag implementations, i.e. from YUI to jQuery, but unless they want to rewrite all of the portal's OOTB portlets, it's going to remain for some time yet.

Go ahead and use it, it will be fine.
Julian Pfeil,修改在7 年前。

RE: Concerning the deprecation of AlloyUI and Forms

Junior Member 帖子: 72 加入日期: 16-3-1 最近的帖子
Deprecated does not mean that it's dead alreadyemoticon And good to know!...

Nonetheless, my questions still stand - out of curiosity at least.

Kind Regards,
Julian
thumbnail
David H Nebinger,修改在7 年前。

RE: Concerning the deprecation of AlloyUI and Forms (答复)

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
1. Any id or name in any element. Anything you might look up via javascript ID or you want the portal to convert to a portlet request parameter, you need the ids namespaced.

2. Yes. Although you can use the <liferay-ui:message /> to do the i18n stuff, that's pretty much what we all use and it is not AUI based.

3. Yes, otherwise you may end up with a collision. If you create a js function, validateForm() for your one portlet, but some other developer also defines a function validateForm() for a different portlet, or if you have a instanceable portlet, you may end up with collisions. You namespace your functions to ensure no one else steps on your code.

4. That's pretty much it. Basically you just need to ensure that everything for your portlet is protected from anything else the portal admin might drop on the page. Namespacing takes care of that.