PDA

View Full Version : Anyway to add a formpanel in a formpanel?



TheBuzzer
26 Jun 2009, 12:43 PM
I have a form in a form that is made for uploading files. in my gwt project.

I am trying to convert the project to gxt and realized I could not add a formpanel inside a form.

The new formpanel is for handling uploads

I get this problem


[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (Error): Invalid source HTML for this operation.
number: -2146827687
description: Invalid source HTML for this operation.
at com.extjs.gxt.ui.client.core.Template.appendInternal(Native Method)
at com.extjs.gxt.ui.client.core.Template.insert(Template.java:165)
at com.extjs.gxt.ui.client.widget.layout.FormLayout.renderField(FormLayout.java:269)
at com.extjs.gxt.ui.client.widget.layout.FormLayout.renderComponent(FormLayout.java:233)
at com.extjs.gxt.ui.client.widget.Layout.renderAll(Layout.java:247)
at com.extjs.gxt.ui.client.widget.Layout.onLayout(Layout.java:228)
at com.extjs.gxt.ui.client.widget.layout.AnchorLayout.onLayout(AnchorLayout.java:77)
at com.extjs.gxt.ui.client.widget.Layout.layout(Layout.java:96)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:348)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:444)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:241)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:364)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:444)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:241)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:364)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:444)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:241)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:427)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:236)
at com.extjs.gxt.ui.client.widget.HorizontalPanel.onRender(HorizontalPanel.java:163)
at com.extjs.gxt.ui.client.widget.Component.render(Component.java:892)
at com.extjs.gxt.ui.client.widget.Layout.renderComponent(Layout.java:256)
at com.extjs.gxt.ui.client.widget.layout.FlowLayout.renderComponent(FlowLayout.java:110)
at com.extjs.gxt.ui.client.widget.Layout.renderAll(Layout.java:247)
at com.extjs.gxt.ui.client.widget.Layout.onLayout(Layout.java:228)
at com.extjs.gxt.ui.client.widget.layout.FlowLayout.onLayout(FlowLayout.java:102)
at com.extjs.gxt.ui.client.widget.Layout.layout(Layout.java:96)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:348)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:444)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:241)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:364)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:444)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:241)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:364)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:444)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:241)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:427)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:236)
at com.extjs.gxt.ui.client.widget.VerticalPanel.onRender(VerticalPanel.java:158)
at com.extjs.gxt.ui.client.widget.Component.render(Component.java:892)
at com.extjs.gxt.ui.client.widget.Layout.renderComponent(Layout.java:256)
at com.extjs.gxt.ui.client.widget.layout.FlowLayout.renderComponent(FlowLayout.java:110)
at com.extjs.gxt.ui.client.widget.Layout.renderAll(Layout.java:247)
at com.extjs.gxt.ui.client.widget.Layout.onLayout(Layout.java:228)
at com.extjs.gxt.ui.client.widget.layout.FlowLayout.onLayout(FlowLayout.java:102)
at com.extjs.gxt.ui.client.widget.Layout.layout(Layout.java:96)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:348)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:444)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:241)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:427)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:236)
at com.ottocap.NewWorkFlow.client.NewWorkFlow.setMainScreen(NewWorkFlow.java:170)
at com.ottocap.NewWorkFlow.client.NewWorkFlow.access$1(NewWorkFlow.java:167)
at com.ottocap.NewWorkFlow.client.NewWorkFlow$1.componentSelected(NewWorkFlow.java:180)
at com.ottocap.NewWorkFlow.client.NewWorkFlow$1.componentSelected(NewWorkFlow.java:1)
at com.extjs.gxt.ui.client.event.SelectionListener.handleEvent(SelectionListener.java:20)
at com.extjs.gxt.ui.client.event.SelectionListener.handleEvent(SelectionListener.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:176)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:96)
at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:457)
at com.extjs.gxt.ui.client.widget.menu.Item.onClick(Item.java:143)
at com.extjs.gxt.ui.client.widget.menu.Menu.onClick(Menu.java:589)
at com.extjs.gxt.ui.client.widget.menu.Menu.onComponentEvent(Menu.java:320)
at com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:756)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1320)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1299)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1262)

sven
26 Jun 2009, 12:46 PM
This is not an issue in GXT. it is a global browser issue. You cant have a formtag inside another formtag. This makes also no sense to do.

What are you trying to archieve?

TheBuzzer
26 Jun 2009, 12:48 PM
well ie and firefox both worked in a form within a form.

the inside form is made for fileuploads and the outside form was submitting fields but for gxt the fields will be submitted though a rpc. but the fileupload still in posts to submit.

sven
26 Jun 2009, 12:49 PM
You dont need two formpanels for that. For doing rpc submits you dont even have to use a formpanel

TheBuzzer
26 Jun 2009, 12:53 PM
ya, but the layout I want to use a formpanel layout. or the field labels and stuff all looks wacked

TheBuzzer
26 Jun 2009, 12:57 PM
Ah, so I could just set a contentpanel to a formlayout.

Have a formpanel inside that.

sven
26 Jun 2009, 12:59 PM
Yes. That is what i would suggest, if you want the fieldupload in an own formpanel.

TheBuzzer
26 Jun 2009, 1:04 PM
Now the formpanel inside is not aligned :/

trying to hide

myuploadform.setHeaderVisible(false);
myuploadform.setBorders(false);
myuploadform.setLayout(FormHorizontalPanel.newFormLayout());
myuploadform.setBodyBorder(false);
myuploadform.setFrame(false);
myuploadform.add(companylogofile);


still not aligned.
What other stuff does a extra form make that got to be hidden to make the stuff align with the other fields