Hi,
I have a DetailView called Master_DetailView.
Master_DetailView has a property of type Child.
For the Child Class there are two detailviews, Child_DetailView and Child_DetailViewDIFF.
When in Master_DetailView and click on the Child object I want to be directed to Child_DetailViewDIFF instead of Child_DetailView.
When in Child_ListView and click on a Child object I want to be directed to Child_DetailView not Child_DetailViewDIFF.
Actually, in my real application scenario I will have Master_DetailView_A and Master_DetailView_B and if one clicks on the Child object I want to direct me to Child_DetailView_A from Master_DetailView_A and to Child_DetailView_B from Master_DetailView_B.
How can this be accomplished in XAF?
Thanks,
Costel.
We have closed this ticket because another page addresses its subject:
Web - Refactor our lookup and object property editors to provide the capability to show custom detail views instead of default ones.
Hello Costel,
In XAF, this task can be accomplished in two ways: via overriding the behavior of the standard controllers, or via the Model Editor.
For instance, to use the first, you should deal with the OpenObjectFromEditorController, ListViewProcessCurrentObjectController and override its corresponding methods, for instance the OpenObject method.
The idea is shown here: How to: Replace a List View's Default Action
The second approach can be accomplished via setting the DefaultXXX properties in the model on the class level, or on the Views level. For instance, you can set the DetailViewID attribute for the required ListView node to the changed default detail view.
To learn more about these attributes, refer to the product's documentation:
http://www.devexpress.com/Help/?document=expressapp/customdocument2586.htm
http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument2592.htm&levelup=true
Feel free to ask more questions, in case of any difficulty.
Thanks,
Dennis
Actually I initially tried the second approach with no success, before asking this question.
The two links for the second approach you gave me are http://www.devexpress.com/Help/?document=expressapp/customdocument2586.htm for BOModel Node and http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument2592.htm&levelup=true for Views Node.
As I said, for different detailviews I want different detailview links, so I cannot use the BOModel, cause that would be generic. It doesn't help me accomplish my goal.
In the second link I couldn't find anything to help me. I can see that a DetailView has a View property but it is referring to a ListView.
I would rather choose the second alternative if it's possible, because I find it easier to play with node attributes.
Is there a way to accomplish what I want using the model node attributes? If yes, what are these attributes that I must set ?
Thanks,
Costel.
Hello Costel,
Thanks for the update. No, to your last two questions. Usually all the generic solutions can be accomplished only via code. So, the second approach seems to be the best here.
Now knowing your requirements fully, that the links I gave you earlier are not totally suitable for you. So, let's go ahead with the second approach.
You wrote that you had some problems here, can I look at what you implemented?
Thanks,
Dennis
Hello Dennis,
You said that there are two ways, the first one by code and the second one by model attributes.
"The second approach" meanth the second way, that is via model. I've tryied by all the possible model node values I could think of and I ended up nowhere.
So regarding the first approach, the code one, I haven't tried one yet.
Also the link you gave me How to: Replace a List View's Default Action reffers to a list view not to a detail view as it says in its title "How to: Replace a List View's Default Action".
Hello Costel,
Thanks for the update. I am sorry that I gave incorrect information because I missed that you had a Web application. My apologies.
I am afraid, its not possible to accomplish your task without changing the XAF sources or making a new editor based on our sources. This is because, currently the related PropertyEditors code doesn't expose any virtual methods or anything else to inject some custom behavior.
There the default view is always created when a user click the hyper link representing the current object. I have created a new suggestion to refactor our code and provide more flexibility: Web - Refactor our lookup and object property editors to provide the capability to show custom detail views instead of default ones..
Thanks,
Dennis
Hello Dennis,
Ok, this is bad news, I will just have to build a new PropertyEditor based on XAF sources.
If I will have any problems doing that I will start a different thread.
Thanks for creating the suggestion,
Costel.
Just wanted to post a link to http://www.devexpress.com/Support/Center/p/Q202238.aspx for the readers of this thread.
Thanks again,
Costel.