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

Question

Question

Weblink 9 "Sort Items of Folders"

asked on September 16, 2015

I know this feature was not possible in weblink version 8 but I'm wondering if it change for version 9

 

Can we change browse folder view in weblink so it's sorted by Ascending order instead of Descending order.

I know if we manually click on the Name it resort to Ascending. Since we are using auto-login account we would like for that account to always sort Ascending.

 

0 0

Replies

replied on September 18, 2015 Show version history

Ivan,

 Open up the "Browse.aspx" file and find the following <weblink:documentbrowser> control code (set variables may differ);

<weblink:documentbrowser id="TheDocumentBrowser" runat="server" Height="100%" width="100%" MaxLength="25" OpenFoldersInPlace="False" ShowDownloadEdocButton="False"></weblink:documentbrowser>

Add the "Sort_Direction" variable to it and either give it a "ASC" or "DESC" value. This value will be used to sort on the default field.

<weblink:documentbrowser id="TheDocumentBrowser" runat="server" Height="100%" width="100%" MaxLength="25" OpenFoldersInPlace="False" ShowDownloadEdocButton="False" Sort_Direction="ASC"></weblink:documentbrowser>

Save the file and reload.

 

Note: Ascending is from smallest to largest and Descending is from largest to smallest.

replied on September 22, 2015

Wes,

That didn't fix my issue.

0 0
replied on September 23, 2015

Ivan,

 I do apologize has I did not completely put everything in the code that needs to happen in order for this to work. Please find below the complete steps outlining how to to default from largest to smallest (WebLink 9 only).

 

1. Open up the "web.config" file and find the following section:

<compilation defaultLanguage="c#" debug="true" targetFramework="4.5" />

2. Change this section to the following:

<compilation defaultLanguage="c#" debug="true" targetFramework="4.5">
<assemblies>
<add assembly="Interop.LFSO92Lib, Version=9.2.0.0, Culture=neutral, PublicKeyToken=607dd73ee2bd1c00"/>
</assemblies>
</compilation>

3. Save

4. Open up the "Browse.aspx" file and find the following <weblink:documentbrowser> control code (set variables may differ):

<weblink:documentbrowser id="TheDocumentBrowser" runat="server" Height="100%" width="100%" MaxLength="25" OpenFoldersInPlace="False" ShowDownloadEdocButton="False"></weblink:documentbrowser>

5. Add the "DefaultSortDirection" variable to it and give it the value of  "<%#LFSO92Lib.Sort_Direction.SORT_DIRECTION_ASC%>".

<weblink:documentbrowser id="TheDocumentBrowser" runat="server" Height="100%" width="100%" MaxLength="25" OpenFoldersInPlace="False" ShowDownloadEdocButton="False" DefaultSortDirection=<%#LFSO92Lib.Sort_Direction.SORT_DIRECTION_ASC%>></weblink:documentbrowser>

6. At the bottom of "browse.aspx" add the following code after the closing </html> tag:

<script language="vbscript" runat="server">
    Public Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreInit
       Me.ViewState("DefaultSortDirection") = LFSO92Lib.Sort_Direction.SORT_DIRECTION_ASC
       TheDocumentBrowser.DefaultSortDirection = LFSO92Lib.Sort_Direction.SORT_DIRECTION_DESC
    End Sub
</script>

7. Save

 

Now you may be scratching your head as to how this can possibly work when the values for the Sort_Direction are different in the PreInit routine. I believe there may be a bug going on behind the scenes as this code structure was the only way I could get the document browser to sort descending on the first initial launch and then persist that sorting on every subsequent request. It's bizarre but it works.

 

Hope this helps!

 

Wes Funderberg

0 0
replied on June 7, 2017

Would it be possible to set this up so that only one folder is set to descending order instead of all of them?

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

Sign in to reply to this post.