zwwcn

Just another WordPress.com site

WebRemote and Seam

Step 1: add webremote annotation for the specific method in local interface

@Local
public interface ProspectController extends StatefulController {

@WebRemote
public String createNewProspect();

}

Step 2:  create the javascript function

function showProspectPopUp(modelPanel,id){
Seam.Remoting.getContext().setConversationId(id);   //this is important: make sure the remote call is in the same conversation
Seam.Component.getInstance(“prospectController”).createNewProspect(null,exceptionHandler);
Richfaces.showModalPanel(modelPanel);
}

Step 3:  in jsf page, add the following:

<ui:define name=”js”>
<s:remote include=”prospectController”/>
<onepl:javascript src=”/js/main.js” cachebusting=”true”/>   //where the javascript function locates
</ui:define>

<h:outputLink onclick=”showProspectPopUp(‘prospPanel’,#{conversation.id});return false;”  value=””>test </h:outputLink>

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: