Giter Site home page Giter Site logo

Comments (8)

psteininger avatar psteininger commented on August 16, 2024 1

I am coming to a conclusion that a deprecation is at fault here:

Please use the new form.input helper defined in 1.0.0beta10

Perhaps I need to define the form and input differently

from ember-rapid-forms.

psteininger avatar psteininger commented on August 16, 2024 1

Ok, so I have changed my hbs to:

 {{#em-form model=model action="commitChange" submitButton=false as |f|}}
                            {{f.input property="password" label="Password" type="password"}}
                            {{f.input property="passwordConfirmation" label="Password (confirm)" type="password"}}
...
{{/em-form}}

and the form works, but I hit other issues with the ember-cp-validations integration. I will fix that and do a PR soon.

In the meantime, I think it would be worth documenting the change to the handlebars setup and/or make things work both ways (old way and new way).

from ember-rapid-forms.

psteininger avatar psteininger commented on August 16, 2024

@spruce it looks like the issue is that the root in the following method evaluates to undefined

 function setPath(root, path, value, tolerant) {
    // get the last part of the path
    var keyName = path.slice(path.lastIndexOf('.') + 1);

    // get the first part of the part
    path = path === keyName ? keyName : path.slice(0, path.length - (keyName.length + 1));

    // unless the path is this, look up the first part to
    // get the root
    if (path !== 'this') {
      root = _emberMetalProperty_get._getPath(root, path);
    }

    if (!keyName || keyName.length === 0) {
      throw new _emberMetalError.default('Property set failed: You passed an empty path');
    }

    if (!root) {
      if (tolerant) {
        return;
      } else {
        throw new _emberMetalError.default('Property set failed: object in path "' + path + '" could not be found or was destroyed.');
      }
    }

    return set(root, keyName, value);
  }

the value of root before these lines

 if (path !== 'this') {
      root = _emberMetalProperty_get._getPath(root, path);
    }

has the input tag as the viewElement. So it appears that the model is not propagated down from the {{em-form}} to the {{em-input}}. I'll try to do some more digging today.

from ember-rapid-forms.

psteininger avatar psteininger commented on August 16, 2024

Another observation:

Ember.get(root, 'mainComponent.form')
> undefined
Ember.get(root, 'mainComponent.model')
> undefined

it looks like the form and thus the model reference is not being propagated to the inputs for some reason

from ember-rapid-forms.

psteininger avatar psteininger commented on August 16, 2024

I just noticed that this:

Ember.get(root, 'mainComponent.parentView.model')

produces the actual model

from ember-rapid-forms.

spruce avatar spruce commented on August 16, 2024

Sorry for not checking in here lately (2 month, ups). Did you have a PR on the thing you mentioned. Now the docs are showing the new way to use the forms. Should there be anything else changed?

from ember-rapid-forms.

spruce avatar spruce commented on August 16, 2024

@psteininger anything new? elsewise I gonna close this as this project doesn't support 2.10 any longer.

from ember-rapid-forms.

psteininger avatar psteininger commented on August 16, 2024

@spruce ok to close. It's been a long time since I solved the issue, and I just don't remember how.

from ember-rapid-forms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.