jQuery: The Write Less, Do More JavaScript Library

TreeView Cookie Persistence Problem

View: New views
2 Messages — Rating Filter:   Alert me  

TreeView Cookie Persistence Problem

by Keith-116 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

I'm having some issues using the cookie persistence, it appears that
as long as the link is in the jsp directory the menu renders properly,
however if the link is not in the jsp directory the cookie is set to
null and when the page loads all of the trees are expanded.  Any help
would be greatly appreciated.

Here is the abridged version of the file that I'm using, this is
included on all pages of my application.

<div id="main"><a href=".">Main Demo</a>
        <div id="sidetree">
        <div class="treeheader"> </div>
        <div id="sidetreecontrol"><a href="?#">Collapse All</a> | <a href="?
#">Expand All</a></div>
        <ul id="tree">
                <li><span>Customer Accounts</span>
                        <ul>
                                <li>
                                        <a href="/jsp/viewflightcalcrit.jsp" >Flight Search</a>
                                </li>
                                <%if (request.getRemoteUser() != null){%>
                                <li>
                                        <a href="/jsp/accountselection.jsp">Customer Selection</a>
                                </li>
                                <%}%>
                                <%if (session.getValue("customer") != null) { %>
                                <li>
                                        <a href="/jsp/cards.jsp">Owner Profile</a>
                                </li>
                                <li>
                                        <a href="/jsp/communicationnotes.jsp">Owner Communication</a>
                                </li>
                                <%}%>
                                <%if (session.getValue("customer") != null && session.getValue
("jetcard") != null) {%>
                                <li>
                                        <a href="/jsp/viewflightactivity.jsp">View Flight Activity</a>
                                </li>
                                <%}%>
                                <%if ((request.isUserInRole("OwnerServices") ||
request.isUserInRole("Finance"))) { %>
                                <li>
                                        <a href="/jsp/ownerprofile.jsp?new=<%=userRegion%>">Add New
Customer</a>
                                </li>
                                <%if (session.getValue("customer") != null && userRegion ==
custRegion){ %>
                                <li>
                                        <a href="/jsp/clientcardentry.jsp">Add New Card</a>
                                </li>
                                <%}%>
                                <%}%>
                                <%if (request.isUserInRole("OwnerServices") || request.isUserInRole
("Finance")) {%>
                                        <%if (request.isUserInRole("Finance")) { %>
                                                <li>
                                                        <a href="/jsp/jetcardexpired.jsp">Expired Cards</a>
                                                </li>
                                        <%}%>
                                <%}%>
                                <%if(session.getValue("customer") != null && (request.isUserInRole
("Finance") || request.isUserInRole("Administrator") ||
request.isUserInRole("Sales") || request.isUserInRole("OSManager") ||
request.isUserInRole("OwnerServices"))){ %>
                                <li>
                                        <a href="/jsp/welcomecall.jsp">Welcome Call</a>
                                </li>
                                <%}%>
                                <%if(request.isUserInRole("Sales") || request.isUserInRole
("Administrator")){%>
                                <li>
                                        <a href="/jsp/index.jsp?viewdash=1">Dashboard</a>
                                </li>
                                <%}%>
                        </ul>
                </li>
                <%if (userRegion == 0 && request.isUserInRole("Finance")) { //begin
Accounts Block %>
          <li><span>Accounts</span>
                        <ul>
                                <%if (request.getRemoteUser() != null) { %>
                                <li>
                                        <a href="/jsp/njaccountsummary.jsp">Account Summary</a>
                                </li>
                                <%}%>
                                <%if(session.getValue("njcontract") != null){%>
                                <li>
                                        <a href="/jsp/viewnjflightactivity.jsp">View Activity</a>
                                </li>
                                <%}%>
                                <%if(request.isUserInRole("Finance") || request.isUserInRole
("Administrator")) { %>
                                <li>
                                        <a href="/mars/jsp/brioreader.jsp">Load Brio File</a>
                                </li>
                        <%}%>
                        </ul>
                </li>
                <%}%>
                <%if(request.isUserInRole("Administrator")){//begin Admin Tools Block
%>
                        <li>
                                <span>
                                        Admin Tools
                                </span>
                                <ul>
                    <li>
                    <a href="/jsp/messages.jsp">Message Archive</a>
                    </li>
                            <li>
                            <a href="/admin/userlist.jsp">Add/Edit Users</a>
                            </li>
                            <li>
                            <a href="/admin/manageWhatsNew.jsp">Manage What's New</a>
                            </li>
                            <li>
                            <a href="/loginas.jsp">Impersonate User</a>
                            </li>
                            <li>
                            <a href="/admin/refreshproperties.jsp">Refresh Properties</a>
                            </li>
                            <li>
                            <a href="/jsp/removeCard.jsp">Remove Card in IJ2</a>
                            </li>
                                <!--
                                <li><a href="/admin/categorylist.jsp">Category Maintenance</a></
li>
                                <li><a href="/jsp/selecttailnumber.jsp">Edit Numbers</a></li>
                                 -->
                                <li>
                                        <a href="/admin/displaymessagedata.jsp">SFDC Message Archive</a>
                                </li>
                                <li>
                                        <a href="/admin/displaymessagedata.jsp">Reset SFDC Messages</a>
                                </li>
                                <li>
                                        <a href="/admin/displaymessagedata.jsp">SFDC User Test</a>
                                </li>
                    </ul>
                </li>
                <%}%>
        </ul>
</div>
</div>

Re: TreeView Cookie Persistence Problem

by Keith-116 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can anyone point me in the right direction with this problem?

TIA

On Jun 30, 1:38 pm, Keith <keithhen...@...> wrote:

