掲示板

Service Builder and JSF

11年前 に Thomas Graefenhain によって更新されました。

Service Builder and JSF

New Member 投稿: 4 参加年月日: 12/10/02 最新の投稿
Hi,

I'm new to Liferay and JSF so please forgive me if my question seems to be stupid. I've used the Service Builder from Liferay 6.1.1 within Eclipse Juno to build a Service. Everything works fine when using from a JSP as follows

<% for (Groups group :  GroupsLocalServiceUtil.getGroupses(-1, -1)) { %>
    <div class="portlet-msg-info">
        name: &lt;%= group.getName() %&gt;!<br>
        description: &lt;%= group.getDescription() %&gt;!
    </div>
&lt;% } %&gt;


But I can't use my Service from JSF.

<h:outputtext value="#{groupsLocalServiceUtil.groupses[-1][-1]}" />


I added GroupsLocalServiceUtil at faces-config.xml but all I get is a Property 'groupses' not found. (I know that outputText and a Collection is not the correct way to display the contents) I was able to display a self written Managed Bean with JSF, but the local Service from the Service Builder doesn't work.

Any help is appreciated
Thomas
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Service Builder and JSF (回答)

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Sorry for the bad content before, didn't get the custom service thing...

The GroupsLocalServiceUtil has a public static method, getGroupses().

Since it is not a standard java bean, you cannot use simple jsf syntax groupses[-1][-1] because there really is no member groupses of the managed bean groupsLocalServiceUtil.
11年前 に Thomas Graefenhain によって更新されました。

RE: Service Builder and JSF

New Member 投稿: 4 参加年月日: 12/10/02 最新の投稿
Hi David,

thank you for the quick response. So there is no way to use the GroupsLocalServiceUtil in JSF? Or should I use Javascript to access the service.

Greetings Thomas
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Service Builder and JSF (回答)

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
You can use it, you just can't use java bean syntax. Use the same syntax you used in the JSP example, as it shouldn't be a managed bean either.
thumbnail
11年前 に Neil Griffin によって更新されました。

RE: Service Builder and JSF

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
I would recommend that you look at UsersModelBean.java and view.xhtml from the icefaces3-users-portlet for an example of how to display results of static Liferay utility methods in a Facelet view. UserLocalServiceUtil is a class generated by ServiceBuilder just like GroupLocalServiceUtil.
11年前 に Thomas Graefenhain によって更新されました。

RE: Service Builder and JSF

New Member 投稿: 4 参加年月日: 12/10/02 最新の投稿
Hi Neil,

thanks for pointing me to the right classes and jsf. I just realized that writing a bean should be the right way to access the services. BTW. thank you for your great work and support.

Thomas
thumbnail
11年前 に Neil Griffin によって更新されました。

RE: Service Builder and JSF

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Hi Thomas,

My pleasure, and thanks so much for the kind words. emoticon

Neil