Form submit via AJAX. for simple post submission remove fun-setAJAX attribute:-
<form id="form2" runat="server" class="form-horizontal" fun-setAJAX="" action="## { getAppURL('customer') } #">
<label for="txtaddress">Address</label>
<input id="txtaddress" runat="server" type="text" dfield="txtaddress" fui-setForm="form2" fun-setMsgName="Address" fui-setRequired="" fui-setMinLen="4" fui-setMaxLen="8" />
<input type="submit" value="Submit" />
</form>
Submit Control value via AJAX on JS Event keyup use of fun-submitAJAX="keyup" attribute. It will be post txtname value automatically to server.
By default post back to current application, so change url use second parameter:-
Third parameter for post extra values. It is comma separated list of html tag id like above code post txtstate control
<span id="spn2"></span>
<input id="txtstate" runat="server" type="text" dfield="txtstate" />
<input id="txtname" runat="server" type="text" dfield="cust_address" fun-submitAJAX="keyup" fui-setForm="form1" fun-setMsgName="Name" fui-setRequired="" fui-setMinLen="4" fui-setMaxLen="8" />
Server Side App code to handle Event:-
public function page_event_txtname_keyup($evtp) {
$this->JSServer->addJSONHTMLBlock("spn2","Server is reading:- " . $this->home_front1->txtname->value);
$this->JSServer->addJSONHTMLBlock("txtstate","Ontario");
}
Fill Select Box from Server Via AJAX
<select id="sltstate" runat="server" fun-submitAJAX="change" fun-setOptions="first,2nd,3rd"></select>
<select id="sltcity" runat="server" fun-setOptions="first1,first2"></select>
Server Side App Code to handle Event:-
public function page_event_sltstate_change($evtp){
$lst = "first1,first2";
switch($this->home_front1->getComponent('sltstate')->value){
case "2nd":{
$lst = "2nd1,2nd2";
break;
}
case "3rd":{
$lst = "3rd1,3rd2";
break;
}
}
$this->home_front1->getComponent('sltcity')->setOptions($lst);
$this->JSServer->addJSONCompChildren($this->home_front1->getComponent('sltcity'),"sltcity");
}
<div id="pagi1" lrunat="server" path="libpath/comp/data/Pagination.php" fun-setFieldNames="txtcolname" fun-setHeaderNames="Colname" fun-setColWidths="100%" dtable="car_color" fun-setAJAX="" >
<div class="col" runas="holder" data-comp="pagi1" dfield="txtcolname"></div>
<span>## { $this->tempobj->pagi1->getRow('id') } #</span>
</div>
<div id="pagebar"># { $this->tempobj->pagi1->getPageBar() } #</div>
// send Control object via AJAX and display html output inside showall id of tag
$showall = $this->showallTemp->getComponent('showall');
$this->JSServer->addJSONComp($showall, 'showall');
//send html code inside pagebar tag
$this->JSServer->addJSONHTMLBlock( 'pagebar', $showall->getPageBar());
// send temp file object via AJAX and display html output inside listformholder div tag
$this->JSServer->addJSONTemp($this->showallTemp, 'listFormHolder');
// send JS Code via AJAX
$this->JSServer->addJSONJSBlock('runanierr("success");');
//custom type declaration for JS code
$this->JSServer->addJSONBlock('jsp','proces','$( "#showall_dlg" ).dialog( "close" );');