[
http://jira.jboss.com/jira/browse/JBSEAM-1989?page=all ]
Shane Bryzak closed JBSEAM-1989.
--------------------------------
Resolution: Done
An empty page context is now created for remoting requests
No pages context exists during a remoting request
-------------------------------------------------
Key: JBSEAM-1989
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1989
Project: JBoss Seam
Issue Type: Bug
Components: Remoting
Affects Versions: 2.0.0.CR1
Reporter: Shane Bryzak
Assigned To: Shane Bryzak
Fix For: 2.0.0.GA
This was brought to my attention by Christian - page-scoped components such as the
following cannot be invoked with remoting as the page context no longer exists during a
remoting request. Upon further investigation it seems that PageContext uses FacesContext
(which isn't available for a non-JSF remoting request) so it's not just a trivial
matter of creating a new PageContext for the request. The fix for this could potentially
be tied in with JBSEAM-280.
@Name("wikiTextEditor")
@Scope(ScopeType.PAGE)
public class WikiTextEditor
{
private String textAreaSize;
@WebRemote
public void setTextAreaSize(String textAreaSize)
{
this.textAreaSize = textAreaSize;
}
public String getTextAreaSize()
{
return textAreaSize;
}
}
Javascript code to invoke the above component:
<script type="text/javascript"
src="#{wikiPreferences.baseUrl}/seam/resource/remoting/interface.js?wikiTextEditor"></script>
<script type="text/javascript">
/* Set text area resize on backing bean */
Seam.Remoting.displayLoadingMessage = function() {};
Seam.Remoting.hideLoadingMessage = function() {};
var wikiTextEditor = Seam.Component.getInstance("wikiTextEditor");
function storeTextAreaSize(size) {
wikiTextEditor.setTextAreaSize(size, noopCallback);
}
function noopCallback() {}
</script>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira