prayagupa / gccount

It's an open source framework [for portable account] developed in grails 2.3.3, twitter bootstrap and elasticsearch/mysql.
prayagupd-dreamspace.blogspot.com
4 stars 6 forks source link

GrailsTagException: Tag [all] currently only supports domain types #1

Open prayagupa opened 11 years ago

prayagupa commented 11 years ago

I have a domain (at https://github.com/iPrayag/gccount/blob/master/grails-app/domain/eccount/Transaction.groovy) as :

class Transaction {

Account account;
static belongsTo = Account;
Double amount;
static hasMany  = [transactionDetails:TransactionDetails];
static mappedBy = [transactionDetails:"transaction"]
Date created = new Date();
User approvedBy;

static constraints = {
       account(blank:false);
       amount(blank:false);
   transactionDetails();
       created();
       approvedBy(blank:false);
}
String toString(){
     "${account.rfid}"
}

}

The page create.gsp contains

... ...

Which takes _form.gsp.

While trying to create a transaction at http://localhost:8080/cashless/transaction/create throws error :

/cashless/transaction/create Tag [all] currently only supports domain types. Stacktrace follows: Message: Error processing GroovyPageView: Tag [all] currently only supports domain types Line | Method ->> 461 | doFilter in /grails-app/views/transaction/create.gsp


Caused by GrailsTagException: Tag [all] currently only supports domain types ->> 63 | doCall in /grails-app/views/transaction/create.gsp


The screen shot is

grails error

prayagupa commented 11 years ago

Possible Hint : prayag@Prayag:~/workspace_grails/gccount$ ls -l /home/prayag/.grails/2.1.1/projects/gccount/plugins/fields-1.3/

-rw-rw-r-- 1 prayag prayag 93 Jul 31 10:02 application.properties -rw-rw-r-- 1 prayag prayag 1480 Jul 31 10:05 dependencies.groovy -rw-rw-r-- 1 prayag prayag 1497 Jul 31 10:02 FieldsGrailsPlugin.groovy drwxrwxr-x 5 prayag prayag 4096 Dec 11 11:01 grails-app -rw-rw-r-- 1 prayag prayag 1186 Jul 31 10:05 plugin.xml drwxrwxr-x 2 prayag prayag 4096 Dec 11 11:01 scripts drwxrwxr-x 5 prayag prayag 4096 Dec 11 11:01 src

Editing the fields-1.3/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy[https://github.com/robfletcher/grails-fields/blob/master/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy#L217] prayag@Prayag:~/workspace_grails/gccount$ sudo gedit /home/prayag/.grails/2.1.1/projects/eccount/plugins/fields-1.3/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy

private Object resolveBean(beanAttribute) {
    def bean = pageScope.variables[BEAN_PAGE_SCOPE_VARIABLE]
    if (!bean) {
        // Tomcat throws NPE if you query pageScope for null/empty values
        if (beanAttribute.toString()) {
            bean = pageScope.variables[beanAttribute]
        }
    }
    if (!bean) bean = beanAttribute
    bean
}