You need to sign in to do that
Don't have an account?
Visualforce & Maps - Passing values back to the controller from the page
Dear all,
I'm sure there's an obvious workaround for this, but I'm not able to find it.
I'd like to create a table/repeat with multiple levels on a visualforce page, as below:
- Product A
Sub-Category 1
Sub-Category 2
Sub-Category 3
- Product B
Sub-category1...
I've achieved this by having a nested <rapex:repeat> tab on the visualforce page.
I also need to have an input field against the sub-category level settings, which can then pass values back to the controller (on submit, or similar). However, I'm having difficulties working out how to do so. It seems that I can either create a "flat" list and pass input values back, or have nested lists, but then be unable to do so.
Is it possible? Could somebody point me in the right direction? I've tried using maps, but it seems like the values of a map aren't changeable from the visualforce page?
With thanks,
Andy
Not sure if I understand your requirement completely, but maybe you could create a wrapper class for the Sub-Category object with a String variable to capture what you put in the input field.
e.g.
then in the VF page:
Ozymandias,
Thanks for your response. Sorry for not being clearer. I was trying to access the values within a map within a wrapper class, and then alter those values from the Visualforce page.
However, I found a workaround silimar to the one you suggested that removed the need for maps at this time. I also found that there is a way of using maps in Visualforce, as long you're using SObjects to pass the information back and forth between the client and the controller
With thanks,
Andy