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

  • SEARCH
  • Home
  • 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 6955401
In Process

The Archive Base Latest Questions

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

I have a controller like this : def mytask = { def user =

  • 0

I have a controller like this :

def mytask = {
        def user = User.findByLogin(params.id)
        def mywork = user.schedules.daySchedules
        [ mywork : mywork ]
    }

Where I’m trying to find all the tasks assigned to a particular user. I have a corresponding view file :

<g:each in="${mywork}" var="tasks">
                <div id = "todayswork">
                        ${tasks.task}               
                    </div>
                    <div id ="Dates">
                        ${tasks.startTime}-
                        ${tasks.endTime}
                    </div>
                    <hr/>
            </g:each>

Logic works fine, I’m getting the output as I wanted. For example, if I go to http://localhost:8080/scheduleTest/daySchedule/mytask/anto my browser showing all the task for the user anto. But there is a problem in rendering it.

I’m getting the output as :

enter image description here

But I need the output something like this one:

enter image description here

How change my view file to get the appropriate output.

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:43:54+00:00Added an answer on May 27, 2026 at 2:43 pm

    It’s hard to tell from your examples, but my guess is you need to be looping over the tasks item, which appears to be a List in a List.

    This means change this:

    <g:each in="${mywork}" var="tasks">
    

    to this

    <g:each in="${mywork[0]}" var="tasks">
    // or
    <g:each in="${mywork.tasks}" var="tasks">
    

    Again, I’m not exactly sure where the problem is occurring, but one of those will fix it.

    The reason you are getting the output is that Groovy will automatically perform a property expansion on a list if the property is not defined on that list. Example:

    use(org.codehaus.groovy.runtime.TimeCategory) {
        def d1 = 5.minutes.ago
        def d2 = 1.week.from.now
        assert [d1, d2].time == [d1.time, d2.time]
    }
    

    It’s the same thing as writing list*.property, and returns a new list containing each property on the original items.

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

Sidebar

Related Questions

So basically I have a controller. something like this def show @user = User.find[:params[id]]
My Artist conroller, edit method looks like this def edit @user = User.find(params[:id]) end
I use params in my controller like this: class ProductsController < ApplicationController def create
I have a controller for an API that looks like this: def index respond_to
I have a controller like this: def download_link #It starts a background process to
I have controller methods that look like this: class TestController < ApplicationController def testAction
I have a method in my controller which uses send_data like this: def show
In our code we used to have something like this: *(controller->bigstruct) = ( struct
I have an action like this: public class News : System.Web.Mvc.Controller { public ActionResult
If you have a controller method like so: @expose(json) def artists(self, action=view,artist_id=None): artists=session.query(model.Artist).all() return

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.