> Hello,
>
> I'm having some issues using the cookie persistence, it appears that
> as long as the link is in the jsp directory the menu renders properly,
> however if the link is not in the jsp directory the cookie is set to
> null and when the page loads all of the trees are expanded.  Any help
> would be greatly appreciated.
>
> Here is the abridged version of the file that I'm using, this is
> included on all pages of my application.
>
> <div id="main"><a href=".">Main Demo</a>
>         <div id="sidetree">
>         <div class="treeheader"> </div>
>         <div id="sidetreecontrol"><a href="?#">Collapse All</a> | <a href="?
> #">Expand All</a></div>
>         <ul id="tree">
>                 <li><span>Customer Accounts</span>
>                         <ul>
>                                 <li>
>                                         <a href="/jsp/viewflightcalcrit.jsp" >Flight Search</a>
>                                 </li>
>                                 <%if (request.getRemoteUser() != null){%>
>                                 <li>
>                                         <a href="/jsp/accountselection.jsp">Customer Selection</a>
>                                 </li>
>                                 <%}%>
>                                 <%if (session.getValue("customer") != null) { %>
>                                 <li>
>                                         <a href="/jsp/cards.jsp">Owner Profile</a>
>                                 </li>
>                                 <li>
>                                         <a href="/jsp/communicationnotes.jsp">Owner Communication</a>
>                                 </li>
>                                 <%}%>
>                                 <%if (session.getValue("customer") != null && session.getValue
> ("jetcard") != null) {%>
>                                 <li>
>                                         <a href="/jsp/viewflightactivity.jsp">View Flight Activity</a>
>                                 </li>
>                                 <%}%>
>                                 <%if ((request.isUserInRole("OwnerServices") ||
> request.isUserInRole("Finance"))) { %>
>                                 <li>
>                                         <a href="/jsp/ownerprofile.jsp?new=<%=userRegion%>">Add New
> Customer</a>
>                                 </li>
>                                 <%if (session.getValue("customer") != null && userRegion ==
> custRegion){ %>
>                                 <li>
>                                         <a href="/jsp/clientcardentry.jsp">Add New Card</a>
>                                 </li>
>                                 <%}%>
>                                 <%}%>
>                                 <%if (request.isUserInRole("OwnerServices") || request.isUserInRole
> ("Finance")) {%>
>                                         <%if (request.isUserInRole("Finance")) { %>
>                                                 <li>
>                                                         <a href="/jsp/jetcardexpired.jsp">Expired Cards</a>
>                                                 </li>
>                                         <%}%>
>                                 <%}%>
>                                 <%if(session.getValue("customer") != null && (request.isUserInRole
> ("Finance") || request.isUserInRole("Administrator") ||
> request.isUserInRole("Sales") || request.isUserInRole("OSManager") ||
> request.isUserInRole("OwnerServices"))){ %>
>                                 <li>
>                                         <a href="/jsp/welcomecall.jsp">Welcome Call</a>
>                                 </li>
>                                 <%}%>
>                                 <%if(request.isUserInRole("Sales") || request.isUserInRole
> ("Administrator")){%>
>                                 <li>
>                                         <a href="/jsp/index.jsp?viewdash=1">Dashboard</a>
>                                 </li>
>                                 <%}%>
>                         </ul>
>                 </li>
>                 <%if (userRegion == 0 && request.isUserInRole("Finance")) { //begin
> Accounts Block %>
>                 <li><span>Accounts</span>
>                         <ul>
>                                 <%if (request.getRemoteUser() != null) { %>
>                                 <li>
>                                         <a href="/jsp/njaccountsummary.jsp">Account Summary</a>
>                                 </li>
>                                 <%}%>
>                                 <%if(session.getValue("njcontract") != null){%>
>                                 <li>
>                                         <a href="/jsp/viewnjflightactivity.jsp">View Activity</a>
>                                 </li>
>                                 <%}%>
>                                 <%if(request.isUserInRole("Finance") || request.isUserInRole
> ("Administrator")) { %>
>                                 <li>
>                                         <a href="/mars/jsp/brioreader.jsp">Load Brio File</a>
>                                 </li>
>                         <%}%>
>                         </ul>
>                 </li>
>                 <%}%>
>                 <%if(request.isUserInRole("Administrator")){//begin Admin Tools Block
> %>
>                         <li>
>                                 <span>
>                                         Admin Tools
>                                 </span>
>                                 <ul>
>                                 <li>
>                                         <a href="/jsp/messages.jsp">Message Archive</a>
>                                 </li>
>                                 <li>
>                                         <a href="/admin/userlist.jsp">Add/Edit Users</a>
>                                 </li>
>                                 <li>
>                                         <a href="/admin/manageWhatsNew.jsp">Manage What's New</a>
>                                 </li>
>                                 <li>
>                                         <a href="/loginas.jsp">Impersonate User</a>
>                                 </li>
>                                 <li>
>                                         <a href="/admin/refreshproperties.jsp">Refresh Properties</a>
>                                 </li>
>                                 <li>
>                                         <a href="/jsp/removeCard.jsp">Remove Card in IJ2</a>
>                                 </li>
>                                 <!--
>                                 <li><a href="/admin/categorylist.jsp">Category Maintenance</a></
> li>
>                                 <li><a href="/jsp/selecttailnumber.jsp">Edit Numbers</a></li>
>                                  -->
>                                 <li>
>                                         <a href="/admin/displaymessagedata.jsp">SFDC Message Archive</a>
>                                 </li>
>                                 <li>
>                                         <a href="/admin/displaymessagedata.jsp">Reset SFDC Messages</a>
>                                 </li>
>                                 <li>
>                                         <a href="/admin/displaymessagedata.jsp">SFDC User Test</a>
>                                 </li>
>                         </ul>
>                 </li>
>                 <%}%>
>         </ul>
> </div>
> </div>