Double click on collection view based on relationship

9 posts / 0 new
Last post
gayathri
Offline
Joined: 01/12/2010
Double click on collection view based on relationship

Hi All,

 

    I am really thankful for this great framework. This is  INCREDIBLE work!!

    I am a new user and I am currently evaluating this framework for developing an application. I am doing a prototype whereby there is an entity A which has a bi directional  N-N relationship with entity B. When I display the entity A, I am using BasicTableViewDescriptor to display the collection of entities B.  When the user selects a row from this collection, the double click functionality should take him to the original view of entity B. I added the   

<property name="rowAction" ref="addAsChildModuleFrontAction"/> under the tableviewdescriptor by following one of the discussions related to double click functionality.  When I double click, I see that the entity on the tree view is highlighted but the whole page remains blank. This is on Flex UI. I havent tried any other UI. Can you please give me some pointers ? I am really in the primitive stage of learning this framework and hence please excuse my ignorance.

 

Thanks

Gayathri

vvandens
Offline
Joined: 05/29/2008
Double click on collection view based on relationship

Hi Gayathri,

First of all, welcome to Jspresso and thank you very much for your kind words !

Regarding your problem, the standard addAsChildModuleFrontAction has only been designed to work on bean collection modules from which they take the detail view to install. That explains the blank (default) panel you see when triggering the action.

However, the way you try to use the addAsChildModuleFrontAction is actually very clever (allowing to nest details nodes in the workspace ree view) and I don't think it would be much work to improve the code of the standard action to support this usage scenario.

I can't work on it right now but give me some time and I should come back to you with a fix in a new SNAPSHOT hopefully tomorrow.

 

Best,

Vincent

gayathri
Offline
Joined: 01/12/2010
Double click on collection view based on relationship

Thanks Vincent for the prompt reply. Thanks for working on this. This is great !! I will look forward for the NEW SNAPSHOT.

 

Thanks

Gayathri

vvandens
Offline
Joined: 05/29/2008
Double click on collection view based on relationship

Hi Gayathri,

I've just uploaded the new snapshot so your rowAction should work as expected now.

Be aware that without further configuration, the view used to display the selected B entity will be a default component view. Whenever you want to customize it, you can do so by setting the childModuleProjectedViewDescriptor property on the attached addAsChildModuleFrontAction, e.g. :

<property name="rowAction">
<bean parent="addAsChildModuleFrontAction">
<property name="childModuleProjectedViewDescriptor" ref="YourCustomizedBView"/>
</bean>
</property>

 

Don't hesitate to post back if you have any problem.

HTH,

Vincent

gayathri
Offline
Joined: 01/12/2010
Double click on collection view based on relationship

Hi Vincent,

 

   Thanks so much for working on this.

   I downloaded the latest snapshot and tried it. When I double click, it takes me to the entity displayed in the default component view which appears to be distorted. So I tried to customize the view by adding what you mentioned

<property name="rowAction">
<bean parent="addAsChildModuleFrontAction">
<property name="childModuleProjectedViewDescriptor" ref="YourCustomizedBView"/>
</bean>
</property>

However, now when I do mvn compile and mvn package and restart the application, it does not even take me to the login screen. It gives me a blue blank screen. The console does not display any error. I tried started starting the server in debug mode and it does not stop at any breakpoint. Please give me pointers on what I am doing wrong. Thanks a lot for all your help.

Thanks again,

Gayathri

vvandens
Offline
Joined: 05/29/2008
Double click on collection view based on relationship

Hi Gayathri,

The customization I've posted was just plain wrong... Here is the good one :

 

    <property name="rowAction">
<bean parent="addAsChildModuleFrontAction">
<property name="wrappedAction">
<bean class="org.jspresso.framework.application.backend.action.module.AddBeanAsSubModuleAction">
<property name="childModuleProjectedViewDescriptor" ref="YourCustomizedBView"/>
</bean>
</property>
</bean>
</property>

 

HTH,

Vincent

gayathri
Offline
Joined: 01/12/2010
Double click on collection view based on relationship

Hi Vincent,

 

    This works great !! Thanks so much for all your help..

     I really like this framework. I am still learning this framework. Once I get a handle on things, I would definitely like to contribute,

 

Thanks again,

Gayathri

Marc
Offline
Joined: 07/08/2009
Click through referenced object

This idea is great indeed.

I have 2 questions on it:

1) I tried to play with it using Flex. It worked well for the first entity I double clicked. But for the second I get an entire blue (blank if you wish) screen. So I wander if I configured it well or wether you guys encounter the same?

2) I also wander what happens in case of entity inheritance. Would it be possible to show another view depending on the (sub)type of the referred object?

Thanks for your thoughts.

Marc

vvandens
Offline
Joined: 05/29/2008
Click through referenced object

Hi Marc,

1/ Could not reproduce what you describe (in Swing and in Flex), at least with the latest SNAPSHOT.

2/ In the example given above, you can specify the view to use for the child module (see <property name="childModuleProjectedViewDescriptor" ref="YourCustomizedBView"/>). You can perfectly install a polymorphic view (use an EntityCardViewDescriptor as introduced in a former thread).

The entity card view lets you register a list of views (cards) among which to select based on the actual model. The card list is traversed in a sorted way until the 1st compatible card (a card whose model descriptor is either from the class or from a super-class of the actual model instance) is found. The selected card is then displayed. The consequence of this rule s that you should register your cards from the narrower type (sub-types) to the more general ones (super-types).

 

HTH,

Vincent