You are viewing limited content. For full access, please sign in.

Question

Question

Weblink 9 Folder tree missing ?

asked on March 26, 2015

I am trying to add Folder tree option on the left panel, and was using this code before <weblink:FolderTree  ID="TheFolderTree" runat="server" /> , that worked but I am not sure if this control still exists  on Weblink 9 ? And is there a download for the solution file for Weblink 9 or its only available to those who have SDK package ?

 

0 0

Answer

APPROVED ANSWER
replied on March 27, 2015 Show version history

I played around a little, and here's something I came up with to make the folder tree update when you open a folder.  It works for me locally.

First, start with Wes's script in the other thread.

Next, in Browse.aspx.vb at around Line 150, you should see the following:

TheDocumentBrowser.BaseUrl = Request.ApplicationPath & "/" & dbid & "/fol/" & StartFolderID & "/Row{0}.aspx"

SetBrowserStartID(StartFolderID)

You'll want to add "TheFolderTree.OpenFolder(StartFolderID)" between those lines, so you end up with:

TheDocumentBrowser.BaseUrl = Request.ApplicationPath & "/" & dbid & "/fol/" & StartFolderID & "/Row{0}.aspx"
TheFolderTree.OpenFolder(StartFolderID)
SetBrowserStartID(StartFolderID)

In the same document Browse.aspx.vb, you should see the following around line 273:

If args.SelectedEntryType = Entry_Type.ENTRY_TYPE_FOLDER Then
    If EntryIDToOpen <> args.SelectedEntryID Then
        ' Open a shortcut -- this function retrieves the path to the folder
        SetBrowserStartID(EntryIDToOpen)
        'TheFolderMetadata.OpenFolder(EntryIDToOpen)
    Else
        ' Open a child of the current folder -- the path is already known
        SetBrowserStartID(EntryIDToOpen)
        'TheFolderMetadata.OpenChildOfCurrentFolder(EntryIDToOpen, args.SelectedEntryName, args.SelectedEntryFlags, True)
    End If
Else

Lines beginning in ' are code comments; the ones I put in bold are old code snippets pertaining to the folder tree, left in the document as comments to show how to invoke the old code.  So you'll see that our replacement code is actually quite similar to those code comments.  You'll want to replace the above with the following:

If EntryIDToOpen <> args.SelectedEntryID Then
    ' Open a shortcut -- this function retrieves the path to the folder
    SetBrowserStartID(EntryIDToOpen)
    TheFolderTree.OpenFolder(EntryIDToOpen)
Else
    ' Open a child of the current folder -- the path is already known
    SetBrowserStartID(EntryIDToOpen)
    TheFolderTree.OpenChildOfCurrentFolder(EntryIDToOpen, args.SelectedEntryName, args.SelectedEntryFlags, True)
End If

^(this snippet updated May 2015)

Finally, in the same file Browse.aspx in the method FolderBreadcrumbNavigation_ClickedBreadcrumb at around line 300, you want to do something similar. 

Before:

Private Sub FolderBreadcrumbNavigation_ClickedBreadcrumb(ByVal sender As Object, ByVal e As WebLinkControls.ClickedBreadcrumbEventArgs) Handles FolderBreadcrumbNavigation.ClickedBreadcrumb
    SetBrowserStartID(e.SelectedFolderID)
    'TheFolderMetadata.OpenFolder(e.SelectedFolderID)
End Sub

After:

Private Sub FolderBreadcrumbNavigation_ClickedBreadcrumb(ByVal sender As Object, ByVal e As WebLinkControls.ClickedBreadcrumbEventArgs) Handles FolderBreadcrumbNavigation.ClickedBreadcrumb
    SetBrowserStartID(e.SelectedFolderID)
    TheFolderTree.OpenFolder(e.SelectedFolderID)
End Sub

Whew!  That may look like a lot, but in reality you're only changing five lines of code in one file. :)

Remember to recompile the solution before testing.  Let me know how that works out!!

3 0

Replies

replied on April 14, 2015

Hi There,

Anyone found a solution?

Avri

1 0
replied on April 27, 2015

Hi Avri, 

Have you spoken with your VAR about this? Someone should have reached out to them to help answer your question. It's not really the type of question that we can help with in this type of forum. 

1 0
replied on March 26, 2015

All of the controls that existed in WebLink 8 still exist in version 9.  If you follow the same steps you did when you added it in version 8 it should work fine.

0 0
replied on March 26, 2015

No i double tripple checked the code and all the files that need to be modified for the folder tree to work on the left panel, I am still not able to load the page still getting error. Anyone else here attempted it on latest weblink 9 ?  I do not think i can involve support on this issue.

