Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7807459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:51:39+00:00 2026-06-02T02:51:39+00:00

Is there a way to get the proxy that editor is editing? The normal

  • 0

Is there a way to get the proxy that editor is editing?

The normal workflow would be:

 public class Class implments Editor<Proxy>{
  @Path("")
  @UiField AntoherClass subeditor;


  void someMethod(){
   Proxy proxy = request.create(Proxy.class);
   driver.save(proxy);
   driver.edit(proxy,request);
 }
}

Now if i got a subeditor of the same proxy

public class AntoherClass implements Editor<Proxy>{
   someMethod(){
   // method to get the editing proxy ?
    }
 } 

Yes i know i can just set the proxy to the Child editor with setProxy() after its creation, but i want to know if there is something like HasRequestContext but for the edited proxy.

This usefull when you use for example ListEditor in non UI objects.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:51:40+00:00Added an answer on June 2, 2026 at 2:51 am

    Two ways you can get a reference to the object that a given editor is working on. First, some simple data and a simple editor:

    public class MyModel {
      //sub properties...
    
    }
    
    public class MyModelEditor implements Editor<MyModel> {
      // subproperty editors...
    
    }
    

    First: Instead of implementing Editor, we can pick another interface that also extends Editor, but allows sub-editors (LeafValueEditor does not allow sub-editors). Lets try ValueAwareEditor:

    public class MyModelEditor2 implements ValueAwareEditor<MyModel> {
      // subproperty editors...
    
      // ValueAwareEditor methods:
      public void setValue(MyModel value) {
        // This will be called automatically with the current value when
        // driver.edit is called.
      }
      public void flush() {
        // If you were going to make any changes, do them here, this is called
        // when the driver flushes.
      }
      public void onPropertyChange(String... paths) {
        // Probably not needed in your case, but allows for some notification
        // when subproperties are changed - mostly used by RequestFactory so far.
      }
      public void setDelegate(EditorDelegate<MyModel> delegate) {
        // grants access to the delegate, so the property change events can 
        // be requested, among other things. Probably not needed either.
      }
    }
    

    This requires that you implement the various methods as in the example above, but the main one you are interested in will be setValue. You do not need to invoke these yourself, they will be called by the driver and its delegates. The flush method is also good to use if you plan to make changes to the object – making those changes before flush will mean that you are modifying the object outside of the expected driver lifecycle – not the end of the world, but might surprise you later.

    Second: Use a SimpleEditor sub-editor:

    public class MyModelEditor2 implements ValueAwareEditor<MyModel> {
      // subproperty editors...
    
      // one extra sub-property:
      @Path("")//bound to the MyModel itself
      SimpleEditor self = SimpleEditor.of();
    
      //...
    }
    

    Using this, you can call self.getValue() to read out what the current value is.

    Edit: Looking at the AnotherEditor you’ve implemented, it looks like you are starting to make something like the GWT class SimpleEditor, though you might want other sub-editors as well:

    Now if i got a subeditor of the same proxy

    public class AntoherClass implements Editor<Proxy>{
      someMethod(){  
        // method to get the editing proxy ?
      }
    }
    

    This sub-editor could implement ValueAwareEditor<Proxy> instead of Editor<Proxy>, and be guaranteed that its setValue method would be called with the Proxy instance when editing starts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to get the ID of the element that fires an
I suspect there is a way to update an Ember.Array proxy that will trigger
is there way how to get name ov event from Lambda expression like with
Is there any way to GET the ContentValues object from the SQLite? It's very
Is there a way to get the tests inside of a TestCase to run
Is there a way to get the current xml data when we make our
Is there any way to get Python to use my ActiveTcl installation instead of
Is there a way to get stored procedures from a SQL Server 2005 Express
Is there a way to get a DrawingContext (or something similar) for a WriteableBitmap
Is there a way to get the C/C++ preprocessor or a template or such

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.