Thursday, October 23, 2008

submitting data from formPanel gxt

There is always a requirement to get all the data from the forms and have it stored in database or displayed some where else. Instead of actually getting the data component by component gxt can actually get all the data at once using the "getFields" method in FormPanel. This method returns a List of all the fields that are present in the form, and then iterating over the fields we can extract the values based on the way it is rendered on the form. Eg: FormPanel formPanel = new FormPanel(); //creating a formPanel List field = formPanel.getFields(); //getting a list of all the fields in the formpanel for (Field f : field) // Iterating over the list f.getValue(); // value for all components in the formPanel }

No comments: