根据组合框中选择的值触发dojo onchange [英] firing dojo onchange based on value selected in combobox

查看:102
本文介绍了根据组合框中选择的值触发dojo onchange的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从按钮调用 dojo.wipein dojo.wipeout 时,一切正常。 但是是根据组合框中的值来调用它们的:我无法做到。有人知道如何根据组合框的值来调用 client 辅助脚本吗?

When calling dojo.wipein and dojo.wipeout from buttons, everything works great. But calling them based on the value in a combobox: I can't do it. Does anyone know how to make calling client side script depend on the value of a combobox?

换句话说,如果我将组合框更改为是,执行 dojo.wipein ,如果我将组合框更改为否,则执行 dojo.wipeout

In other words, if I change the combobox to "Yes", fire dojo.wipein, if I change the combobox to "No", fire dojo.wipeout.

编辑:谢谢大家的帮助。这是起作用的代码。我是javascript的初学者,可能会显示出来,但是可以。

Thank you everyone for your help. Here is the code that worked. I am a beginner in javascript, which might show, but it works.

var comboValue = dojo.byId("#{id:comboBox1}").value
if (comboValue == 'Yes'){
dojo.fx.wipeOut({node:'Lewiston',duration:400}).play();
}else if (comboValue == 'No'){
dojo.fx.wipeIn({node:'Lewiston',duration:400}).play();
}else{
alert("the value is neither yes nor no!")
}


推荐答案

在客户端JavaScript中,使用以下函数:

In your Client Side JavaScript, use the following function:

dojo.byId("#{id:FieldID}").value

其中字段ID是XSP对象的ID属性。这将计算出该元素的完整呈现ID,并返回其值以在客户端脚本中使用。

Where Field ID is the ID property of your XSP object. This will calculate out the full rendered ID of the element and return its value to use in your client script.

这篇关于根据组合框中选择的值触发dojo onchange的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