Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6951703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:15:13+00:00 2026-05-27T14:15:13+00:00

I have a domain class named DaySchedule like this: class DaySchedule { Date Todaysdate

  • 0

I have a domain class named DaySchedule like this:

 class DaySchedule {
        Date Todaysdate
        String startTime;
        String endTime;
        String task
        int priority 
        boolean completed
}

I have defined a controller for this domain class :

def allcompletedtask = {
        def completedtask = new DaySchedule(completed:true)
        def completedwork = DaySchedule.findAll(completedtask)
        [ completedwork : completedwork ]
    }

(To find the list of completed task)

For rendering it, I have a view file like this :

<html>
    <head>
        <title> 
            Completed Task.
        </title>
        <meta name ="layout" content="main" />
    </head>
    <body>
        <h2> All these are the completed task </h2>
        <g:each in="${completedwork}" var="completedtask">
            <div id = "todayswork" >
                ${completedtask.task} completed by
                ${completedtask.schedule.user.login}
            </div>
        </g:each>       
    </body>
</html>

I have some table inserted via BootStrap file. In which I have defined some as completed and some as not completed via setting true and false respectively.

But the problem is, while rendering(that is when viewing in browser), I’m getting the output only as this :

enter image description here

And the output screen suggests that these lines from the view file have not rendered :

<div id = "todayswork" >
        ${completedtask.task} completed by
        ${completedtask.schedule.user.login}
</div>

No errors have shown, where I went wrong? Whats happening behind the scenes?

Edit:

I found out the problem is with boolean type in Domain class DaySchedule. If I change that to String and use "yes" in place of true. I get what I need. But why boolean is not working properly?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:15:14+00:00Added an answer on May 27, 2026 at 2:15 pm

    Keep your completed as boolean – having it as a String with ‘yes’/’no’ is just plain clutter.

    Try change your actionh to:

    def allcompletedtask = {
        def completedwork = DaySchedule.findAllByCompleted(true)
        println completedwork // Just to check if your model is correct
        [ completedwork : completedwork ]
    }
    

    I see no reason why you would use query by example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a domain model that looks like this: case class Account(id: Int, name:
I have a model named Domain which looks like this: class Domain(models.Model): Model for
I have this domain class. class Book { String code String description static mapping
I have this domain: public class Phone { public int Id { get; set;
I have the following domain class: class Car{ int hp Date registrationDate } Now
I have the following Grails domain class: class Product { String name Float basePrice
If I have domain classes like: class A { short aCode //... static hasMany
I have the following domain: public class FileInformation { public String FileName; public String
greetings all i have a domain class named car and i have an object
Right now, I have a domain entity named StyleBundle. This StyleBundle takes a list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.