-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I found IDE tell me it's deprecated about "comp.setVariable(comp.getId() + "Ctrl", this, true);"
Is any newer way to write MVC ?
Is there any article will introduce it ?
Is there any different ?
If i still use setVariable, is any shortcoming for me ?
Like "deprecate" means in ALL Java libraries, it means the API is kept there for "backward compatibility and might be removed in the future". So new created application will not "misuse" the API again.
The replaced method shall be written in Java doc of the "deprecated" one and take a detail look on the "Upgrade Note" of the ZK release-note.
The attribute seems no datasource for EL. I use this sometimes to get the same name for EL's and @databinding ("controller", "model").
This smalltalk (Fusioncomposer) uses setVariable for EL.
How is the new way for register a EL-Datainterface?
(like this smalltalk)
Note: I use actually cmp.setVariable("controller", this, true); to set the composer as datasource controller for EL.
/Robert
@Robert,
Use cmp.setAttribute("controller", this, Components.SPACE_SCOPE) instead. It is almost identical to cmp.setVariable("controller", this, true)
cmp.setVariable keeps value (the "this") in component "cmp"'s ID space owner. And EL can refer it via its given key "controller".
Henri, Iantsai
thanks for the answers. There are 2 threads. We found the answer in the other thread.
in short:
cmp.setAttribute("controller", this, Components.SPACE_SCOPE) works for EL, but not in the old ZK-Versions (i've changed my 3.6 example).
/Robert
Asked: 2009-12-06 12:30:07 +0800
Seen: 1,571 times
Last updated: Dec 22 '09