Topic
  • 5 replies
  • Latest Post - ‏2012-11-19T15:44:20Z by TahaSaghir
TahaSaghir
TahaSaghir
7 Posts

Pinned topic AJAX request using backchannel action URL failed in contained model

‏2012-11-15T08:36:52Z |
Hello All,

I am developing an application using WEF 8. Architecture of my application is as follows:

1. There's a model called "Controller" - having a model container builder, containing "Forms" model
2. In "Forms" model - linked model builder is linking to "Sync" model
3. "Sync" model has an action list called "synchronized", which returns a page
4. In "Forms" model I have a button builder on which I am executing following script to send AJAX request to "synchronized" action list
5. Controller model is my portlet

var serverUrl = '<%= webAppAccess.getBackchannelActionURL("sync.synchronize", false) %>';
dojo.xhrGet({
url: serverUrl,
content: null,
load: function(response) {
console.log(response);
},
error: function(error) {
alert("Request failed: "+error);
}
});
It works fine on executing "Forms" model standalone - on running it as a portlet on Portal 8.0 the AJAX request returns successfully, but response object is empty.
Updated on 2012-11-19T15:44:20Z at 2012-11-19T15:44:20Z by TahaSaghir
  • TahaSaghir
    TahaSaghir
    7 Posts

    Re: AJAX request using backchannel action URL failed in contained model

    ‏2012-11-15T08:40:10Z  
    In point 3 and 4 there's a typo - action list is "synchronize" not "synchronized"
  • TahaSaghir
    TahaSaghir
    7 Posts

    Re: AJAX request using backchannel action URL failed in contained model

    ‏2012-11-16T13:47:38Z  
    In point 3 and 4 there's a typo - action list is "synchronize" not "synchronized"
    I have simplified it - Now there's a link in "Controller" which is sending AJAX request to the method in same model, using above script. Its still not working.
  • kevintap
    kevintap
    747 Posts

    Re: AJAX request using backchannel action URL failed in contained model

    ‏2012-11-16T13:57:49Z  
    I have simplified it - Now there's a link in "Controller" which is sending AJAX request to the method in same model, using above script. Its still not working.
    It would help if you could post a simple set of sample models that demonstrates the problem you're seeing.

    The other suggestions that I have for debugging this would be to look at the network traffic in your application using Firebug, Chrome, Fiddler, etc. I would also suggest checking out the app server logs for any errors, including the app server's SystemOut.log/SystemErr.log as well as the logs in the WEF application's WEB-INF/logs directory. It's possible that your URL is properly connecting to the server and encountering some error on the server side which may be shown in these logs.
    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
  • TahaSaghir
    TahaSaghir
    7 Posts

    Re: AJAX request using backchannel action URL failed in contained model

    ‏2012-11-16T14:08:47Z  
    • kevintap
    • ‏2012-11-16T13:57:49Z
    It would help if you could post a simple set of sample models that demonstrates the problem you're seeing.

    The other suggestions that I have for debugging this would be to look at the network traffic in your application using Firebug, Chrome, Fiddler, etc. I would also suggest checking out the app server logs for any errors, including the app server's SystemOut.log/SystemErr.log as well as the logs in the WEF application's WEB-INF/logs directory. It's possible that your URL is properly connecting to the server and encountering some error on the server side which may be shown in these logs.
    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
    Thanks for your response and suggestion!

    Sure I can post the simplified version. No logs are being generated - I have a SystemOut in method and there's no any exception.

    I am observing a weird behavior - it doesn't work on opening the portlet for the first time then I refreshed the page, there's following error:
    The error message returned was: "Invalid action or model key c3d8f23_poc/Controller in URL.".
    Then I refreshed the page again and its working.
  • TahaSaghir
    TahaSaghir
    7 Posts

    Re: AJAX request using backchannel action URL failed in contained model

    ‏2012-11-19T15:44:20Z  
    Thanks for your response and suggestion!

    Sure I can post the simplified version. No logs are being generated - I have a SystemOut in method and there's no any exception.

    I am observing a weird behavior - it doesn't work on opening the portlet for the first time then I refreshed the page, there's following error:
    The error message returned was: "Invalid action or model key c3d8f23_poc/Controller in URL.".
    Then I refreshed the page again and its working.
    I was having this issue because I am running my portlet as a anonymous user. Setting com.ibm.portal.public.session to true from IBM WebSphere admin console did the trick.