Hi!
Describe my efforts:
- After selecting several values and pressing the “Send checkbox data” button, I see the following query:
var formData = {
"autputSyntax": "plain",
"cbData": [
"Alvaro",
"Brandon"
],
"xpage": "plain"
};
$.post('http://xwiki.censored.com/xwiki/bin/view/Code/ServiceDocument', formData)
.done (showResult)
.fail(showError);
{
"frameId": 0,
"initiator": "http://xwiki.censored.com",
"method": "POST",
"parentFrameId": -1,
"requestBody": {
"formData": {
"autputSyntax": [
"plain"
],
"cbData": [
"Alvaro",
"Brandon"
],
"xpage": [
"plain"
]
}
},
"requestId": "375832",
"tabId": 1612,
"timeStamp": 1549962017587.2048,
"type": "xmlhttprequest",
"url": "http://xwiki.censored.com/xwiki/bin/view/Code/ServiceDocument"
}
- I created a terminated page
http://xwiki.censored.com/xwiki/bin/view/Code/ServiceDocument
- Added
JavaScriptExtension
object
- Entered this code:
require(['jquery'], function ($) {
var Target = $('#checkboxService')
var Launcher = $('#GetJson')
var Url = new XWiki.Document('cbResults','DatabaseInventory').getURL('get');
var UrlParams = { 'xpage': 'plain','outputSyntax': 'plain' };
Launcher.click(function(){
$.get( Url, UrlParams, function( data ) {
$( Target )
.append( "Вибрано: " + data.cbData );
}, "json" );
});
});
What else needs to be done, for example, to display the list of selected values on the resulting page?
Thanks.