Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Emilio Jose Lamas Fraga
Dynamic Select combos with custom entities
January 4, 2012 8:45 AM
Answer

Emilio Jose Lamas Fraga

Rank: Junior Member

Posts: 42

Join Date: November 29, 2011

Recent Posts

Hello everyone!

I'm getting started with Liferay Dynamic Select. I'm just want to get a simple portlet with two dependant combos. I follow the Countries/Regions example from the code, but when i try to populate the fields with values from the database, the combobox shows no values.

I've attached view.jsp (all the javascript code is also in there, because if I left it only in /js/service.js, the browser throws a javascript error) and service.xml. Let me know if anyone wants to see other files.

The method that retrieves the entities names (getConcellos()) works correctly when executed in an action, for example.

If I change my custom entities for Countries and Regions for example, the portlet works fine. So, what's the deal with my entities?

Thanks!

Regards
Attachments: service.xml (1.2k), view.jsp (3.9k)
Emilio Jose Lamas Fraga
RE: Dynamic Select combos with custom entities
January 5, 2012 9:28 AM
Answer

Emilio Jose Lamas Fraga

Rank: Junior Member

Posts: 42

Join Date: November 29, 2011

Recent Posts

Solved. I just forget to generate web services DD in service.xml... silly question!
Emilio Jose Lamas Fraga
RE: Dynamic Select combos with custom entities
March 5, 2012 7:26 AM
Answer

Emilio Jose Lamas Fraga

Rank: Junior Member

Posts: 42

Join Date: November 29, 2011

Recent Posts

Hi Murali,

The files attached in the first post are, indeed, working fine. The code from /js/service.js is embbeded in the view.jsp file (between the <aui:script> tags). The only code left are the methods in *ServiceImpl that retrieve the elements for each combo. (they just get organizations/suborganizations according to a custom field).

Feel free to ask if you have an especific problem emoticon

Regards.
Emilio Jose Lamas Fraga
RE: Dynamic Select combos with custom entities
March 6, 2012 4:33 AM
Answer

Emilio Jose Lamas Fraga

Rank: Junior Member

Posts: 42

Join Date: November 29, 2011

Recent Posts

Hi again,

I really didn't find any tutorial about Dynamic Select, but you can get to an example through this thread.

You also have another example (country/region) in the code at /portal-web/html/docroot/portlets/enterprise_admin/user/common/addresses.jsp. Try to emulate this code in your project and see what is different.

Good luck!

Regards.