Commenting: electronic.alchemy
electronic.alchemy
where the past meets the future

Commenting: pike/fins/widget/ComboPicker widget

Here's a sample of how you'd use the ComboPicker widget. This assumes you've unzipped the fins widget directory (download )at the same location that dojo.js is located (that is, dojo.js, src/ and fins/ are all in the same directory).

<script type='text/javascript'>
  djConfig = {
    isDebug : true
  };

</script> <script src="/static/javascripts/dojo.js"></script> <script type='text/javascript'>

dojo.hostenv.setModulePrefix("fins.widgets", "../fins/widgets" );

dojo.require("fins.widget.*");

function getMembers() { var res = null;

var bindArgs = { url: "/admin/getusers_json/" + "<%$group.id%>" , mimetype: "text/plain", sync: true, error: function(type, errObj){ }, load: function(type, data, evt){ // handle successful response here res = dojo.json.evalJSON(data.toString()); res = res.data; } };

// dispatch the request var requestObj = dojo.io.bind(bindArgs);

return res; }

function getAvailable() { var res = null;

var bindArgs = { url: "/admin/getusers_json/", mimetype: "text/plain", sync: true, error: function(type, errObj){ }, load: function(type, data, evt){ // handle successful response here res = dojo.json.evalJSON(data.toString()); res = res.data; } };

// dispatch the request var requestObj = dojo.io.bind(bindArgs);

return res; }; </script>

<form action="someaction"> <div dojoType="ComboPicker" loadAvailableFunction="getAvailable" loadMembersFunction="getMembers" addsId="added" removesID="removed"></div> <input type="submit" value="Save"/> </form>

Name:
Email:
Website:
Authenticate: