English 中文(简体)
防止一些聪明价值观 GWT IPickTreeItem待选
原标题:Prevent some values of SmartGWT IPickTreeItem to be selected

I m试图在上澄清用户选定的价值。

这是在上发现的唯一解决办法,即限制使用者选择某些树根值(并非全部)。

To be more clear, it seems that calling event.cancel() do not stop the event from bubbling.

我做了一些错误?

TreeNode treenode = new TreeNode("root", new TreeNode("Operation A"),
new TreeNode("Operation B"));

final DynamicForm dynamicForm = new DynamicForm();

Tree tree = new Tree();
tree.setRoot(treenode);

final IPickTreeItem pickTreeItem = new IPickTreeItem();
pickTreeItem.setValueTree(tree);
pickTreeItem.addChangeHandler(new ChangeHandler()
{
    @Override
    public void onChange(ChangeEvent event)
    {
        pickTreeItem.clearValue() // Not clearing the value
        pickTreeItem.setValue((String)null) // Not working neither
        event.cancel() // Not seeming to work...
    }
});

dynamicForm.setItems(pickTreeItem);
dynamicForm.draw();

http://www.ohchr.org。

pickTreeItem.setInputTransformer(new FormItemInputTransformer()
{

    @Override
    public Object transformInput(DynamicForm form, FormItem item,
    Object value, Object oldValue)
    {
        return "Desired New Value (not working)...";
    }
});

之所以如此,是因为it利用外部布顿来清理价值。 (除小块田外)

Button bt = new Button("click");
bt.addClickHandler(new ClickHandler()
{
    @Override
    public void onClick(ClickEvent event)
    {
        pickTreeItem.setValue((Object) null);
    }
});

Expected behavior

我的树木:

-aaaa
----bbbb
----cccc
-dddd
----eeee
----ffff

如果用户选择“aaa”类,PickTreeItem值应当重新回到默认Value(“Choose a Value”),可选择通知用户他不能“aaaa”。

PickTreeItem应当接受“dddd”作为有效的选择价值。

最佳回答

同所有表格一样,event.cancel()是消除这一变化的正确途径。 有一个框架层次的 b子,使这一行为无法正确进行,现在已经得到纠正。

,此版已在Iso吗?

问题回答

我的理解是,这并不完全与你试图实现的目标相同,但你可以考虑界定一个习惯性变体,即某些价值和回报不实,如果选择一个本应实现的母体价值的话,则是一种适当的信息。 为了做到这一点,你必须制定小项目(Boolean.TRUE),以便选择母项目,并在选择时验证选定的价值。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...