Yea !!!! you are absolutely right. It worked when I removed type attribute
from <ui:with > tag. I was wondering it has to identify type to call
respective methods on the same and I realized that it tries to match the
variable name with that of name of the parameter to render method (which I
marked in blue color in below code).
----------------------------------------------------------------------------------------------------------------------------------------------
interface MyUiRenderer extends UiRenderer {
void render(SafeHtmlBuilder sb, *Person person*);
}
----------------------------------------------------------------------------------------------------------------------------------------------
So Finally working code looks like this.
PersonCell.java
----------------------------------------------------------------------------------------------------------------------------------------------
public class PearsonCell extends AbstractCell<Person> {
interface MyUiRenderer extends UiRenderer {
void render(SafeHtmlBuilder sb, Person person);
}
private static MyUiRenderer renderer =
GWT.create(MyUiRenderer.class);
@Override
public void render(com.google.gwt.cell.client.Cell.Context context,
Person value, SafeHtmlBuilder sb) {
renderer.render(sb, value);
}
}
----------------------------------------------------------------------------------------------------------------------------------------------
PersonCell.ui.xml
----------------------------------------------------------------------------------------------------------------------------------------------
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>
<ui:with field='person' />
<div>
First Name :
<span>
<ui:text from='{person.getFname}' />
</span>
<p>
Last Name :
<span>
<ui:text from='{person.getLname}' />
</span>
</p>
<p>
Email :
<span>
<ui:text from='{person.getEmailid}' />
</span>
</p>
</div>
</ui:UiBinder>
----------------------------------------------------------------------------------------------------------------------------------------------
Thanks Thomas for your valuable inputs. Without that it would have been
painful to identify the issue.
Thanks,
-Pandurang.
On Thursday, 19 July 2012 13:34:11 UTC+5:30, Thomas Broyer wrote:
>
>
>
> On Thursday, July 19, 2012 5:36:13 AM UTC+2, Vasu wrote:
>>
>> Yes you were right, it is instantiating new Person object. But if I try
>> to set Type to empty string validation fails and I cannot run the
>> application.
>
>
> I didn't mean to set it to the empty string, but to not use the attribute:
> <ui:with field="person" />
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/K3xzMkkBptoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.