U4-3754 - Property editor with valueType INT when using input type="text"

Created by Anders Burla Johansen 28 Nov 2013, 13:41:19 Updated by Shannon Deminick 12 Dec 2013, 07:32:29

I have tried to make a really simple property editor and have a input html field of type text. I have the valueType set to "INT". Then I enter 1 in the input field but the value is never saved. Don't know if it has something to do with the data binding of Angular or its a bug in the save procedure. Hope it is a bug and not just me :)

Comments

Shannon Deminick 05 Dec 2013, 07:37:17

Can you please supply your manifest and code so we can see what you are doing ?


Shannon Deminick 10 Dec 2013, 04:13:13

@Anders - can you post up your manifest so we can have a look?


Shannon Deminick 10 Dec 2013, 04:13:55

(doh! that comment somehow decided to reference a different anders :P )


Anders Burla Johansen 10 Dec 2013, 07:11:14

I don't have the manifest with the INT - it was just a small test to try and make a simple property editor. But just used INT as the type and then had a html input type="text" with model.value. So it should have worked - but didn't :)


Shannon Deminick 10 Dec 2013, 07:15:37

Can you provide the code you are attempting? How are you creating a property editor, if not with a manifest, then you must be doing it in c# ?


Anders Burla Johansen 10 Dec 2013, 07:46:46

It was a manifest. But it was as basic as it could be. Simple manifest where type was INT and then a editor (html file) with a html input text field. That was it.


Shannon Deminick 11 Dec 2013, 07:54:39

It'd still be nice to see your manifest...

Without seeing it I can only guess buy my assumption is that you put the data type attribute in the wrong place - a few people have done this too.

see: http://umbraco.github.io/Belle/#/tutorials/manifest

The valueType belongs as part of the 'editor' block.


Shannon Deminick 11 Dec 2013, 07:55:43

Ah, sorry just noticed you said you don't have the manifest. In anycase please try again with the valueType in the correct spot.


Shannon Deminick 11 Dec 2013, 07:56:02

Also be sure to test with the latest nightly


Shannon Deminick 12 Dec 2013, 07:32:20

I've tested this and it all works as expected, here's what I have:

The manifest:

{
	propertyEditors:[
		{
			alias: "Blah.Number",
			name: "Some Number",
			editor: {
				view: "~/App_Plugins/Blah/int.html",
				valueType: "INT"
			}
		}
	]
}

The view:

<h5>My Number</h5>
<div>    
    <input type="text" ng-model="model.value" />    
</div>

works perfectly fine. Since it is an INT value type and if you put in a non-int then the value will get cleared because it cannot save it to the db in the number field.

In 7.0.0 you could validate the value using the regex validator, or in 7.0.1 there's an Integer validator, so you could do this in your manifest:

{
	propertyEditors:[
		{
			alias: "Blah.Number",
			name: "Some Number",
			editor: {
				view: "~/App_Plugins/Blah/int.html",
				valueType: "INT",
				validation: {
					Integer : true
				}
			}
		}
	]
}

And you'll get a UI validation indication.


Priority: Normal

Type: Bug

State: Closed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.0

Due in version: 7.0.1

Sprint:

Story Points:

Cycle: