Fórum

Retrieve all the record in a dropdown box.

sunil kumar biswal, modificado 11 Anos atrás.

Retrieve all the record in a dropdown box.

New Member Postagens: 19 Data de Entrada: 25/03/12 Postagens Recentes
Good evening all of my liferay friends.I hav to retrieve all of my records of a column and that should be placed in a drop down box.
thumbnail
Jay Patel, modificado 11 Anos atrás.

RE: Retrieve all the record in a dropdown box.

Regular Member Postagens: 118 Data de Entrada: 24/02/10 Postagens Recentes
Hi Sunil,

This depends on your exact requirements.

If your table is created with service-builder then you can use XXXLocalServiceUtil & get the desired value in your Portlet class & then can pass it on to JSP.

-Jay.
thumbnail
Tonu Sri, modificado 11 Anos atrás.

RE: Retrieve all the record in a dropdown box.

Regular Member Postagens: 197 Data de Entrada: 15/04/11 Postagens Recentes
Hi Sunil,

Get the list from the database either using Liferay Service Builder Approach or you can use your own class.
Display List content in Select box.

Thanks:
thumbnail
Rewati Raman, modificado 11 Anos atrás.

RE: Retrieve all the record in a dropdown box.

Junior Member Postagens: 97 Data de Entrada: 24/02/12 Postagens Recentes
Hi Sunil,

sunil kumar biswal:
Good evening all of my liferay friends.I hav to retrieve all of my records of a column and that should be placed in a drop down box.


if u have created the table using service builder
You just need to fetch the table content by


<select name="">
<option value="">-------Select-----</option>
&lt;%
List  list=entityNameUtil.findAll();
for(entityName item:list){
%&gt;
      <option value="<%=item.getColumnName()%>">&lt;%=item.getColumnName()%&gt;</option>
&lt;%
}
</select>
%&gt;


it works for me

Regards,
Rewati Raman