3.2.0

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
February 9,
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)
February 9,
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.
February 10,
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)
February 11,
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)
February 11,
thank you very much PC.
February 11,

This topic is archived.

See also:


Back to support forum