How to use the @nakedobjects/restful-objects.CollectionMember function in @nakedobjects/restful-objects

To help you get started, we’ve selected a few @nakedobjects/restful-objects examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / services / src / context.service.ts View on Github external
return () => {
                    this.dirtyList.setDirty(parent.getOid());
                    this.setCurrentObjectsDirty();
                    clearCacheIfNecessary();
                };
            }
            if (parent instanceof Ro.CollectionRepresentation) {
                return () => {
                    const selfLink = parent.selfLink();
                    const oid = Ro.ObjectIdWrapper.fromLink(selfLink, this.keySeparator);
                    this.dirtyList.setDirty(oid);
                    this.setCurrentObjectsDirty();
                    clearCacheIfNecessary();
                };
            }
            if (parent instanceof Ro.CollectionMember) {
                return () => {
                    const memberParent = parent.parent;
                    if (memberParent instanceof Ro.DomainObjectRepresentation) {
                        this.dirtyList.setDirty(memberParent.getOid());
                    }
                    this.setCurrentObjectsDirty();
                    clearCacheIfNecessary();
                };
            }
            if (parent instanceof Ro.ListRepresentation && parms) {

                const ccaParm = find(action.parameters(), p => p.isCollectionContributed());
                const ccaId = ccaParm ? ccaParm.id() : null;
                const ccaValue = ccaId ? parms[ccaId] : null;

                // this should always be true
github NakedObjectsGroup / NakedObjectsFramework / Spa2 / nakedobjectsspa / view-models / src / table-row-column-view-model.ts View on Github external
constructor(
        public readonly id: string,
        propertyRep?: Ro.PropertyMember | Ro.CollectionMember,
        mask?: MaskService
    ) {

        if (propertyRep && mask) {

            this.title = propertyRep.extensions().friendlyName();

            if (propertyRep instanceof Ro.CollectionMember) {
                const size = propertyRep.size();

                this.formattedValue = Helpers.getCollectionDetails(size);
                this.value = '';
                this.type = 'scalar';
                this.returnType = 'string';
            }

            if (propertyRep instanceof Ro.PropertyMember) {
                const isPassword = propertyRep.extensions().dataType() === 'password';
                const value = propertyRep.value();
                this.returnType = propertyRep.extensions().returnType()!;

                if (propertyRep.isScalar()) {
                    this.type = 'scalar';
                    Helpers.setScalarValueInView(this, propertyRep, value);