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

LabelOnRightAttribute usage #37

Closed
Budsy opened this issue Feb 4, 2017 · 4 comments
Closed

LabelOnRightAttribute usage #37

Budsy opened this issue Feb 4, 2017 · 4 comments

Comments

@Budsy
Copy link
Contributor

Budsy commented Feb 4, 2017

I tried adding new FormFactory.Attributes.LabelOnRightAttribute() to the GetCustomAttributes field list (in declarative programmable model example) for a checkbox. It rendered the following:

"if (Model.GetCustomAttributes().OfType ().Any()) { } else //if not required, then it is possible to post a false value, which means we need a hidden field as unchecked checkboxes aren't posted. sigh. { } Checkbox label here"

This wasn't quite what I expected. Is there a correct way to get the label for a checkbox to render to the right of the box? A checkbox works great with the default label on the left.

@mcintyre321
Copy link
Owner

mcintyre321 commented Feb 4, 2017 via email

@Budsy
Copy link
Contributor Author

Budsy commented Feb 6, 2017

I put my code into the Mvc Examples Index demo page on a fork. Currently I'm going to try to compile your source and track this down. ...have to upgrade my VS first. ;-)

@Budsy
Copy link
Contributor Author

Budsy commented Feb 6, 2017

I found the bug and made a fix in FormFactory/Views/Shared/FormFactory/Property.System.Boolean.cshtml . It was, as you surmised, missing the @ on the if keyword, needed after the html <label> tag line in the View markup file. I compiled the Dll with this change and am using it in my project now. Works like a charm.

@mcintyre321
Copy link
Owner

thanks for the PR!

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

2 participants