// this is where i am dynamically adding the horizontalpanel element
to the DOM.
public void editMode(Player player) {
                com.google.gwt.user.client.Element child = DOM.getElementById
("view_player_panel_"+player.getId().toString());
                com.google.gwt.user.client.Element parent = 
DOM.getParent(child);
                HorizontalPanel newChild = prepareEditPanel(player);
                DOM.removeChild(parent, child);
                DOM.appendChild(parent, newChild.getElement());
}
// this is where i construct the horizontal panel which is called from
the above method
protected HorizontalPanel prepareEditPanel(Player player){
                HorizontalPanel playerPanel = new HorizontalPanel();
                playerPanel.setStylePrimaryName("playerPanel");
                playerPanel.getElement().setId("edit_player_panel_"+player.getId
().toString());

                DateBox dateOfBirth = new DateBox();
                dateOfBirth.setValue(new Date());
                dateOfBirth.setFormat(new DateBox.DefaultFormat
(DateTimeFormat.getShortDateFormat()));
                dateOfBirth.getElement().setId("dateOfBirth_"+player.getId());
                playerPanel.add(dateOfBirth);
                td = DOM.getParent(dateOfBirth.getElement());
                td.setClassName("mediumText");

                Button saveButton = getSaveButton(player.getId());
                playerPanel.add(saveButton);
                td = DOM.getParent(saveButton.getElement());
                td.setClassName("mediumText");

                return playerPanel;

        }

On Aug 3, 4:05 pm, Isaac Truett <[email protected]> wrote:
> I would guess that you're using a String representation of the widgets
> instead of the widgets themselves. Could you post the code where you
> add your HorizontalPanel?
>
> On Mon, Aug 3, 2009 at 9:42 AM,
>
> [email protected]<[email protected]> wrote:
>
> > Hi,
>
> > I am trying to manipulate the DOM based on the response from the
> > server. After I receive a response from server, I am appending to DOM
> > a HorizantalPanel that contains a datebox ,a button and a few
> > textfields. The panel is appended perfectly but the datebox and the
> > button are not rendered completely meaning datebox appears as a
> > textfield and would not prompt the calendar when tabbing to it or
> > focusing on it. Similar is the situation with the Button, the click
> > handler on the button is never getting executed when clicking the
> > button.
>
> > I am thinking that after the DOM is manipulated to add these widgets,
> > the widgets have to be re-initialized but I am not sure how can we
> > achieve this.
>
> > Thanks.
> > Shyam
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to