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

Feature: FormControls.Enabled #433

Merged
merged 8 commits into from
Aug 11, 2017
Merged

Feature: FormControls.Enabled #433

merged 8 commits into from
Aug 11, 2017

Conversation

Sejsel
Copy link
Contributor

@Sejsel Sejsel commented Aug 11, 2017

FormControls.Enabled

proposed in #296

Adds a FormControls.Enabled property to all HTML elements which disables controls inside that are not explicitly enabled.

Controls affected

DotVVM

  • Button (ButtonBase)
  • CheckBox (CheckableControlBase)
  • ComboBox (SelectorBase)
  • DataPager
  • LinkButton (ButtonBase)
  • ListBox (SelectorBase)
  • RadioButton (CheckableControlBase)
  • TextBox

Bootstrap (not yet implemented)

  • Button
  • CheckBox
  • DataPager
  • RadioButton
  • TextBoxGroup

Business pack (not yet implemented)

  • Button
  • Calendar
  • CheckBox
  • CheckBoxList
  • ColorPicker
  • ComboBox
  • DataPager
  • DateTimePicker
  • DateTimeRangerPicker
  • DropDownList
  • MultiSelect
  • NumericUpDown
  • RadioButton
  • RadioButtonList
  • RangeCalendar
  • RangeSlider
  • Rating
  • Slider
  • TextBox

ListView (Business pack) does not have an Enabled property
DateTimePicker (Bootstrap) does not have an Enabled property
DropDownButton (Bootstrap) does not have an Enabled property

Example

<div FormControls.Enabled="{value: false}">
    <dot:Button Text="I am disabled" />
    <dot:Button Text="I am enabled" Enabled="{value: true}" />
</div>

This applies for following controls or others that derive from the same base classes:

Button (ButtonBase)
CheckBox (CheckableControlBase)
ComboBox (SelectorBase)
LinkButton (ButtonBase)
ListBox (SelectorBase)
RadioButton (CheckableControlBase)
TextBox
Still needs a test for linkbuttons which do not currently work.

namespace DotVVM.Framework.Binding
{
public class CustomDefaultProperty : DotvvmProperty
Copy link
Contributor

Choose a reason for hiding this comment

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

When I see this name I can't imagine what is it good for. Is DotvvmPropertyWithFallback better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest, I don't find either of those names very good and can't think of a better alternative.

Copy link
Contributor

@djanosik djanosik Aug 11, 2017

Choose a reason for hiding this comment

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

Hmm. Will try to find a better name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about DefaultToPropertyDotvvmProperty or PropertyDefaultDotvvmProperty?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or DelegatedDotvvmProperty? Because it delegates call to another property when not set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I asked @exyi and @tomasherceg and it's going to be DotvvmPropertyWithFallback.

@Sejsel Sejsel merged commit a7adac1 into master Aug 11, 2017
@Sejsel Sejsel deleted the formcontrols-enabled branch August 11, 2017 14:17
@djanosik
Copy link
Contributor

All controls in Business Pack will support FormControls.EnabledProperty in v2.0.

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

Successfully merging this pull request may close these issues.

None yet

3 participants