Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use "control" multiple times if templates are rendered through handlebars files #122

Closed
iHiD opened this issue Feb 3, 2013 · 5 comments

Comments

@iHiD
Copy link

iHiD commented Feb 3, 2013

Hi everyone,

I'm trying to render a control twice in a template (e.g. http://jsbin.com/ogorab/52/edit). I'm using master of both ember-rails and ember.js.

If I put the template code in <script> tags, it works fine. If I put it in app/assets/templates/name.handlebars files, then it fails on the second render with Cannot call method 'lookup' of undefined.

I've traced the error to line 23968 of https://gist.github.com/4699877 where container is undefined.

I've had this reproduced by others in the IRC channel.

If I can help tracking it down at all, please let me know. Thanks for all your work on Ember and Ember-rails!

@darthdeus
Copy link
Member

+1 having the same issue

@ghempton
Copy link
Member

ghempton commented Feb 3, 2013

Currently, if you use multiple controls in the same template/controller you need to set the controlID property to a different value for each one. E.g.

{{control widget content controlID="one"}}
{{control widget content controlID="two"}}

I hope this is changed in the future to use a guid generated from handlebars.

@iHiD
Copy link
Author

iHiD commented Feb 3, 2013

Ah, yes. That fixes it. Thanks, @ghempton!

@tchak
Copy link
Member

tchak commented Feb 4, 2013

It seems that controlID is set by ember-handlebars-compiler...
https://github.com/emberjs/ember.js/blob/master/packages/ember-handlebars-compiler/lib/main.js#L107

Anyway, I think this issue belongs in ember core not here. Please reopen it in @emberjs/ember.js

@iHiD
Copy link
Author

iHiD commented Feb 4, 2013

Done. Thanks, @tchak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants