Giter Club home page Giter Club logo

Comments (22)

leekelleher avatar leekelleher commented on June 27, 2024 1

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.

leekelleher avatar leekelleher commented on June 27, 2024

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.

lele7 avatar lele7 commented on June 27, 2024

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.

mattbrailsford avatar mattbrailsford commented on June 27, 2024

Could you show me your code in DoSomething.cshtml partial?

from umbraco-ditto.

lele7 avatar lele7 commented on June 27, 2024
@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.

leekelleher avatar leekelleher commented on June 27, 2024

@lele7 Does the typedModel class have a namespace? It looks like your partial is missing a namespace reference.

from umbraco-ditto.

lele7 avatar lele7 commented on June 27, 2024

yup sorry sure the namespace is:
Company.Framework.ViewModels.TypedModel

from umbraco-ditto.

leekelleher avatar leekelleher commented on June 27, 2024

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.

lele7 avatar lele7 commented on June 27, 2024

Sadly not. I have the namespace in the directive...

from umbraco-ditto.

leekelleher avatar leekelleher commented on June 27, 2024

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.

lele7 avatar lele7 commented on June 27, 2024

ok sorry I forgot it to add first. ok I'll try the UmbracoViewPage.

from umbraco-ditto.

mattbrailsford avatar mattbrailsford commented on June 27, 2024

Using DittoView in your partial should be totally valid. Leave it with me and I'll see if i can replicate.

from umbraco-ditto.

lele7 avatar lele7 commented on June 27, 2024

ok thanks

from umbraco-ditto.

mattbrailsford avatar mattbrailsford commented on June 27, 2024

Can you show me the whole code for your controller?

from umbraco-ditto.

mattbrailsford avatar mattbrailsford commented on June 27, 2024

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.

lele7 avatar lele7 commented on June 27, 2024

Thanks for your quick help. I will check my code and comeback.

from umbraco-ditto.

lele7 avatar lele7 commented on June 27, 2024

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.

mattbrailsford avatar mattbrailsford commented on June 27, 2024

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.

lele7 avatar lele7 commented on June 27, 2024

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.

lele7 avatar lele7 commented on June 27, 2024

could it be that somewhere is missing the host part? in my opinion should it be the requested URL with hostname...

from umbraco-ditto.

lele7 avatar lele7 commented on June 27, 2024

Sure, thank you guys for your help!

from umbraco-ditto.

lele7 avatar lele7 commented on June 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.