Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonas 123 posts 206 karma points
    Dec 04, 2015 @ 08:49
    Jonas
    0

    Listview within listview.

    As noted on the nibble.be comments it would be really cool to have a ListView within a ListeView.

    There is a relationship between 2 tables. The first table list People that are owners of pets, and when you click on one node in Owner it folds out and you can see all the Pets one Owner has, like children.

  • Comment author was deleted

    Dec 04, 2015 @ 09:23

    So on the people detail you would want to show a list view of all pets (related to that person)?

  • Jonas 123 posts 206 karma points
    Dec 04, 2015 @ 09:41
    Jonas
    0

    Exactly and also if search could be possible in all tables at the same time ;-) And be possible to edit the dogs properties

  • Comment author was deleted

    Dec 04, 2015 @ 11:31

    OK will see what I can whip up, having a nested listview is certainly possible

  • Comment author was deleted

    Dec 04, 2015 @ 14:29

    Making some progress on the listview field, just need to make sure it can filter now

    enter image description here

  • Comment author was deleted

    Dec 04, 2015 @ 15:17

    Marking the property will look something like this (so you need to define the type and also the foreign key colum that will be used to filter on).

        [Ignore]
        [UIOMaticField("Dogs", "Manage your pets", View ="list",
            Config = "{'typeName': 'Example.Models.Dog, Example', 'foreignKeyColumn' : 'OwnerId'}")]
        public IEnumerable<Dog> Dogs { get; set; } 
    

    Does this make sense? Still seeing if I can remove the typeName from the config since the property contains the type...

  • Comment author was deleted

    Dec 04, 2015 @ 15:45

    Ok just publised the new version to nuget that includes this list view

    https://www.nuget.org/packages/Nibble.Umbraco.UIOMatic/

    Let me know if you have further questions about this feature, have a good weekend!

  • Jonas 123 posts 206 karma points
    Dec 07, 2015 @ 09:01
    Jonas
    0

    Hi, great work.

    However when doing the listing of the first model it crashes the the first listview.

    Is it possible to ignore the property when not in edit mode for a specific "Owner"

  • Comment author was deleted

    Dec 07, 2015 @ 09:03

    So it crashes when you create a new object?

  • Jonas 123 posts 206 karma points
    Dec 07, 2015 @ 09:07
    Jonas
    0

    No, that works fine.

    But when I try to list Owners it crashes.

    However, if I remove the

    [Ignore]
        [UIOMaticField("Dogs", "Manage your pets", View ="list",
            Config = "{'typeName': 'Example.Models.Dog, Example', 'foreignKeyColumn' : 'OwnerId'}")]
        public IEnumerable<Dog> Dogs { get; set; } 
    

    List owners, and click on one Owner, I can se the edit page for that Owner, then if I add the above code , compile and reload the edit Owner page I can see the Dogs listview.

    It seems as if it is trying to populate the listview for Dogs when it is populating the listview for Owners

  • Comment author was deleted

    Dec 07, 2015 @ 09:10

    And if you mark it with the UIOMaticIgnoreFromListView attribute?

  • Comment author was deleted

    Dec 07, 2015 @ 09:11

    Then it shouldn't show up in the listview

  • Comment author was deleted

    Dec 07, 2015 @ 09:15

    Ok found the fix, just testing now and then I'll build a new version

  • Comment author was deleted

    Dec 07, 2015 @ 09:21

    Ok new version (1.4.1) is up https://www.nuget.org/packages/Nibble.Umbraco.UIOMatic/ that fixes the crash

  • Jonas 123 posts 206 karma points
    Dec 07, 2015 @ 09:49
    Jonas
    0

    Excellent, now it works like a charm!!

    :-)

  • Jonas 123 posts 206 karma points
    Dec 07, 2015 @ 10:09
    Jonas
    0

    One last,

    Is it possible to make the listview ReadOnly? ;-)

  • Comment author was deleted

    Dec 07, 2015 @ 10:12

    Sure will add a config option

  • Comment author was deleted

    Dec 07, 2015 @ 10:42

    You can now add an additional config option ('canEdit' : false)

        [Ignore]
        [UIOMaticField("Dogs", "", View ="list",
            Config = "{'typeName': 'Example.Models.Dog, Example', 'foreignKeyColumn' : 'OwnerId', 'canEdit' : false}")]
        public IEnumerable<Dog> Dogs { get; set; } 
    

    In the latest release 1.4.2

    Cheers, Tim

  • Comment author was deleted

    Dec 07, 2015 @ 09:50

    Great :)

  • Matthieu Nelmes 102 posts 385 karma points
    Dec 07, 2015 @ 10:44
    Matthieu Nelmes
    0

    Yes Tim!! This is what I was asking for!! #h5yr

  • Comment author was deleted

    Dec 07, 2015 @ 10:49

    @Matthieu great :) hope it's even more useful now

  • Jonas 123 posts 206 karma points
    Dec 07, 2015 @ 12:21
    Jonas
    0

    Is it possible to set on main view?

    [UIOMatic("Guest", "icon-users", "icon-user", RenderType = UIOMaticRenderType.List, Config = "{'canEdit' : false}")]
    
  • Comment author was deleted

    Dec 07, 2015 @ 13:39

    Ok implemented the following

     [UIOMatic("People", "icon-users", "icon-user",SortColumn="FirstName", ReadOnly = true)]
        [TableName("People")]
        public class Person : IUIOMaticModel
    

    SO you can set it to readonly on the uiomatic attribute

  • Comment author was deleted

    Dec 07, 2015 @ 13:42

    And it will be available on version 1.5.0 coming as soon as the build server kicks in https://www.nuget.org/packages/Nibble.Umbraco.UIOMatic/

  • Comment author was deleted

    Dec 07, 2015 @ 12:29

    @Jonas nope that isn't possible, so you want to be able to place a list view in read only mode (no create and no edit), can add that of course :)

  • Jonas 123 posts 206 karma points
    Dec 07, 2015 @ 12:35
    Jonas
    0

    Yes, thats the wish.

    Guess I am running out out wishes soon ;-)

  • Comment author was deleted

    Dec 07, 2015 @ 12:37

    Haha well I guess santa is here early for you ;) will add the option! Love these ideas btw makes it even better!

  • Zac 223 posts 575 karma points
    Dec 30, 2015 @ 16:57
    Zac
    0

    Awesome. I think it'd be great if we had different properties to allow or deny Create, Update, and Delete operations for each UIOMatic attribute, rather than just setting ReadOnly.

    Our use case is that we only want our users to modify a few attributes of existing data, so what I've done as a bodge is added a line in list.controller.js:

            $scope.readOnly = response.data.ReadOnly;
            //if this is of a specific type, let's set our new property
            $scope.updateOnly = $scope.typeName.indexOf('UIOMaticAttributeName, ExampleProject') != -1;
    

    and modified the list.html by adding to ng-hide attributes:

    <div class="btn-group" ng-hide="readOnly || updateOnly">
    

    This way I can hide the Create or Delete buttons. It doesn't stop the user from right-clicking in the left pane and clicking "Create" though.

    Also, is there any way to change the text rendered for the application in the backend? It's a little confusing for users to see "UI-O-Matic" and I couldn't figure out how to change it beyond changing the wand icon.

  • Jonas 123 posts 206 karma points
    Jan 22, 2016 @ 11:43
    Jonas
    0

    Hi, did you find a way to change from icon-wand and uiomatic in the backend?

  • Comment author was deleted

    Jan 22, 2016 @ 11:45
  • Jonas 123 posts 206 karma points
    Jan 22, 2016 @ 11:52
    Jonas
    0

    Great, thanks. Request to be included as config in future release.

  • David 5 posts 75 karma points
    Jan 20, 2016 @ 10:34
    David
    0

    Hi.

    Running 1.6.0 I'm having trouble using the filter on the Person view for in your mentioned case (dogs, persons) when using the property for Dogs on the Person model as discussed here. The property is set like:

            [Ignore]
            [UIOMaticIgnoreFromListView]
            [UIOMaticField("Dogs", "Example", View = "list",
                Config = "{'typeName': 'Example.Models.Dog, Example', 'foreignKeyColumn' : 'OwnerId', 'canEdit' : false}")]
            public IEnumerable<Dog> Dogs { get; set; }
    

    When trying to use the filter I'm getting a 500 internal server error, SQLException Invalid column name "Dogs". The list of persons is working and clicking one will show the person page with the list of dogs correct. Filtering on the dogs page works as well.

    Can't seem to get a hang of what is wrong though? I saw you guys discussed inner joins in another thread "Foreign Keys with label view". Do I need to construct the BuildingQuery in that manner perhaps? Currently it's configured like:

    void PetaPocoObjectController_BuildingQuery(object sender, UIOMatic.QueryEventArgs e)
            {
                if(e.TableName == "Person")
                {               
                    e.Query.Where("SiteRootId = @0", UmbracoContext.Current.Security.CurrentUser.StartContentId);
                }
            }
    
  • Comment author was deleted

    Jan 20, 2016 @ 10:41

    Hmmm adding the ignore attribute should do the trick, what namespace is it coming form?

  • David 5 posts 75 karma points
    Jan 20, 2016 @ 11:29
    David
    0

    I'm not sure i quite follow. Add [Ignore] to OwnerId on its (dog) model as well besides the already present ignore attribute on the person model for dogs?

  • Comment author was deleted

    Jan 20, 2016 @ 11:30

    Nope you shouldn't add it to ownerid, but it seems like it isn't doing the trick on the dogs property (the ignore attribute) so maybe it's the wrong attribute (coming from a different namespace)

  • David 5 posts 75 karma points
    Jan 20, 2016 @ 12:25
    David
    0

    I've tried removing the ignore attribute on the Dogs property for Person model without any success. The dog model has the following for ownerId:

    [UIOMaticIgnoreFromListView]
            public int OwnerId { get; set; } 
    

    When entering list view for persons and start typing something in the search input for filtering I keep getting: Get 500 Internal Server Error with exception message: Invalid column name 'Dogs'.

    I've also noticed that whenever I click somewhere on the page I get an error in the browser console saying: Uncaught Error: Syntax error, unrecognized expression: #/uiomatic/uioMaticTree/edit/Example.Models.Person, Example, Version=1.0.1202.1258, Culture=neutral, PublicKeyToken=null which also shows up whenever I click on the page when on list view for Dogs.

  • David 5 posts 75 karma points
    Feb 09, 2016 @ 09:10
    David
    0

    No idea/solution to why the filtering isn't working in the list view for persons and why clicking on a list view page (persons or dogs) keeps giving uncaught errors in the browser console?

  • Comment author was deleted

    Feb 09, 2016 @ 10:00

    Sorry didn't have time to look yet will try to see why it's happening this week

  • TrantSteel 4 posts 72 karma points
    Nov 06, 2016 @ 01:31
    TrantSteel
    0

    Hello,

    the listview feature in the umbraco backend is awesome!

    But how do i display the listview in a template, so i can see it in the frontend website? I should be able to access the property by its alias "layout" and then get the columns for example. How do i get the columns?

    var layout = CurrentPage.Content.GetProperty("layout");
    var columns = layout.Columns;
    

    enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft