MVC data binding dynamically
I have a requirement in one of my MVC views. I have an <htmlb:inputField> and i want to associate it to my Model class attribute dynamically i.e. i have the fully typed model attribute in a string and i wish to assign it to the inputField's value. But, my efforts are in vain.
Here's my code:
<% concatenate '//model/structure.' tmp into substr. %>
<htmlb:inputField id = "<%= tmp %>"
value = "<%= substr %>" />
The 'tmp' has the name of the structure component in it. The code gets compiled but when i run it the inputField has the whole model string (substr) as text inside the input box and is not actually getting binded with the model. How can we dynamically do this ?