Original object from proxy

asked 2022-09-13 16:13:16 +0800

aUser gravatar image aUser
137 1 4


using the form attribute (proxy objects) is it possible to retrieve the original object which has been proxied in the validator class?


public class CustomValidator extends AbstractValidator {

    public void validate(ValidationContext ctx) {
        MyObj proxy = (MyObj) ctx.getBindContext().getValidatorArg("proxy");
        // get original object from proxy

I didn't find the ProxyHelper class useful.


delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-09-15 18:57:39 +0800

MDuchemin gravatar image MDuchemin
2480 1 6
ZK Team

Hey there,

If you are retrieving a FormProxyObject, you can do getOriginObject() on it to retrieve the real bean that was proxied as form binding. (using ctx.getProperty to retrieve the currently modified object, which is the same result as passing it as a validator argument in your original sample)


If you are using form proxy, I'd suggest being careful when you edit the original object while a proxy exist. You may overwrite changes when the proxy is written back to the origin.

link publish delete flag offensive edit


Thank you!

aUser ( 2022-09-20 18:45:54 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2022-09-13 16:13:16 +0800

Seen: 11 times

Last updated: Sep 15 '22

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More