带参数的调用方法

带参数的调用方法

本文介绍了gwt uibinder ui:带 - 带参数的调用方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在使用gwt uibinder。我想动态地将值设置为一个字段。 我正在尝试这样的事情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' />并且该字段的值是这样设置的$ / b>and the field is set with value like this<g:Label text='{valuesStore.getValue}'>Name</g:Label>并且ValueStore有2个方法and the ValueStore has 2 methodspublic String getValue(String key) { return localizedValues.get(key);}public String getValue() { return null;}问题是我无法调用getValue(key)。我只能调用no-args方法,这意味着以下是不可能的: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.推荐答案不支持,只有不带参数的方法才能被调用。您将不得不直接将名称作为no args方法公开。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.查看 FieldReferenceConverter ,这描述了使用的语法。你可以看到不支持参数传递。Look at the documentation for FieldReferenceConverter, this describes the syntax used. You can see that there is no support for argument passing. 这篇关于gwt uibinder ui:带 - 带参数的调用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-13 14:50