Foros de discusión
dynamic dropdownlist alloyui
Arnold Kevin Wenger, modificado hace 9 años.
dynamic dropdownlist alloyui
New Member Mensajes: 9 Fecha de incorporación: 15/09/14 Mensajes recientes
Hi,
I’m trying to make a dynamic dropdownlist.
I create a list of strings in my java class.
That list need to be send to my portlet preferences and fill up a dropdownlist and when I select a value it needs to be saved.
So that i can use the value in the future(cross user)
Biggest problem this point is how to fill that dropdown list.
Any idea's?
I’m trying to make a dynamic dropdownlist.
I create a list of strings in my java class.
That list need to be send to my portlet preferences and fill up a dropdownlist and when I select a value it needs to be saved.
So that i can use the value in the future(cross user)
Biggest problem this point is how to fill that dropdown list.
Any idea's?
public List<string> generateList(ActionRequest actionRequest, ActionResponse actionResponse)
{
ServiceContext serviceContext = null;
try {
serviceContext = ServiceContextFactory.getInstance(Group.class.getName(), actionRequest);
} catch (PortalException | SystemException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
//Filling the layout(template) list.
List<layoutsetprototype> layoutSetPrototypes = null;
try {
layoutSetPrototypes = LayoutSetPrototypeServiceUtil.search(serviceContext.getThemeDisplay().getCompanyId(),Boolean.TRUE, null);
} catch (PortalException | SystemException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LayoutSetPrototype layoutSetPrototype = null;
List<string> Layoutnames = null;
for(int index = 0; index < layoutSetPrototypes.size(); index++)
{
layoutSetPrototype = layoutSetPrototypes.get(index);
Layoutnames.add(layoutSetPrototype.getName());
}
return Layoutnames;
}
</string></layoutsetprototype></string>
Madhava Venganapalli, modificado hace 9 años.
RE: dynamic dropdownlist alloyui
Junior Member Mensajes: 26 Fecha de incorporación: 5/06/13 Mensajes recientes
Example how to get list of countries to the drop down.
same way you have to get list of values and you have to iterate using for each loop.
<c:set value="<%= countryId %>"/>
<aui:select name="countryId" id="countryId" label="" inlineField="true" >
<c:forEach items="${countries}" var="lstType">
<c:choose>
<aui:option value="${lstType.countryId}" selected="true"> ${lstType.name} </aui:option>
</c:choose>
</c:forEach>
</aui:select>
Regards,
Madhava Venganapalli
same way you have to get list of values and you have to iterate using for each loop.
<c:set value="<%= countryId %>"/>
<aui:select name="countryId" id="countryId" label="" inlineField="true" >
<c:forEach items="${countries}" var="lstType">
<c:choose>
<aui:option value="${lstType.countryId}" selected="true"> ${lstType.name} </aui:option>
</c:choose>
</c:forEach>
</aui:select>
Regards,
Madhava Venganapalli