google-code-export / gwt-ext

Automatically exported from code.google.com/p/gwt-ext
0 stars 0 forks source link

Exception trying to add a Widget to a ContentPanel #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Tring to add a widget into a ContentPanel with this code:
(...)
LayoutRegion centerRegion =
dialog.getLayout().getRegion(LayoutRegionConfig.CENTER);
FireLog.debug("Region: " + centerRegion);
ContentPanel panel = centerRegion.getPanel(contentPanelId);
FireLog.debug("My panel id: " + contentPanelId);
FireLog.debug("Region panel id: " + panel.getId());
FireLog.debug("Panel element: " + panel.getElement());
panel.add(new HTML("test"));

I get this output:
Region: com.gwtext.client.widgets.layout.LayoutRegion@4cc428
My panel id: ext-gen140
Region panel id: ext-gen140
Panel element: null

and this exception:

[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: JavaScript TypeError
exception: Null value
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:481)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:270)
    at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:137
)
    at com.google.gwt.user.client.impl.DOMImpl.appendChild(DOMImpl.java:27)
    at com.google.gwt.user.client.DOM.appendChild(DOM.java:67)
    at com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:82)
    at com.gwtext.client.widgets.layout.ContentPanel.add(ContentPanel.java:160)
    at
org.ourproject.kune.chat.client.ui.rooms.ChatRoomsDialog.addMessage(ChatRoomsDia
log.java:108)
    at
org.ourproject.kune.sitebar.client.bar.SiteBarPanel$3.onClick(SiteBarPanel.java:
134)
    at
com.google.gwt.user.client.ui.ClickListenerCollection.fireClick(ClickListenerCol
lection.java:36)

--------------

I'm doing something wrong?

Original issue reported on code.google.com by vruiz.ju...@gmail.com on 23 Aug 2007 at 4:26

GoogleCodeExporter commented 9 years ago
I had similar problems before, it's more than likely that you've put the .js and
resource files in the wrong directory structure.

Here's the relavent part in the GettingStarted: "You do this by copying 
ext-all.js
and the entire resources and adapter directories from the Ext distribution into 
a
directory under your "public" directory. For example copy the files to
/main/src/com/foo/public/js/ext/".

HTH

-- Joe

Original comment by ajia...@gmail.com on 5 Sep 2007 at 10:33

GoogleCodeExporter commented 9 years ago
Are you still having this problem?

Original comment by sanjiv.j...@gmail.com on 12 Oct 2007 at 1:59

GoogleCodeExporter commented 9 years ago
Yes: 

My panel id: ext-gen343
Region panel id: ext-gen343
Panel element: null

I'm using gwt-ext 0.9.2.

Thanks,

Vicente

Original comment by vruiz.ju...@gmail.com on 12 Oct 2007 at 8:53

GoogleCodeExporter commented 9 years ago
I am having this same problem.

I create a layout.
Set a panel in the north region.
do layout.getRegion(LayoutRegionConfig.NORTH);
region.getPanel("My ID");
panel.add(myWidget);

Null object exception just as above.

Original comment by clark...@gmail.com on 31 Dec 2007 at 8:28

GoogleCodeExporter commented 9 years ago
Fixed in GWT-Ext 2.0. Please try to upgrade at the earliest as it has several
improvements.

Original comment by sanjiv.j...@gmail.com on 11 Feb 2008 at 8:26

GoogleCodeExporter commented 9 years ago
I had the same problem with GWT-Ext 2.0.1 - As soon as I added any GWT (not 
GWT-ext)
component to a panel, it threw that error. 

Problem: I was using the js files from Ext 2.0.2. 
Solution: Change back to Ext 2.0.1 js files and everything works fine.

Original comment by wum...@gmail.com on 29 Feb 2008 at 8:43