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

UI: Default value for select not selected when it's zet to 0 #11268

Closed
Globulopolis opened this issue Jan 23, 2017 · 2 comments
Closed

UI: Default value for select not selected when it's zet to 0 #11268

Globulopolis opened this issue Jan 23, 2017 · 2 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@Globulopolis
Copy link
Contributor

I'm trying to understand why it's always select item with ? value.
Example:

<div piwik-field uicontrol="select" name="siteid"
	 title="{{ 'Params_site'|translate }}"
	 value="0"
	 inline-help="{{ 'Params_sites'|translate }}"
	 options='{{ data.item.sites|json_encode }}'>
</div>

And expected that the item with value 0 will be selected but other value selected. If I change value to en empty string when it's working as expected.

Any suggestion?

@mattab
Copy link
Member

mattab commented Feb 18, 2017

@Globulopolis do you experience this issue in a custom plugin you are developing, or in an existing core UI or marketplace plugin?

Maybe @tsteur has some idea?

@tsteur
Copy link
Member

tsteur commented Feb 18, 2017

You need to make sure the variable type is the same. Likely there are integers in options vs string passed via value.

@tsteur tsteur closed this as completed Feb 18, 2017
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Feb 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

3 participants