Comments (6)
Actually you can use it with EditorType("MultipleImageUpload")
, as editor type attributes are just intellisense helpers. But i'm not sure if multiple upload editor works properly, didn't use it for long time, need to have a look.
from serenity.
I tried EditorType attribute usage, editor shown properly but when updating record have an errror:
An exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in Serenity.Data.Entity.dll but was not handled in user code
Additional information: Unexpected token when deserializing row: StartArray
Newtonsoft.Json.JsonSerializationException was unhandled by user code
HResult=-2146233088
Message=Unexpected token when deserializing row: StartArray
Source=Serenity.Data.Entity
StackTrace:
at Serenity.Data.Field.JsonUnexpectedToken(JsonReader reader) in c:\project\Serenity\Serenity.Data.Entity\FieldTypes\Field.cs:line 132
at Serenity.Data.StringField.ValueFromJson(JsonReader reader, Row row, JsonSerializer serializer) in c:\project\Serenity\Serenity.Data.Entity\FieldTypes\StringField.cs:line 83
at Serenity.Data.JsonRowConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in c:\project\Serenity\Serenity.Data.Entity\Row\JsonRowConverter.cs:line 109
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
InnerException:
from serenity.
Error you are getting is because MultipleImageUploadEditor sends JSON array to server side by default as field value, and it can't be deserialized to a string field.
Please update Serenity nuget packages to 1.5.1.
I tried making sure MultipleImageUpload works properly in this version.
Then use the ImageUploadEditor attribute like below:
[ImageUploadEditor(allowMultiple: true, JsonEncodeValue = true)]
public String ProductImages { get; set; }
And on top of your SaveHandler you should use EmbeddedMultiFileUploadBehaviour instead of EmbeddedFileUploadBehaviour as below:
[EmbeddedMultiFileUploadBehaviour("ProductImages", fileNameFormat: "ProductImage/{1:00000}/{0:00000000}_{2}", copyFilesToHistory: true)]
private class MySaveHandler : SaveRequestHandler<MyRow> {
}
After this it should work.
from serenity.
I updated serenity packages. I can use ImageUploadEditor . There is no EmbeddedMultiFileUploadBehaviour attribute class. I used EmbeddedFileUploadBehaviour and normally get an error:
Failed to load resource: the server responded with a status of 404 (Not Found)
jquery-2.1.4.js?v=EH--lVW_yI7FyrUkx5D-NA2:8630 POST http://localhost:59837/File/TemporaryUpload 404 (Not Found)
from serenity.
Serenity.Web and Serenity.CodeGenerator 1.5.1 packages somehow didn't make it to Nuget gallery, try to update them again please, and rebuild project.
from serenity.
Please reopen this if problem still persists.
from serenity.
Related Issues (20)
- [Bug report]: Dialog does not move to associated tab when a validation error occurs HOT 2
- [Bug report]: BasedOnRowPropertyNameAnalyzer inherited fields HOT 2
- HtmlContentEditor is not working when opened in Panel HOT 1
- .NET 8 Migration HOT 1
- Transitioning to System.Text.Json from Newtonsoft.Json HOT 1
- [Bug report]: Broken demo site sample: Other Form, One Toolbar HOT 1
- Autherization error HOT 3
- [Bug report]: Demo Site Northwind Orders Print Invoice HOT 2
- [Bug report]: getWidgetFrom not exist in corelib 8.1.5 HOT 1
- Multi Tenancy tutorial issue with claims principle
- [LookupEditor]: LookupEditor cannot be disabled HOT 1
- Column resizing not working in Firefox HOT 3
- i just wanna filter my oders per customer
- i got an error when i try to create a filter for my customers in other tab
- [Bug report]: Grid custom filter not working with text input HOT 1
- [Bug report]: Can't get current UserId on version 8.4.4 HOT 1
- Improve TabsExtensions HOT 1
- [Bug report]: <Short tranzolproject skipped running migrations to avoid modifying an arbitrary database. If you'd like to run migrations on this database, remove the safety check in SiteInitialization.RunMigrations method.description of the bug> HOT 2
- An unhandled exception occurred while processing the request. InvalidOperationException: Generated PDF file is empty![Bug report]: <Short description of the bug> HOT 4
- [Bug report]: Cannot change filter criteria back to 'and' after changing to 'or' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serenity.