0

I have a problem handling variables in grails webflow

Relevant part of the controller looks like this

ipcount{
        on('next'){
            flow.ipcount = params.int('ipcount')

            [flow: flow]
        }.to('systems')
        on('cancel').to('finish')
    }
    systems{
        on('next') {
            flow.hoster= params.hoster

            for (j in params.ipcount){

                flow.ip[j] = params.ip[j]
                flow.os[j] = params.os[j]
                flow.dns[j] = params.dns[j]

            }

I create a dynamic form in with the variable ipcount, which works fine. The problem is, I don't know how to handle the submitted values and if what I'm doing is correct.

At least when I want to try to display the results from the webflow I get an error

This is what I tried in the last step of the GSP file

<td valign="top" class="name">IP: ${flow.ip['1']}</td>

<td valign="top" class="name">IP: ${flow.ip[1]}</td>

<td valign="top" class="name">IP: ${flow.ip[${i}]}</td>

Nothing from the above works. I only get an error while trying to display the variables.

mbs
  • 421
  • 2
  • 8
  • 28

1 Answers1

1
  1. [flow: flow] why?
  2. j in params.ipcount ?? params.ipcount - is String. maybe params.list('ipcount') or 1..params.int('ipcount')
Olencha
  • 418
  • 2
  • 11