-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
Is it possible to add dynamically a @DependsOn annotation to a method? By reflection or some ZK method?
The reason is: my object will only know @DependsOn object name on runtime.
Thanks in advance.
That's quite a rare question and I haven't tested this yet. Here's where I'd put a breakpoint to see how ZK does it internally when it encounters the annotation:
https://github.com/zkoss/zk/blob/v8.5.1.2/zkbind/src/org/zkoss/bind/xel/zel/BindELContext.java#L326
I assume the 3 String based parameters will be straight forward.
Except for the first parameter Binding srcBinding
. You'll need to find it inside the current Binder instance:
e.g. in your @Init-method of your ViewModel:
@Init
public void init(@ContextParam(ContextType.BINDER BinderCtrl binderCtrl) {
binderCtrl.getLoadPromptBindings(...);
}
see: https://github.com/zkoss/zk/blob/v8.5.1.2/zkbind/src/org/zkoss/bind/sys/BinderCtrl.java#L171
As said I haven't tested this, nor do I exactly know that's what you want. However I'd start looking/testing there.
Asked: 2018-06-16 04:28:27 +0800
Seen: 11 times
Last updated: Jun 25 '18
MVVM Notifychange works only along with @Command ?
[Announcement] ZK 8.5.1 is now available!
Highlight new release changes/new features in demo app
How can I make a button change its image by clicking on the same button?
Problems calling function 'sec:isAnyGranted' with zkspring 3.2 and Spring Security 4
webapp folder of ZK spring boot?
Can I set in runtime a new value to library property: org.zkoss.zk.ui.processMask.enabled:
There is BindUtils.postnotifyChange. can that help you?
chillworld ( 2018-06-17 04:16:52 +0800 )edit