0 0
replied on March 26, 2015

What is the error you are getting?  If I had to guess, you haven't recompiled the project, which is necessary when adding server controls to an ASP.Net project.

1 0
replied on March 26, 2015

Getting this, i am not sure where i am missing the reference !

 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:
 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:
 

[NullReferenceException: Object reference not set to an instance of an object.]
   WebLinkControls.EntryRow.ShowRow() +228
   WebLinkControls.FolderTreeNode.ShowRow() +26
   WebLinkControls.FolderTree.InitializeRootNode() +357
   System.Web.UI.Control.LoadRecursive() +70
   System.Web.UI.Control.LoadRecursive() +189
   System.Web.UI.Control.LoadRecursive() +189
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3177
0 0
replied on March 27, 2015

I did the soultion compile on studio and all the sudden its working now not sure maybe it just to be recompiled ?

0 0
replied on March 27, 2015

Hi Sumeet,

How did you manage to compile WebLink?  Do you have an SDK? Which .Net Framework and Visual Studio are you using?

Avri

0 0
replied on March 27, 2015

There is a .sln file that is installed with WebLink.  You can open it with any version of Visual Studio 2012, including the free one (Express).

0 0
replied on March 27, 2015

Hi Brian,

When I do I get the following.   When I compile and run the project Weblink does not load.

Avri

0 0
replied on March 27, 2015

The WebLink controls don't support Design View.  There should be a tab at the bottom of the panel to switch to Code View.  Any problems with design view are unrelated to what happens at run time.

0 0
replied on March 27, 2015

This is what I am getting at run time.

0 0
replied on March 27, 2015

I do not know if running it will be feasible, i could not run it either unless i have VS on the server where weblink is installed, cannot get it to run locally myself, so have to just rebuild it and keep testing on the server itself if it is working or not. Kind of painful.

 

But i am not happy with foldertree, it's failing miserably because i cannot get the thedocumentbrowser to sync with foldertree ! I was hoping new version will include a nice left hand folder panel view. Guess weblink is again going to be sit on our server not utilized cause the gui is so horrible. Why can it not have a nice left panel expandable folders by default like windows explorer view or should i say "web access" view !!

I give up on weblink !

0 0
replied on March 27, 2015

Avri: Did you try what I mentioned in response to your previous question about this same issue? I have not heard back from you, and what I mentioned would definitely be causing issues. In general, please do not post the same issue in multiple places: if you respond to the same thread with additional information, it ensures that people joining the discussion have all the information, and that people do not duplicate efforts by suggesting fixes that have already been tried. If what I have suggested is not working, please update in your initial thread.

Sumeet: I am sorry you are feeling frustrated. However, last you posted, it seemed to have worked:

And as Brian mentioned, yes, a recompile is necessary:

 

Is the folder tree now showing, but not acting as you expect? If so, can you explain more about what is not working for you?

0 0
replied on March 27, 2015 Show version history

Brian it works but I have no idea what controls exists. All i am trying to do is have it behave exactly like Webaccess (have folder tree on left with folders and file on right).  And i do not know why "page of x of y" is showing up in folder view as well, i do not think that showed up on Weblink 8 on the left pane ! Kind of annoying to see Page 1 of 1 for foldertree !

 

 

0 0
replied on March 27, 2015 Show version history

Hi Sumeet,

You can get rid of the extraneous 'Page X of Y' by adding the following lines to your WebLinkStyles.css:

#TheFolderTree .BrowserFooter {
    display: none;
}

Thanks for pointing that out!

As far as the syncing, I see that Wes got you off to a really great start in this thread.  Your reseller may be able to help you get it even closer to the behavior you want.  My understanding is that you want to add code so that when you open a folder in the right pane, the folder tree will expand and show the contents of that folder.  Is that correct?

[edit:] I've added a solution for the synchronization of the controls below.  In addition, here's a suggested update for WL9 to the HTML in Wes's solution, so you can get the new arrow styling/behavior (and not bombard the city of Aiken's server ;]).  In Browse.aspx, where Wes has:

<a title="Hide" id="__FoldersExpando" class="FolderExpandoClass" href="javascript:void(0);" onclick="ToggleSectionVis('__FoldersDataSection','__FoldersExpando');">
<img src="https://www.cityofaikensc.gov/WebLink8/images/chevronup.gif" class="FolderSectionExpando">
<span class="FolderSectionTitleText">Folders</span>
</a>

You might want:

