cancel
Showing results for 
Search instead for 
Did you mean: 

How to resolve "Container not defined" in a view?

Former Member

I put an ( HBox id = 'pizza' ) inside the BlockLayoutCell and used ( this.getView (). ById ("pizza"). GetDomRef ) on the Chart command. Gave the same error "Container not defined". I think the problem is that it is inside a view because the command works with the index.html page. How could I define the "Container" of the view ???

junwu
Active Contributor
0 Kudos

where you put those code?

maybe you have to put it

onAfterRendering

Former Member
0 Kudos

Yes it is called from there....

Former Member
0 Kudos

See below image...

junwu
Active Contributor
0 Kudos

show me the code of your view

Former Member
0 Kudos

Thanks for your attention.... a very simple view below

junwu
Active Contributor
0 Kudos

can't you make a better screenshot.......

Former Member
0 Kudos

Yes i replaced the images...see above...thanks

junwu
Active Contributor
0 Kudos

can you show your overall app structure? component, index.html......

usually I don't put the shell in the view.

Accepted Solutions (0)

Answers (1)

Answers (1)

maheshpalavalli
Active Contributor
0 Kudos

Hi Paulo de Tharso Castro,

It probably might be a small issue. I've tried it and it worked. Please check the example below:

https://next.plnkr.co/edit/CVLrm50RukrajPBz?preview

You need to use getDomRef() and check variable "place" is initialised in the debugger. Maybe "this" in this.getId() is not having the instance of the controller? also call the draw function using the setOnLoadCallback.

You can check my above example.

BR,

Mahesh

Former Member
0 Kudos

Hi Mahesh, thanks for your attention... i tried the two forms .... without Hbox and with Hbox....the results is the same of the images.

Curious is that the CHART APPEARS but the error message continues. I change the "var place" to "var container" only to test but is not relevant. Is not necessary the Hbox ...i think.