Comments (22)
Hi @lele7,
Since this isn't about a specific bug (or a bug that we can reproduce ourselves), it seems more like a general implementation issue. Can you start a thread in the forum (over on Our Umbraco) please?
https://our.umbraco.org/projects/developer-tools/ditto/ditto-feedback/
We prefer to keep the GitHub issues to specific bugs and feature requests. (This is outlined in our contribution guidelines.)
We'll try to help where we can over on Our Umbraco. Then if a specific bug with Ditto has been found, it can be raised back on here and we'll attempt to resolve it.
Thanks!
from umbraco-ditto.
Hi @lele7, which version of Ditto are you using?
The DitFlo feature was merged into the main Ditto project in v0.10 (the most recent version) and renamed to DittoView.
from umbraco-ditto.
Hi leekelleher
I'm using the version 0.9 with the (latest) DitFlo project... Matt told me already that you guys merged it together... but he means it's more or less the same than the latest DitFlo project
from umbraco-ditto.
Could you show me your code in DoSomething.cshtml partial?
from umbraco-ditto.
@inherits Our.Umbraco.DitFlo.Web.Mvc.DitFloView<typedModel>
<h2>@Model.View.Title</h2>
@foreach (var itm in Model.View.Items)
{
<p>@itm.Subtitle</p>
}
from umbraco-ditto.
@lele7 Does the typedModel
class have a namespace? It looks like your partial is missing a namespace reference.
from umbraco-ditto.
yup sorry sure the namespace is:
Company.Framework.ViewModels.TypedModel
from umbraco-ditto.
So if you change the partial directive to...
@inherits Our.Umbraco.DitFlo.Web.Mvc.DitFloView<Company.Framework.ViewModels.TypedModel>
... that should work.
from umbraco-ditto.
Sadly not. I have the namespace in the directive...
from umbraco-ditto.
Ah ok, Just that it was missing in the original code snippet. Hmmm, not really got much to go on here - sorry.
If your controller action is already returning the correct object type, then you don't need to use DitFlowView, I believe UmbracoViewPage be fine. (Unless I'm missing something?)
from umbraco-ditto.
ok sorry I forgot it to add first. ok I'll try the UmbracoViewPage.
from umbraco-ditto.
Using DittoView in your partial should be totally valid. Leave it with me and I'll see if i can replicate.
from umbraco-ditto.
ok thanks
from umbraco-ditto.
Can you show me the whole code for your controller?
from umbraco-ditto.
This is what I have setup (using Ditto 0.10) and it all works
Controllers/TestPartialController.cs
using System.Web.Mvc;
using DittoDemo.ViewModels;
using Our.Umbraco.Ditto;
namespace DittoDemo.Controllers
{
public class TestPartialController : DittoController
{
[ChildActionOnly]
public PartialViewResult DoSomething()
{
var typedView = new TestPartialViewModel();
typedView.MyProp = "HELLO WORLD";
return CurrentPartialView(typedView);
}
}
}
ViewsModels/TestPartialViewModel.cs
namespace DittoDemo.ViewModels
{
public class TestPartialViewModel
{
public string MyProp { get; set; }
}
}
Views/Partials/DoSomething.cshtml
@inherits DittoView<DittoDemo.ViewModels.TestPartialViewModel>
<h1>@Model.View.MyProp</h1>
Views/Layout.cshtml
...
@Html.Action("DoSomething", "TestPartial")
...
from umbraco-ditto.
Thanks for your quick help. I will check my code and comeback.
from umbraco-ditto.
hmm I have a strange issue... I've updated to the latest ditto version 0.10. I've got this error if I open the site: The resource cannot be found. If I removing the inheritance the site is working without contoller... so I think I have a routing issue...
If I try it with the SurfaceController inheritance the site is working too...
Do you have any idea why? Could it be an Umbraco version issue?
I'm using 7.5.2
from umbraco-ditto.
Strange, minimum requirement it 7.3.2 so shouldn't be any issues with 7.5.2. Can you send a fully copy of the stack trace?
from umbraco-ditto.
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /fr/services/etudes-comparatives
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0
from umbraco-ditto.
could it be that somewhere is missing the host part? in my opinion should it be the requested URL with hostname...
from umbraco-ditto.
Sure, thank you guys for your help!
from umbraco-ditto.
Hey guys
I think I found the issue... if I use the DittoView with an Ajax action call to update a PartialView the SetDataView on DittoView throws an null ref exception...
Umbraco had an issue in 7.4.0 (http://issues.umbraco.org/issue/U4-7950) which should fixed upper 7.4.1.
If I change the PartialView inheritance to UmbracoViewPage all works as expected.
from umbraco-ditto.
Related Issues (20)
- DittoCache examples HOT 2
- Changes to lazy properties HOT 7
- Documentation using GitHub Pages HOT 2
- UmbracoPicker returns wrong IPublishedContent in Umbraco 7.5.3 HOT 7
- Base Processor - exposing Umbraco context services HOT 5
- Custom Processor Contexts only persist a single .As() HOT 18
- Ditto Factory misusing `PluginManager.ResolveTypes`? HOT 10
- Ability to Conditionally Stop Processor Chain HOT 24
- XPath Processor? HOT 6
- Decimal mapping always 0 for negative values HOT 7
- Constructor Cache is no longer used HOT 3
- Orphaned Archetype Properties Cause Null Exception During Mapping HOT 3
- Migration to UMCO HOT 1
- Ditto-centric Stack Trace HOT 4
- Ditto processor attributes require a DittoProcessorMetaData attribute to be applied to the class but none was found. HOT 36
- Support for Umbraco v8 HOT 1
- Getting EntryPointNotFoundException on ditto objects HOT 2
- Excessive memory usage HOT 9
- Casting IPublishedContent to specific Model using Ditto mixing up property values between nodes on the same level HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from umbraco-ditto.