Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Pablo Mosquera Sáenz
Using findAll() from view
February 22, 2008 3:14 AM
Answer

Pablo Mosquera Sáenz

Rank: Junior Member

Posts: 61

Join Date: January 22, 2008

Recent Posts

Hi, I have modified the way to create an account and I want to display a combo, with items form the "Provincia" entity

First I created the model creating a service.xml with the definitions to generate the model under com.ext.portlet.provincia

Then I modified the create_account.jsp

<%
List provincias = ProvinciaUtil.findAll();
%>

...

<td>
<%= LanguageUtil.get(pageContext, "provincia") %>
</td>
<td>
<select name="<portlet:namespace />provinciaId">
<option value=""></option>

<%
for (int i = 0; i < provincias.size(); i++) {
Provincia provincia = (Provincia)provincias.get(i);

provincia = provincia.toEscapedModel();
%>

<option value="<%= provincia.getProvinciaId() %>"><%= provincia.getDescripcion() %></option>

<%
}
%>

</select>
</td>


The problem is that in this way I get an exception because I dont manage persistence. The solution is to use the ProvinciaServiceUtil or ProvinciaLocalServiceUtil. But in these classes I cant see the method findAll(). Should I define the method in ProvinciaLocalServiceImpl to have the method in those classes?
Pablo Mosquera Sáenz
RE: Using findAll() from view
February 25, 2008 3:00 AM
Answer

Pablo Mosquera Sáenz

Rank: Junior Member

Posts: 61

Join Date: January 22, 2008

Recent Posts

I have solved my problem

http://www.liferay.com/web/guest/community/forums/message_boards/message/112293?_19_redirect=%2Fweb%2Fguest%2Fcommunity%2Fforums%3Fp_p_id%3D19%26p_p_action%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_19_struts_action%3D%252Fmessage_boards%252Fsearch%26_19_redirect%3D%26_19_breadcrumbsCategoryId%3D0%26_19_breadcrumbsMessageId%3D0%26_19_searchCategoryId%3D0%26_19_searchCategoryIds%3D0%26_19_threadId%3D0%26_19_tabs1TabsScroll%3D%26_19_keywords%3DLocalServiceUtil%2BfindAll&
http://www.liferay.com/web/guest/community/forums/message_boards/message/126438

Those links helped me

First, I added the method findAll to my *LocalServviceImpl and then I used the build-service target

Now I can use the findAll method from my *LocalServiceUtil and works fine