Announcement Announcement Module
Collapse
No announcement yet.
showing jobs and names Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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

      Comment


      • #4
        Then I think the list of all jobs would be referenceData, as you suggested.

        Comment

        Working...
        X