掲示板

Onchange event on a dropdown list

thumbnail
15年前 に Venkat Kumar によって更新されました。

Onchange event on a dropdown list

New Member 投稿: 9 参加年月日: 08/04/10 最新の投稿
Hi All,

i am new to liferay.

I have a dropdown menu contains all the oraganizations in the system.

one more dropdown is there for users.

i want select an organization in the fisrt dropdown list,then all the users in that organization will come in second dropdowm list.

Any help.

Thanks in adavance.
Venkat
thumbnail
15年前 に Zankar Shah によって更新されました。

RE: Onchange event on a dropdown list

Regular Member 投稿: 106 参加年月日: 07/10/03 最新の投稿
Hi,
In order to get the first drop down, u can use the existing liferay method
OrganizationLocalServiceUtil.search

Then after some one select any organization from first drop down, post again and get the users for that organization using

UserLocalServiceUtil.search method

Thanks
Zankar
thumbnail
15年前 に Venkat Kumar によって更新されました。

RE: Onchange event on a dropdown list

New Member 投稿: 9 参加年月日: 08/04/10 最新の投稿
Thanks for reply.


Is there any mechanism without submitting the form can we get the second list to be populated by using ajax or can we able to call Java method from javascript.

Thanks
Venkat
thumbnail
15年前 に Zankar Shah によって更新されました。

RE: Onchange event on a dropdown list

Regular Member 投稿: 106 参加年月日: 07/10/03 最新の投稿
Ya sure we can use doing ajax in liferay. Liferay provides AjaxUtil for doing all kind of partial submit and other feature. check the following example code

var message = Liferay.Popup(
{
width: 350,
height: 300,
modal: true,
title: "Share"
});

url = "ur post url";

AjaxUtil.update(url, message, {onComplete: function() {Liferay.Popup.center()}});
14年前 に chandra sekhar によって更新されました。

RE: Onchange event on a dropdown list

Regular Member 投稿: 149 参加年月日: 09/07/07 最新の投稿
Hi Zankar Shah ,

Can you expain in detail about how to populate dropdown from selection of another dropdown list using ajax.

Thanks in advance.


Regads,
chandra sekhar
8年前 に Nagaraju Uppalapati によって更新されました。

RE: Onchange event on a dropdown list

New Member 投稿: 24 参加年月日: 15/06/29 最新の投稿
Could you please provide the solution for this.