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

Fixes for HidingContainer to support Multi Select widgets. #6

Open
atbinf opened this issue Jul 24, 2014 · 1 comment
Open

Fixes for HidingContainer to support Multi Select widgets. #6

atbinf opened this issue Jul 24, 2014 · 1 comment

Comments

@atbinf
Copy link

atbinf commented Jul 24, 2014

Recommend the below changes to HidingContainer._validate() function. This will allow multi select widget support (show/ hide based on multiply selected items). This also has a fix to compare the mapping property keys with the original value rather than the validated value. The validated value has been, in many cases transformed and thus would not match up with the item in the mapping.

                    if isinstance(c, HidingComponentMixin):
            #Support Multiselect List widgets
            #Show widgets based on pre-validated value
                        if isinstance(data[c.id],list):
                            for i,item in enumerate(data[c.id]):
                                show.update(c.mapping.get(value.get(c.id)[i],[]))
                        else:
                            show.update(c.mapping.get(value.get(c.id), []))
@moschlar
Copy link
Member

I'm not really experienced with tw2.dynforms itself, so would you mind making this a proper pull request with some test cases for the behavior?

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

1 participant