:: Forum >>

how to send the value of controls to the server

Hi every body, i'd like to ask about the way to send the value of each control( input, selected node in tree, value of the checkbox.. ).

please send me some code
aStar
Friday, February 9, 2007
using activewidgets visual components or normal html elements?

switch(answer) {
case 1:
"more details please";
break;
case 2:
"www.google.com";
break;
}
Pc (from Brazil)
Friday, February 9, 2007
hi pc, i mean the first 'active widgets component'.
let me explain, i design a jsp page and then add activewidgets components to it like tree, checkedlist, combobox, checkbox,..... when pressing submit button i want to send the value of each component to the server, how to do this,
note: i'm a new user to activewidget.
Saturday, February 10, 2007
Ok, now i can help u.

AW Visual Components re javascript based, that mean the form will not serialize yours components to send in request, but we know tricks to do that, example:

<form onSubmit="return processAWComponents(this)">
<input type="submit" value="Send Form">
<span id="AW-name"/>
</form>
<script>
var global_objs = new Array();
var obj = new AW.UI.Input;
obj.setId("AW-name");
obj.refresh( );
global_objs.push(obj);

function processAWComponents(frm) {
var el = null;
var c = null;
for(var i=0;i<global_objs.size();i++) {
el = global_objs.getId().substring(3);
if(document.getElementById('el') != null) continue;
c = document.createElement("input");
c.setAttribute("type", "hidden");
c.setAttribute("value", el.getControlText());
frm.appendChild( c );
}
return true;
}
</script>
Pc (from Brazil)
Sunday, February 11, 2007
Oops, my mistake, change:

<form onSubmit="return processAWComponents(this)">
<input type="submit" value="Send Form">
<span id="AW-name"/>
</form>
<script>
var global_objs = new Array();
var obj = new AW.UI.Input;
obj.setId("AW-name");
obj.refresh( );
global_objs.push(obj);

function processAWComponents(frm) {
var el = null;
var c = null;
for(var i=0;i<global_objs.size();i++) {
el = global_objs[i].getId().substring(3);
if(document.getElementById('el') != null) continue;
c = document.createElement("input");
c.setAttribute("type", "hidden");
c.setAttribute("value", global_objs[i].getControlText());
frm.appendChild( c );
}
return true;
}
</script>
Pc (from Brazil)
Sunday, February 11, 2007
thank you very much PC.
Sunday, February 11, 2007

This topic is archived.


Back to support forum

Forum search