cancel
Showing results for 
Search instead for 
Did you mean: 

Execute a Seam component

zyx974_
Confirmed Champ
Confirmed Champ

Hello,

I try to execute the "deleteActions" component from within a class extending "AbstractWork" like this :

return (DeleteActions) SeamComponentCallHelper.getSeamComponentByName("deleteActions");

But this throw the exception bellow :

java.lang.IllegalStateException: No application context active
    at org.jboss.seam.Component.forName(Component.java:1902)
    at org.nuxeo.ecm.platform.ui.web.util.SeamComponentCallHelper.getSeamComponentByName(SeamComponentCallHelper.java:73)

I try the code below to activate the application context, without success:

Contexts.getApplicationContext();

Is it the good way to call a seam component ?

Thank you.

1 ACCEPTED ANSWER

ataillefer_
Star Contributor
Star Contributor

Hi,

You should not try to use a Seam component outside of an active Seam context, as mentioned in the logs. An active Seam context could be: inside another Seam component (in which you could inject deleteActions with @In), in a facelet (XHTML) within an EL expression or in any place where EL expressions are allowed.

In your case you might want to directly use some API called by the Seam component, for instance TrashService.

View answer in original post

2 REPLIES 2

ataillefer_
Star Contributor
Star Contributor

Hi,

You should not try to use a Seam component outside of an active Seam context, as mentioned in the logs. An active Seam context could be: inside another Seam component (in which you could inject deleteActions with @In), in a facelet (XHTML) within an EL expression or in any place where EL expressions are allowed.

In your case you might want to directly use some API called by the Seam component, for instance TrashService.

TrashService works here.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.