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 #64: SingleCheckBoxFieldWidget does not render value in view mode #65

Merged
merged 1 commit into from
Jun 13, 2017

Conversation

jensens
Copy link
Member

@jensens jensens commented Apr 28, 2017

replaced existing hack by a real widget.

# this way it works with one checkbox
if value and value[0] == 'selected':
return True
return False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't the existing BoolSingleCheckboxDataConverter in z3c.form sufficient?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there is no value for no for display mode. This make it explicit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whether we set up the display value here or in the widget, we should probably use messageids rather than hardcoded strings.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the vocabulary used from z3c.form uses msgstr

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, I even saw that the other day, and then forgot.

layer="plone.app.z3cform.interfaces.IPloneFormLayer"
class=".templates.RenderSingleCheckboxWidget"
permission="zope.Public"
/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of this view was to make sure that the label is rendered to the right of the checkbox in input mode and the description underneath. I see you made the label go in the right place, but I think with your change the description will now be shown above the checkbox.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

youre right, know, that we have an own widget for this, I can provide an own display template for this case in order to show the description right.
@agitator may you provide me with the markup needed for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@davisagli
Copy link
Member

By the way, it's probably worth checking that this widget works correctly in hidden mode too. I've had trouble with that with single checkboxes in the past.

@jensens
Copy link
Member Author

jensens commented May 3, 2017

probably the hidden mode is a problem too.

@thet
Copy link
Member

thet commented Jun 8, 2017

@jensens this is still in progress or can it - after a rebase - be merged?

@jensens
Copy link
Member Author

jensens commented Jun 9, 2017

@thet it is still WIP

@jensens jensens force-pushed the fix-64 branch 4 times, most recently from 38818fb to 7df904f Compare June 13, 2017 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants