Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

MVC data binding dynamically

Hi Friends,

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 ?

Please help.

Regards,

Ram.

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question