Results 1 to 4 of 4

Thread: showing jobs and names

  1. #1
    Join Date
    Apr 2005
    Location
    Brazil
    Posts
    66

    Default showing jobs and names

    Hi 4 all,

    I need to show on a jsp file some data of my employee, and in the same form I need to show some jobs. so I'll can attach the jobs to the employee.

    My question is: Can I use bind to more than one object? like employee and jobs? where can I set this objects to send to the form(I'm using AbstractWizardController)?

  2. #2
    Join Date
    Aug 2004
    Location
    Carlisle, UK
    Posts
    184

    Default

    Not sure I fully understand the question, and I haven't used the WizardController, but I'll give it a go:

    Can I use bind to more than one object
    I think you can only use it with your command object. But you can bind to attributes of that object.

    like employee and jobs? where can I set this objects to send to the form?
    Seems like jobs would likely be a collection or array attribute of employee? In which case I'd think you'd set up the jobs as an attribute of the employee wherever you set up the employee - e.g. formBackingObject. As long as your employee has a get method for jobs, you can access the jobs collection in jsp el as ${employee.jobs}, and use it with spring:bind
    Chris Harris
    Carlisle, UK

  3. #3
    Join Date
    Apr 2005
    Location
    Brazil
    Posts
    66

    Default

    but there will be jobs that is not part of the employee... example...

    employee A has jobs B and C...
    but on the frontend, I need to show the data for the employee A, and:
    job B [checked]
    job C [checked]
    job D [unchecked]
    job E [unchecked]
    job F [unchecked]
    job G [unchecked]

    so I can check new jobs... =D

    thank u again

  4. #4
    Join Date
    Aug 2004
    Location
    Carlisle, UK
    Posts
    184

    Default

    Then I think the list of all jobs would be referenceData, as you suggested.
    Chris Harris
    Carlisle, UK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •