PDA

View Full Version : Integrating GXT to existing dynamic page.



Mike Chaliy
23 May 2009, 2:46 AM
I am trying to add custom panel to the existing DIV.

This is my panel.



public class FiltersPanel extends FlowPanel {
public FiltersPanel() {
FormPanel form = new FormPanel();

TextField<String> firstName = new TextField<String>();
firstName.setName("Name");
firstName.setAllowBlank(false);

form.add(firstName);
add(form);

TextBox firstName2 = new TextBox();
add(firstName2);
}
}


This is code to instantiate.



public void initFilters() {
Element filtersContainer = getFiltersContainer(); // This returns existing DIV.
filtersContainer.setInnerHTML("");
FiltersPanel p = new FiltersPanel();
Element filtersElement = p.getElement();
filtersContainer.appendChild(filtersElement);
}


Results are TextBox firstName2 is visible, however neither FormPanel nor TextField are visible. They are not even in DOM.

I am newbie in this field and possible that my way to instantiate is wrong. Please suggest right way.

I am using 2.0 M1.