loop through rows in a model

its ok, I worked it out, I changed the apex input param to accept Id instead of String.

Thanks