<a title="Hide" id="__FoldersExpando" class="FolderExpandoClass" href="javascript:void(0);" onclick="ToggleSectionVis('__FoldersDataSection','__FoldersExpando');" aria-haspopup="true" aria-expanded="true"><img src="images/new_sprite/upArrowCollapse.png" class="FolderSectionExpando"><span class="FolderSectionTitleText">Folders</span></a>

(Make sure there's no whitespace between the elements!)

1 0
APPROVED ANSWER
replied on March 27, 2015 Show version history

I played around a little, and here's something I came up with to make the folder tree update when you open a folder.  It works for me locally.

First, start with Wes's script in the other thread.

Next, in Browse.aspx.vb at around Line 150, you should see the following:

TheDocumentBrowser.BaseUrl = Request.ApplicationPath & "/" & dbid & "/fol/" & StartFolderID & "/Row{0}.aspx"

SetBrowserStartID(StartFolderID)

You'll want to add "TheFolderTree.OpenFolder(StartFolderID)" between those lines, so you end up with:

TheDocumentBrowser.BaseUrl = Request.ApplicationPath & "/" & dbid & "/fol/" & StartFolderID & "/Row{0}.aspx"
TheFolderTree.OpenFolder(StartFolderID)
SetBrowserStartID(StartFolderID)

In the same document Browse.aspx.vb, you should see the following around line 273:

If args.SelectedEntryType = Entry_Type.ENTRY_TYPE_FOLDER Then
    If EntryIDToOpen <> args.SelectedEntryID Then
        ' Open a shortcut -- this function retrieves the path to the folder
        SetBrowserStartID(EntryIDToOpen)
        'TheFolderMetadata.OpenFolder(EntryIDToOpen)
    Else
        ' Open a child of the current folder -- the path is already known
        SetBrowserStartID(EntryIDToOpen)
        'TheFolderMetadata.OpenChildOfCurrentFolder(EntryIDToOpen, args.SelectedEntryName, args.SelectedEntryFlags, True)
    End If
Else

Lines beginning in ' are code comments; the ones I put in bold are old code snippets pertaining to the folder tree, left in the document as comments to show how to invoke the old code.  So you'll see that our replacement code is actually quite similar to those code comments.  You'll want to replace the above with the following:

If EntryIDToOpen <> args.SelectedEntryID Then
    ' Open a shortcut -- this function retrieves the path to the folder
    SetBrowserStartID(EntryIDToOpen)
    TheFolderTree.OpenFolder(EntryIDToOpen)
Else
    ' Open a child of the current folder -- the path is already known
    SetBrowserStartID(EntryIDToOpen)
    TheFolderTree.OpenChildOfCurrentFolder(EntryIDToOpen, args.SelectedEntryName, args.SelectedEntryFlags, True)
End If

^(this snippet updated May 2015)

Finally, in the same file Browse.aspx in the method FolderBreadcrumbNavigation_ClickedBreadcrumb at around line 300, you want to do something similar. 

Before:

Private Sub FolderBreadcrumbNavigation_ClickedBreadcrumb(ByVal sender As Object, ByVal e As WebLinkControls.ClickedBreadcrumbEventArgs) Handles FolderBreadcrumbNavigation.ClickedBreadcrumb
    SetBrowserStartID(e.SelectedFolderID)
    'TheFolderMetadata.OpenFolder(e.SelectedFolderID)
End Sub

After:

Private Sub FolderBreadcrumbNavigation_ClickedBreadcrumb(ByVal sender As Object, ByVal e As WebLinkControls.ClickedBreadcrumbEventArgs) Handles FolderBreadcrumbNavigation.ClickedBreadcrumb
    SetBrowserStartID(e.SelectedFolderID)
    TheFolderTree.OpenFolder(e.SelectedFolderID)
End Sub

Whew!  That may look like a lot, but in reality you're only changing five lines of code in one file. :)

Remember to recompile the solution before testing.  Let me know how that works out!!

3 0
replied on March 30, 2015

Hi Melanie,

This really helps thank you.

I have one issue now.  The current folder name is included with its children.

Avri

0 0
replied on March 30, 2015

Thanks Melanie, but it works in a weird way. It creates a mirror of folder tree, see the image attached.

0 0
replied on March 30, 2015 Show version history

Also noticed that the "tree/folder" that opens up takes out the other "main" folders as you can see from image,

ITGroup is top folder, click on Form Submission folder on the right hand and it opens up at the very bottom and the "printers" folder is no longer visible but instead there exists FormSubmisison at the very bottom.

 

Basically same issue as Avri Pointed out "its not same folder name" its actually the entire folder tree "repeating".

0 0
replied on April 7, 2015

So no resolution ? Why it's happening to Avri and myself, Avri were you able to resolve this on your end ?

0 0
replied on April 8, 2015

Hi Sumeet,

No..  I am waiting on Laserfiche for a solution.

They should provide a flag to display folder trees as well as metadata.

 

Avri

0 0
replied on April 27, 2015

Any solution???

We are thinking of reverting back to Weblink 8.2 instead of Weblink 9

Avri

0 0
replied on April 27, 2015

I will see what they have to say.

Tnx

0 0
replied on May 4, 2015 Show version history

Hi Avri,

I've spoken with development and to fix the issue of the selected folder from the right pane getting added into the folder tree as a duplicate folder, then please change the modified code suggested above from

If EntryIDToOpen <> args.SelectedEntryID Then
    ' Open a shortcut -- this function retrieves the path to the folder
    SetBrowserStartID(EntryIDToOpen)
    TheFolderTree.OpenFolder(EntryIDToOpen)
Else
    ' Open a child of the current folder -- the path is already known
    SetBrowserStartID(EntryIDToOpen)
    TheFolderTree.OpenFolder(EntryIDToOpen)
    TheFolderTree.OpenChildOfCurrentFolder(EntryIDToOpen, args.SelectedEntryName, args.SelectedEntryFlags, True)
End If

to

If EntryIDToOpen <> args.SelectedEntryID Then
    ' Open a shortcut -- this function retrieves the path to the folder
    SetBrowserStartID(EntryIDToOpen)
    TheFolderTree.OpenFolder(EntryIDToOpen)
Else
    ' Open a child of the current folder -- the path is already known
    SetBrowserStartID(EntryIDToOpen)
    TheFolderTree.OpenChildOfCurrentFolder(EntryIDToOpen, args.SelectedEntryName, args.SelectedEntryFlags, True)
End If

Basically, just remove the line "TheFolderTree.OpenFolder(EntryIDToOpen)" from the "Else" section. After you recompile the project, you should notice that the folder tree in WebLink 9 will now behave the same as the folder tree in other client side applications like the desktop Client and Web Access. When you select a folder from the right pane, the folder level that the selected folder is a part of will be expanded in the tree and the selected folder will be indicated as being opened. However, the selected folder itself will not be automatically expanded in the tree.

With the slight change to Melanie's suggestion, here is what you see in WebLink 9

And here is what you see in the desktop Client

In both cases, after I logged into the repository, I went into the right pane and I selected the "_Cases" folder followed by the "160000-169999" folder. Both applications behave the same in that the folder tree on the left will expand up to the same folder level that "160000-169999" is located at and indicate that folder being opened, but it does not automatically expand to show the subfolders underneath "160000-169999" in the folder tree.

Note that if what you are wanting is to also auto-expand the selected folder from the right in the folder tree on the left, then we can look into that as an enhancement for a future release of WebLink. However, the suggestions by Wes from this previous thread and Melanie in this thread (with the slight change) will get you the default folder tree behavior found in our other client side applications.

4 0
replied on May 4, 2015

Hi Alexander,

This works. Thank you. :)

