Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gwt uibinder ui:with - calling methods with arguments

Tags:

java

gwt

I am using gwt uibinder. I want to dynamically set values to a field. I am trying something like this

<ui:with field="valuesStore" type='x.y.client.ValuesStore' />

and the field is set with value like this

<g:Label text='{valuesStore.getValue}'>Name</g:Label>

and the ValueStore has 2 methods

public String getValue(String key) {
    return localizedValues.get(key);
}

public String getValue() {
    return null;
}

The problem is i am unable to call the getValue(key). I could only call the no-args method meaning the following is not possible

<g:Label text='{valuesStore.getValue('name')}'>Name</g:Label>

Please clarify if there is a way to achieve this where i can call a method with arguments passed to it.

like image 254
javalearner Avatar asked Jan 20 '12 05:01

javalearner


1 Answers

That is not supported, only methods without arguments can be invoked. You are going to have to expose the name directly as a no args method.

Look at the documentation for FieldReferenceConverter, this describes the syntax used. You can see that there is no support for argument passing.

like image 59
ColinE Avatar answered Oct 29 '22 10:10

ColinE