Ajax Macro Sample
Last modified by Clemens Robbenhaar on 2022/11/02
This sample Ajax Macro class shows some delayed loading on demand or automatically
On demand loading with custom message
https://xwikiorg-front.xwikisas.com/xwiki/bin/view/Macros/AjaxMacro?page=Macros.AjaxMacroSample&contextpage=&id=1&xpage=plain&outputSyntax=plain
{{ajax id="1" auto="false" message="click this link to load the content of this div"}}
This content is loaded on demand and can contain **wiki syntax**
{{/ajax}}
This content is loaded on demand and can contain **wiki syntax**
{{/ajax}}
Automatic loading
Loading...
https://xwikiorg-front.xwikisas.com/xwiki/bin/view/Macros/AjaxMacro?page=Macros.AjaxMacroSample&contextpage=&id=2&xpage=plain&outputSyntax=plain
{{ajax id="2" auto="true"}}
This content is loaded automatically and can contain **wiki syntax**
{{/ajax}}
This content is loaded automatically and can contain **wiki syntax**
{{/ajax}}
Automatic loading of external page
Loading...
https://xwikiorg-front.xwikisas.com/xwiki/bin/view/Macros/AjaxMacro?page=Macros.AjaxMacroSampleContent&contextpage=&id=&xpage=plain&outputSyntax=plain
{{ajax id="3" page="Macros.AjaxMacroSampleContent" auto="true" /}}
Automatic loading of external URL
Loading...
http://localhost:8080/xwiki/bin/view/Macros/AjaxMacroSampleContent?xpage=plain
{{ajax id="4" url="http://localhost:8080/xwiki/bin/view/Macros/AjaxMacroSampleContent?xpage=plain" auto="true" /}}
Automatic loading with appending
This sample shows a what's new box loaded in AJAX with a "more" button to load additional data:
https://xwikiorg-front.xwikisas.com/xwiki/bin/view/Macros/AjaxMacro?page=Macros.AjaxMacroSampleContent2&contextpage=&id=&xpage=plain&outputSyntax=plain&nb=2
{{ajax id="5" page="Macros.AjaxMacroSampleContent2" auto="true" append="true" nb="2" message="More documents" loadingmessage="Loading... please wait" /}}
Automatic loading with include
https://xwikiorg-front.xwikisas.com/xwiki/bin/view/Macros/AjaxMacro?page=Macros.AjaxMacroSample&contextpage=&id=6&xpage=plain&outputSyntax=plain