@Override protected void savePeriodGroup() { // put the widget values into the hash to pass down in the POST HashMap<String, Object> keys = new HashMap<String, Object>(); keys.put("_method", "put"); keys.put("complete", cmp.getValue()); keys.put("handle", handle); JSONRequest.post( "/scheduler/electives/" + Integer.toString(id), keys, new JSONCallbackAdapter() { @Override public void onSuccess(JSONObject json) { // get back from the server this elective & display it again getPeriodGroup(); } }); }
public void updateKeys(HashMap<String, Object> data) { Set<String> keys = data.keySet(); ArrayList<String> strKeys = new ArrayList<String>(); ArrayList<String> strValues = new ArrayList<String>(); for (Object k : keys) { strKeys.add(k.toString()); strValues.add(data.get(k).toString()); } strKeys.add("tz"); strValues.add(schedule.getTimeZone()); StringBuilder urlData = new StringBuilder(); urlData.append(rootUrl); urlData.append("?"); urlData.append( JSONRequest.kv2url(strKeys.toArray(new String[] {}), strValues.toArray(new String[] {}))); RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, urlData.toString()); proxy.setBuilder(builder); }