Your last note on auto-expand selected folder would be beneficial.  If you could place it on the list for future enhancements, I would be grateful.

Once again, thank you for the help.

 

Regards,

Avri

0 0
replied on August 27, 2015

Hi.

 

For the most part the solutions mentioned in this thread and the threads linked to this one have worked. However, when the client clicks a bookmark they configured in the Weblink Designer on Weblink home page the folder structure they see is duplicated as shown in the attachment.

The bookmark goes to the "Project Archive" folder and the result is a duplicate folder structure being displayed including the "Project Archive" folder and its parent, the "CRA" folder. The top level folder is not duplicated. If we log in to Weblink and select the "My Weblink - Browse" link instead of the bookmark the initial folder structure is displayed correctly. However, if we click the "Search" link and then click the "Browse" link the duplicate folder structure comes back. If we click on the top level folder ("Test-Do-Not-Use") the folder structure view returns to normal. Doing a simple screen refresh does not reset the duplicate folder display issue once the issue presents itself. The scripting changes have been implemented as outlined in these threads but the problem persists. The Laserfiche server version is 9.2.1.635 and WebLink is at version 9.0.1.275 on Windows Server 2008 using IE 11. Has anyone else run into this?

 

Thank you!

 

Rob

 

WebLink Duplicate Folder View.png
0 0
replied on August 28, 2020

Reviewing this and given the structural change with Web Link 10 would you go about conducting the same procedure by renaming the Browse9.aspx to Browse.aspx and making the same changes to the other files prefixed with Browse.aspx?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.