每一个控件都有一个listener属性,可以用来定位一个服务定位表达式,通过这个表达式,
它最终可以映射为spring里面一个javaBean的一个java方法

例如设置DynaView1.view.xml里边的按钮button1的listener的属性值为

  spring:dynaView1#onButton1Init  (注意这里的dynaView的第一字母是小写)

然后新建DynaView1.java(注意这里的DynaView的第一字母是大写),并且在开始加@Component注入到Spring

package sample.chapter04;

import org.springframework.stereotype.Component;

import com.bstek.dorado.common.event.DefaultClientEvent;
import com.bstek.dorado.view.widget.base.Button;

@Component
public class DynaView1 {
    public void onButton1Init(Button button){
        button.setCaption("新增(动态设置Button1的属性)");
        button.setWidth("300");
        button.addClientEventListener("onClick", new DefaultClientEvent("dorado.MessageBox.alert('You clicked '+self.get('caption'));"));
    }
    
}

 

相关文章:

  • 2022-12-23
  • 2022-01-16
  • 2022-01-14
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2021-06-01
  • 2022-12-23
  • 2021-08-07
  • 2021-04-07
  • 2021-08-18
  • 2021-05-21
  • 2021-08-24
相关资源
相似解决方案