ipeychev / liferay-aui-upgrade-tool

1 stars 1 forks source link

Add support for namespacing io request parameters #8

Closed robframpton closed 2 years ago

robframpton commented 11 years ago

Currently almost all io requests without namespaced parameters do not work. We should add functionality to add namespaces for io request parameters.

//Old IO request

A.io.request(
    url,
    {
        data: {
            userId: userId
        },
        dataType: 'json'
    }
);

//New IO request

A.io.request(
    url,
    {
        data: {
            <portlet:namespace />userId: userId
        },
        dataType: 'json'
    }
);

The fix will be different between JSP and JS files, the above example would fix an io request in a JSP. The following would be the fix for a JS file.

//Old IO request

A.io.request(
    url,
    {
        data: {
            userId: userId
        },
        dataType: 'json'
    }
);

//New IO request

A.io.request(
    url,
    {
        data: instance.ns(
            {
                userId: userId
            }
        ),
        dataType: 'json'
    }
);
ipeychev commented 11 years ago

This one we can implement, but it will be fragile - what if we have already in data: { ... } properly namespaced attributes?

robframpton commented 11 years ago

I think that we can maybe just leave this functionality out, Nate suggested that we notify the developers when they are executing an io request. Maybe some kind of a warning message that's commented out in the code.

On Tue, Aug 27, 2013 at 11:12 PM, Iliyan Peychev notifications@github.comwrote:

This one we can implement, but it will be fragile - what if we have already in data: { ... } properly namespaced attributes?

— Reply to this email directly or view it on GitHubhttps://github.com/ipeychev/liferay-aui-upgrade-tool/issues/8#issuecomment-23393483 .