jigarzon
jigarzon

Reputation: 1228

How to set dynamic content to an element in ui binder

Hi I have this code fragment in ui binder:

<ui:with field='resources'
    type='com.example.Resources' />
<g:HTMLPanel>
    <div class="innercontent">{resources.title}</div>
</g:HTMLPanel>

The resources.title part does not work. How can I access the field called "resources" to set the content of the div? Thanks!

Upvotes: 1

Views: 81

Answers (1)

Andrei Volgin
Andrei Volgin

Reputation: 41089

It should be:

<g:HTMLPanel>
    <div class="innercontent"><ui:text from="{resources.title}" /></div>
</g:HTMLPanel>

Upvotes: 2

Related Questions