This project is read-only.

Trash not displaying correctly

Topics: Developer Forum
Jul 9, 2008 at 3:25 PM
When I remove some items, they should appear in the trash. This happens, but the label for the trash is empty (so I cannot empty the trash). There isn't an icon for the trash either.

What could be the problem?
Jul 10, 2008 at 4:27 AM
Hmm, not sure. Maybe this can give you some clue.

When the application starts it scans the types by way of reflection and calls Initialize(...) on those marked by the [AutoInitialize] attribute. In N2.Edit.dll there's a class TrashcanInitializer that subscribes on DeletingItem from the persitence class and moves deleted items to the trashcan instead of deleting them in the database. If the trashcan isn't there it's creatd first.

Okay, writing I got a few ideas.

* Are you running in medium trust? If so you may need to register N2.Edit in n2/engine/assemblies.
* See if the trashcan shows up on the page /edit/install/diagnose.aspx
Jul 10, 2008 at 7:38 AM
Medium trust is not enabled and the trashcan shows up on the diagnose page at each item (as Trash) and as Trash - N2.Edit.Trash.TrashContainerItem (TrashContainerItem) .
Jul 17, 2008 at 5:43 AM

Still no ideas why the trash is not showing up? Today, I had another item in the navigation tree view (in edit mode) that didn't display the icon + title correctly. However, when I deleted the parent, the content frame was able to show the title in the "are you sure" message.

I think this has something to do with the failure of loading the icons. I will take a look into this and let you know.

Jul 17, 2008 at 8:01 AM
So when you delete items sometimes they are deleted without any confirmation message and are never moved into trash? Also the trashcan node isn't automatically created? What kinds of items are you throwing? Can the same type of item be trashed and not be trashed? Are any of the items decorated by the [NotThrowable] attribute?
Jul 17, 2008 at 8:14 AM
No, items are never removed without the trash can. The trash can node IS created, but there is no icon + text (I only see the dots and if I move something into the trash, I can expand the empty node and see the items in the trash).

Same for another node. I had a Purchase Wizard page (just a template). It was visible, but after a lot of coding in my templates, the icon + text were not visible any longer. Then, I added exactly the same template type to the same root, and that one did show up (again, there was an item (because of the dotted line at the left), but no icon + text). The second one I added was visible with icon + text.

When I wanted to delete the parent of the two purchase wizards, the text was visible (so it's not that the title is corrupt or something like that).

I hope this makes it more clear, but maybe not (it's hard to explain). I will investigate this and let you know.
Jul 17, 2008 at 3:18 PM
Ok, fixed it.

After investigating, I saw the li item of the trash had the nice invisible style set. I use an invisible style myself in the App_Theme to hide items. So, "my" invisible style seemed more important than the trashcan one.

I will rename my .invisible style to fixed this problem.
Jul 17, 2008 at 4:03 PM
It's strange that your theme interferes with the tree. If you look at /edit/web.config. Does it contain a <pages ... styleSheetTheme="">?
Jul 18, 2008 at 11:04 AM
Probably this behavior is set because I have this in my default web.config:



pages theme="ThemeName" styleSheetTheme="ThemeName" validateRequest="false">

This probably overrides the one in the edit directory. The edit page also has the style of my website (which I already found strange since the example page doesn't have this behavior). Maybe it's because I have included the Edit directory to my project (so the subversion plug-in of VS knows that it should be in the version system as well).

The web.config contains the styleSheetTheme="". I have no also added theme="" and it seems to work :)