I created a java backed webscript that return an object which I created :
Map<String, Object> model = new HashMap<String, Object>();
model.put("value", n); // n object has diffrent attributes.
How can I call this object from javascript to use the attributes ?
You can call using webscript url by Alfresco.util.Ajax.request
according to the type of webscript.
Are there any examples I can follow ?
Thanks.
Alfresco.util.Ajax.request(
{
url: Alfresco.constants.URL_SERVICECONTEXT + "ur/of/web/service",
dataObj:
{
htmlid: this.id
},
successCallback:
{
fn: this.onTemplateLoaded,
scope: this
},
execScripts: true,
failureMessage: "Could not load create site template"
});
I am supposed to put the url in the description file and that's it ?
and what is the variable that i can use to get the data from ?
Thanks
Hello,
const filterValue = page.url.args["filter"]; // get url parameters const connector = remote.connect("alfresco"); const resultStr = connector.get("/PUT_YOUR_WEBSCRIPT_URL_HERE?filter=" + filterValue); // create json object from data const resultJson = jsonUtils.toObject(resultStr); model.data = resultJson["value"];
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.