set webtop browsertree refresh

本文详细介绍了浏览器树中用于设置当前选中节点的两个方法:refreshTreeFromId 和 refreshTreeFromAbsolutePath。通过示例代码展示了如何使用这些方法,并提供了一个简单的调用示例。

There are two events on the browser tree (there are in the BrowserTree class):

refreshTreeFromId(Control oControl, ArgumentList oArgs);


refreshTreeFromAbsolutePath(Control oControl, ArgumentList oArgs);

These let you set the currently selected node on the browser tree. Look at the webtopclassicclassic.jsp file for an example. This has two methods, onClickContentObject() and onClickAbsolutePath(), that handle this. I think you can actually just call onClickAbsolutePath() to get it to work. You can fire this from Javascript, but it's probably easier to do it from your Java code. The args requires one item called ids, which should be a list of the node IDs separated by '.'s (the node IDs are usually the same as the component that the node would launch). So your code should look something like this (this assumes that the node IDs are in a String array called componentIds; where you get them from is up to you):

 

ArgumentList oArgs = new ArgumentList();
StringBuffer ids = new StringBuffer(72);

for (int i = 0; i < componentIds.length; i++)
{
if (ids.length() != 0)
{
ids.append('.');
}
ids.append(componentIds[i]);
}

if (ids.length() != 0)
{
oArgs.add("ids", ids.toString());
}
setClientEvent("onClickAbsolutePath", oArgs); 

 You'll probably need to play with this a little bit, but once you get it down, it's fairly straighforward.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值