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

Changing data bound to Ember.Select doesn't update selection #481

Closed
martinstein opened this issue Feb 8, 2012 · 1 comment
Closed

Changing data bound to Ember.Select doesn't update selection #481

martinstein opened this issue Feb 8, 2012 · 1 comment
Assignees
Labels

Comments

@martinstein
Copy link

First of all, here's a jsfiddle that demonstrates the problem:

http://jsfiddle.net/KPXYd/4/

When the data behind the Select view changes, the options are correctly updated, but the new selected item is not selected. When stepping through the code, it seemed to me that the following happens:

  1. The selectionBinding is updated first and the new selection gets highlighted (possibly on the old content ?)
  2. The contentBinding is updated next, and thus the options get re-rendered and the highlighted selection gets 'lost'.

I'm not sure if the above is actually the cause. Maybe someone else can look into it.

@ghost ghost assigned ebryn Feb 11, 2012
@dlcurry
Copy link

dlcurry commented Feb 13, 2012

Your example helped me immensely, so maybe I can pay back...

I had a very similar problem, but related to restoring Select(ed) values from persistance - the Selects wouldn't update. The following code doesn't seem to have any effect in your jsfiddle example, but I'm not a jsfiddle user yet, so maybe I'm not using it correctly.
this.user.set('group', europeGroups.findProperty('id', this.user.group.id));

The basic idea is that your user property DOES have the data, but the groups property no longer points to the group set at initialization as far as the Select is concerned. So you get the id of the group, get the associated group instance from xxxGroups, ans set that into user.group. This will also trigger the change event for the Select so that it refreshes....I think.
HTH,
Dave

@ebryn ebryn closed this as completed in 3d3f570 Mar 4, 2012
wycats pushed a commit that referenced this issue Jun 13, 2019
Per RFC #481, we want to align the factory signature between templates
and component managers. Since the factories for component managers are
just a function that takes the owner, we decided to move template
factories in the same direction here as well.

Co-authored-by: Robert Jackson <[email protected]>
wycats pushed a commit that referenced this issue Jun 13, 2019
Per RFC #481, we want to align the factory signature between templates
and component managers. Since the factories for component managers are
just a function that takes the owner, we decided to move template
factories in the same direction here as well.

Co-authored-by: Robert Jackson <[email protected]>
rwjblue added a commit that referenced this issue Jun 14, 2019
Per RFC #481, we want to align the factory signature between templates
and component managers. Since the factories for component managers are
just a function that takes the owner, we decided to move template
factories in the same direction here as well.

Co-authored-by: Robert Jackson <[email protected]>
rwjblue added a commit that referenced this issue Jun 17, 2019
Per RFC #481, we want to align the factory signature between templates
and component managers. Since the factories for component managers are
just a function that takes the owner, we decided to move template
factories in the same direction here as well.

Co-authored-by: Robert Jackson <[email protected]>
rwjblue added a commit that referenced this issue Nov 9, 2020
…_return_with_rfc

[RFC #481] change return of getComponentTemplate from null to undefined to align with RFC
sandstrom pushed a commit to sandstrom/ember.js that referenced this issue Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants