[request] extensibility of AbstractEditComponentAction

3 posts / 0 new
Last post
atao
Offline
Joined: 10/15/2008
[request] extensibility of AbstractEditComponentAction

Vincent,

To add the ability to change the descriptor with the type of the model, or other data, may I request some change in org.jspresso.framework.application.frontend.action.std.AbstractEditComponentAction:

- in method "execute", replace

        IValueConnector componentConnector = getBackendController(context)
            .createModelConnector(ACTION_MODEL_NAME,
                   getViewDescriptor(context).getModelDescriptor()); 

  by

 

        IValueConnector componentConnector = getBackendController(context)
            .createModelConnector(ACTION_MODEL_NAME,
                    getModelDescriptor(component, context));

- add the method:

      protected IModelDescriptor getModelDescriptor(Object component, Map<String, Object> context) {
            return getViewDescriptor(context).getModelDescriptor();
      }

Regards

Pierre

 

vvandens
Offline
Joined: 05/29/2008
[request] extensibility of AbstractEditComponentAction

Hi Pierre,

You can already call getComponentToEdit(context) to get the component to edit so I don't think it's worth adding it to the signature. I've added the getEditModelDescriptor(Map<String, Object> context) to distinguish it from the general getModelDescriptor(Map<String, Object> context) method from AbstractActionContextAware.

However, why do you need to refine the model descriptor to something different from the model descriptor of the view ?

 

HTH,

Vincent

atao
Offline
Joined: 10/15/2008
[request] extensibility of AbstractEditComponentAction

Vincent,

When I wrote this post, I had in mind the patch I proposed in the previous thread [help] property descriptor and readibility gates about cardViewDescriptor, cf. http://www.jspresso.org/forum/help-property-descriptor-and-readibility-g...

As I was also working on a dialog view able to display a serie of components selected from a table, one after the other (with previous/next buttons), I thought a specify view descriptor (like the card one) would have been needed. But in fact no.

I still think it'd be a good feature.

Regards

Pierre