JSONObject responseDetailsJson = new JSONObject(); List<JSONObject> list = new ArrayList<JSONObject>(); System.out.println(form.size()); // List.get will be very inefficient if passed a LinkedList // instead of an ArrayList. for (Form formInstance:form) { JSONObject formDetailsJson = new JSONObject(); formDetailsJson.put("form_id", formInstance.getId()); formDetailsJson.put("form_name", formInstance.getName()); formDetailsJson.put("desc", formInstance.getFormDescription()); list.add(formDetailsJson); } responseDetailsJson.put("form", list);
public FormPanel(String id, Form<?> form) { super(id, () -> "<form wicket:id='" + form.getId() + "'><div wicket:id='" + ID_FORM_BODY + "'></div><wicket:child/></form>"); add(form .add(newFormBody(ID_FORM_BODY))); }
public FormPanel(String id, Form<?> form) { super(id, () -> "<form wicket:id='" + form.getId() + "'><div wicket:id='" + ID_FORM_BODY + "'></div><wicket:child/></form>"); add(form .add(newFormBody(ID_FORM_BODY))); }
final Kml kml = new Kml(); Document document = kml.createAndSetDocument(); listForms = formDAO.getAll(); for (Form list : listForms){ document.createAndAddPlacemark() .withName(String.valueOf(list.getId())) .withDescription(list.toStringKML()) .createAndSetPoint().addToCoordinates(-20.3978398, -43.5146653); } kml.setFeature(document); kml.marshal(new File("test.kml"));
/** * @param form * @param tag * @return */ private String verifyFormName(Form form, ComponentTag tag) { IValueMap attributes = tag.getAttributes(); String value = attributes.getString("name"); if (value == null) { value = form.getId(); tag.put("name", value); } return value; }
/** * @param form * @param tag * @return */ private String verifyFormName(Form<?> form, ComponentTag tag) { IValueMap attributes = tag.getAttributes(); String value = attributes.getString("name"); if (value == null) { value = form.getId(); tag.put("name", value); } return value; }
getId()); tag.put("method", METHOD_POST.toLowerCase(Locale.ROOT));
getId()); tag.put("method", METHOD_POST.toLowerCase(Locale.ROOT));