Class groovy.lang.MissingPropertyException Message No such property: list for class: gtunes.Album Possible solutions: id, class, dirty

Satya prakash

Album's index.gsp


It is giving error on line no. 5, the same code I am running in as .HTML file then it is working fine but in index.jsp error is coming I do not understand why it is happening.

  <div class="container-fluid">
      <h3><p class="text-center">Album list</p></h3>
      <ul id="album" class="list-group">
          <g:each var="album" in="${myvar}">
              <button type="button" class="list-group-item" onClick="editalbum('${album.list}')">
                  <span class="badge">${album.title}</span>
              </button>
          </g:each>
      </ul>
  </div>
</body>
</html>

AlbumController.groovy I have def abc which takes the album list and it render it to the index page

 package gtunes
    import static org.springframework.http.HttpStatus.*
    import grails.transaction.Transactional

    @Transactional(readOnly = true)
    class AlbumController {

        static allowedMethods = [save: "POST", update: "PUT", delete: "DELETE"]

        def index(Integer max) {
            def abc = Album.list(max:10);
            render(view:"index", model:[myvar:abc]);
            //params.max = Math.min(max ?: 10, 100)
            //respond Album.list(params), model:[albumInstanceCount: Album.count()]
        }[Grails error][1]

https://drive.google.com/open?id=0B9gjSzsLSnClRFZVbWE1MWU0aDQ here is the image of the error

z.eljayyo

There is no list for the object 'album', you probably trying to edit that one instance of the object 'album', Try this and adjust your JS code accordingly:

onClick="editalbum('${album}')"

or by id e.g.:

onClick="editalbum('${album.id}')"

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

groovy.lang.MissingPropertyException: No such property: Jenkins for class: hudson

groovy.lang.MissingPropertyException: No such property: props for class: groovy.lang.Binding

groovy.lang.MissingPropertyException: No such property: jenkins for class: groovy.lang.Binding

groovy.lang.MissingPropertyException: No such property: pipeline for class: groovy.lang.Binding

groovy.lang.MissingPropertyException: No such property: buildJobArray for class: groovy.lang.Binding

groovy.lang.MissingPropertyException: No such property: sh for class: groovy.lang.Binding

groovy.lang.MissingPropertyException: No such property: script for class: groovy.lang.Binding

Groovy - MissingPropertyException in Class

exception while executing groovy script from jenkinsfile groovy.lang.MissingPropertyException: No such property: args for class: groovy.lang.Binding

groovy.lang.MissingPropertyException: No such property: basePath for class: Script466 in Apache jmeter

Jenkins Pipeline plugin MissingPropertyException No such property: node for class: groovy.lang.Binding

Getting error "groovy.lang.MissingPropertyException: No such property: response for class: com.school.ClassService

Script function failed on Automation for Jira rule: error: groovy.lang.MissingPropertyException: No such property: issueLinkType for class

groovy.lang.MissingPropertyException: No such property:

Jmeter - ERROR c.g.j.p.w.s.WebDriverSampler: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: org for class

No such property: id for class: java.lang.String

Grails domain class property change is not flagged as Dirty

No such property: appCtx for class: groovy.lang.Binding - Cucumber, Grails

Generate possible solutions to image captcha from a list of each class with confidence

Accessing Property of Class in List<Class>

Groovy - Is it possible to pass a class as a parameter?

List as Property in Class

angular change class on $dirty

Convert List<Class> to List<Class.property>

Is it possible to reference class property type?

Find a property inside a class that match List<class>

ArrayIndexOutOfBoundsException when adding property to a groovy class

Groovy Script error No such property: customerId for class

Cannot set readonly property: class for class in groovy when initializing with map