logo
down
shadow

How to add / run the validators for complex type data properties in breeze schema


How to add / run the validators for complex type data properties in breeze schema

By : user2955539
Date : November 22 2020, 10:40 AM
help you fix your problem Actually, the 'required' validator probably did run. The problem is that scalar complex types are never null; they may contain all null values, but the complex instance itself always exists. So the 'required' validator, which simply asks if the property is null, will never fail. Similarly for arrays of complexTypes the array will always exist but it may be empty ( as opposed to null).
So you will need to create a complex validator for your instance that checks if all of the values within the complexType are null.
code :


Share : facebook icon twitter icon
Breeze.js - complex properties cause circular structure exception during em.exportEntities

Breeze.js - complex properties cause circular structure exception during em.exportEntities


By : chinna
Date : March 29 2020, 07:55 AM
Does that help This was a bug and has been fixed in Breeze v 1.3.5, available now via nuget and the Breeze web site.
and ... good repro. We appreciate it.
Breeze - Lazy load complex type

Breeze - Lazy load complex type


By : Johan
Date : March 29 2020, 07:55 AM
seems to work fine Without more information, I'm not entirely clear on what you are asking but we are planning on adding a function to the Breeze API for the EntityManager that will allow you to call an arbitrary endpoint with an arbitrary datastructure and have the result of the call, if any, be merged back into the EntityManager via a JsonResultsAdapter.
Until then you could accomplish some of this right now by bypassing the EntityManager.saveChanges and just using the Breeze ajax adapter directly to call your endpoint. Something like
code :
var ajaxImpl = breeze.config.getAdapterInstance("ajax");
ajaxImpl.ajax({
        type: "POST",
        url: url,
        dataType: 'json',
        contentType: "application/json",
        data: bundle,   // arbitrary data to server.
        success: function (httpResponse) {
            // perform custom client side code 
        },
        error: function (httpResponse) {

        }
    });
Data returned from Breeze queries doesn't fill in any Entity data properties, did I miss a step wiring Breeze up?

Data returned from Breeze queries doesn't fill in any Entity data properties, did I miss a step wiring Breeze up?


By : Damiano Martorelli
Date : March 29 2020, 07:55 AM
Hope this helps Because of the way my data model is set up, the breeze.NamingConvention.camelCase.setAsDefault() in my emFactory definition was causing my data properties to translate incorrectly when switching between client and server.
Breeze type inheritance on complex objects properties of a base type

Breeze type inheritance on complex objects properties of a base type


By : user7972556
Date : March 29 2020, 07:55 AM
Does that help Breeze currently supports EntityType inheritance but NOT ComplexType inheritance.
Multiple validators for single complex type data property

Multiple validators for single complex type data property


By : user2971875
Date : March 29 2020, 07:55 AM
This might help you Within your validation function the 'context' parameter will have a 'propertyName' property. This 'propertyName' will be the path to your property, so you can distinguish between say 'billingAddress' and 'locationAddress'. Further, if you validate the subproperty of a complexType the 'context.propertyName' will be a dotted path to your property, i.e. something like 'billingAddress.city' vs 'locationAddress.city'.
So you might write a validator like this
code :
  var valFn = function (v, context) {
    var propName = context.propertyName;
    // change the validation logic here depending on the 'propName';
  };
  var myValidator = new Validator("MyValidator", valFn,
      { messageTemplate: "Custom message template..." });
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org