Creation of div tags programmatically based on the directory list

Hey guys,.

I'm trying to use the javascript BarelyFitz Tabber to classify manual hundreds of use on a page. The user manuals are stored in directories, and I am trying to create tabs for each directory progammatically. No matter how hard I try, I can't seem to find a way to determine whether the function is parsing to a subdirectory of the previous directory or the root directory orginal. Here's some pseudocode:

At the beginning of the directory parse loop:

If (currentdirectory is subdir)

{

If (no tab container)

{

Add tab container (div)

Add a tab (div)

}

on the other

{

Add a tab

}

}

on the other

{

List of files

}

After the analysis subdirectory loop:

If (lastdirectory was a subdirectory of this directory)

{

close the div (tab container)

}

Here's the CF code:

<cffunction name="fDirectoryListing" 
    description="Outputs table rows for a directory listing and allows DIRINFO.txt directory name replacement"
    returnType="string"
    output="true">
    
    <cfargument name="MyRoot" type="string" required="true">
    <cfargument name="ThisSub" type="string" required="true">
    <cfargument name="DirDepth" type="numeric" default="0">
    <cfargument name="ShowNoFiles" type="boolean" default="0">
    
    <cfset var qDirectoryList = "">
    <cfset var FileCount = 0>
    <cfset var ThisFullDir = "#MyRoot#\#ThisSub#">
    <cfset var SpaceMultiplier = 20>
    <cfset var Indent = SpaceMultiplier * DirDepth>
    <cfset var rootDir = 0>
    <cfset var nested = false>

<cfdirectory action="LIST" directory="#ThisFullDir#" name="qDirectoryList" sort="type ASC, name asc">

<cfoutput>
    <cfloop query="qDirectoryList">
        <CFIF qDirectoryList.type IS "dir">
<!-- check if this is SubDirectory of root -->
        <cfif rootDir lt DirDepth and not nested>
            <div class="tabber">Start new tabber
            <cfset rootDir = DirDepth>
            <cfset nested = true>
            Nested: #nested# 
        </cfif>
        <cfif rootDir lt DirDepth and nested>
            <cfset nested = false>stop nesting
        </cfif>
        <div class="tabbertab">start tab, DirDepth: #DirDepth# rootDir: #rootDir#
<!-- end subDir check-->

            <cfset ThisDir = "#ThisSub#\#qDirectoryList.name#">
            <cfset DirInfo = "">
            
            <cfif FileExists("#MyRoot#\#ThisDir#\DIRINFO.txt")>
                <cffile action="READ" file="#MyRoot#\#ThisDir#\DIRINFO.txt" variable="DirInfo">
            <cfelse>
                <cfset DirInfo = "#qDirectoryList.name#">
            </cfif>
            <img src="../images/blank_bullet.gif" width="#Indent#" height="5"><h2>#DirInfo#</h2>
            #fDirectoryListing(MyRoot, ThisDir, DirDepth+1)#
        <cfelse>
            <cfif qDirectoryList.name is not "DIRINFO.txt">
                <cfset FileCount = FileCount + 1>
                <cfif FileCount is 1 and qDirectoryList.currentrow is not 1><br>
                </cfif>
                <img src="../images/blank_bullet.gif" width="#Indent#" height="5"><p><a href="GetFile.cfm?ID=#URLEncodedFormat("#ThisSub#\#qDirectoryList.name#")#">#qDirectoryList.name#</a></p>
                
            </cfif>
        </CFIF>        <cfif nested></div>endnesttab</cfif>
    </cfloop><cfif nested is false>endnestdiv nested: #nested# dirdepth: #DirDepth# rootDir: #rootDir#</div></cfif>
</cfoutput>

<cfif ShowNoFiles and FileCount is 0>
    <tr><td><img src="../images/blank_bullet.gif" width="#Indent#" height="5"> [ no Files ]</td></tr>
</cfif>

</cffunction>

Any ideas on that?

Thank you

Scott

Whenever I have something like what I did examine the field dirQuery.directory as a bar slash ' / or \ ' delimited list.  The number of items in the list, it's the depth of the directory comes from the root.

I.E. #ListLen(dirQuery.directory, '/\") #

Tags: ColdFusion

Similar Questions

  • Select the value of the text element based on the selection list

    Hello

    I have a selection list that displays a number of codes of a table, and I want to display the description of the code (from the same table) in a field of text next to it.

    The selection list works good based on an LOV, but I can't seem to find how to get the return value, so I can identify the correct description of the table to be displayed.

    Thank you

    See this link: http://htmldb.oracle.com/pls/otn/f?p=31517:80:6340934958598741:NO

    It will have a lov that calls an application process that fills a text box...

    Thank you

    Tony Miller
    Webster, TX

  • Invalid results based on the select list

    Hello
    I've set up 4 LOVs cascading in a test application. They fill each value based on the value of the parent cascading with success. My example is based on the query Ajax Denes Kubicek - Section III - for example - http://apex.oracle.com/pls/otn/f?p=31517:135:1771969688591802:NO. But I use 4 Cascading Select list not 4 text fields. My problem is that I am not able to scroll through records using the previous and next unless I select all 4 list selection of waterfall to fill the data in the record. I would like to be able to select the 1st list select then click on the search button to fill in the data of the registration for the selected value. Then use the previous and next to scroll through the data in the record. This code allows selection of cascade 4 list to keep focus when the key search selected. But the correct data are not returned if I only select 1 list select value and then click on the search button.
    //  alert('TagName=' + l_El.tagName + ' id=' + l_El.id)
                    if(l_El.tagName == 'INPUT' || l_El.tagName == 'SELECT') {
                        l_El.value = l_Value;
    Published by: Charles was October 8, 2009 07:53

    Hi Charles,

    OK - it works now.

    I made a few changes here and there. Basically, I defined by default for four '-1' lists and accounted for this through the page and processes. You had the wrong name for the last item in your function onLoad(), so I've changed that. Also notes that the question of the "closing date" must be formatted with a date MM/DD/YYYY formats to ensure that these are properly (the date of default real format came in the form DD-MON-AA, so you would have questions there if you don't stick to a single format). For each item, you can choose another value by default if it makes more sense for you, but you go through every place where the list is mentioned/used for updating the-1 for her to this new value.

    The processes themselves also tried to update the four lists as you go through the records. As the lists would not necessarily have all the values on them (you can click on search without making any selection, for example), I disabled these bits. However, you you should consider adding to the class section of THS page as new, so that the user can view all the information. The alternative would be to have all the lists display all the values unless otherwise filtered by their parent list - always feasible, but may be confused?

    Andy

  • Tabular returns lines based on the selection list

    Howdy-

    An element of the selection list is used to select a job title.

    The tabular presentation returns lines of documents to be considered annually by the title of the post.

    A single column in a tabular form (the number of the document) is defined as a link so that the user can open and read the document.

    It works beautifully.

    But...

    Some job titles return a row of five documents, still others return more than a hundred, so when paging is used to move to the next set of lines in tabular form, updates the selection list and the selection is lost.  I have the Page Action selection list element when the modified value to Redirect and set the value, but the Type of Source is static that may be my problem.

    How can I use pagination while maintaining the value of the selection list?

    Thanks in advance.

    Alexandra

    Request Express 4.2.2.00.11 (by the way, I don't have our network administrator do a update to this version?)

    the value of the default selection on a hidden item list. When you select from the drop-down list, set the item also hid from the selected item.

  • Automatic filling of multiple selection based on the selection list

    Hello

    I have a problem in filling multiple selection data in the selection list.
    I would like to take an example and explain.
    I have 3 tables: employee, Department and a link table for employee and department.
    The selection list contains employee and the Department is a multiple selection. Employee selection, all departments must be posted and belongs to the Ministry of which employee (which comes from the binding table) must be selected (high-lighted). How can I do this?

    HI 841762 :),.

    Do not use the 'style' to highlight that you would have found out by now that would make the blue text background while the font color remains black and this will make the text unreadable. Plus if there is a button on the page when you submit it to us, I doubt that it will store the State of the selected items in a multiple of P1_DEPT in session state. then try this...

    In the application process, replace, the status of 'style' that you used to highlight as you...

    ....
    If (rec.R=cnt)then
    htp.prn('');
    ELSE
      htp.prn('');
    end if;
    ...
    

    Then in the JS, use

    appendToSelect(list, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue,l_Opt_Xml.getAttribute('selected'));
    

    and change the function "appendToSelect".

    function appendToSelect(pSelect, pValue, pContent,pIsSelected) {
    
     var l_Opt = document.createElement("option");
     l_Opt.value = pValue;
    
    if(pIsSelected)
    l_Opt.setAttribute('selected','selected');
    
    if(document.all){
      pSelect.options.add(l_Opt);
      l_Opt.innerText = pContent;
     } else {
      l_Opt.appendChild(document.createTextNode(pContent));
      pSelect.appendChild(l_Opt);
     }
    }
    
  • Contents of the directory list before the upload of a file mass

    Hello

    I want to let the user choose a directory and then to provide a list of files in the given directory and all its subdirectories. The user could then check all files that must be downloaded. Can I get the contents of the directory via the Java script?

    I'm sure that this has been posted already here, but I can't seem to find it. TIA,

    Tamas Szecsy

    Published by: Tamas Szecsy February 4, 2010 13:05

    Please review the response given to you... It's a JAVA solution, no javascript...

    Here's a wide: [http://mindprod.com/jgloss/filesanddirectories.html]

    Thank you

    Tony Miller
    Webster, TX

  • Refresh the report based on the select list item

    Hello world

    Someone has the answer to refresh a report based on an element that I select in a select list? I currently have the item in the list of selection and a report under him I wrote a sql that fills with data. If I choose an article in my select list, I want to change the data in my report. What I have to write separate sqls for each item to be fired or write some type of process. Can someone help me?

    Thank you
    Ryan

    Write directly in the SQL report. Your select list item will be the variable in the SQL.

  • Change the directory list "scan to" in the HP Director on iMac (Mavericks)

    I have an HP CM1312 MFP running on an iMac with the Mavericks.

    When you install the HP Director, at some point, the software takes over and says "installation with default settings" or similar, and then it's over.

    The resulting, program prints and scans correctly. However, I want to set up a destination for scanning to file option.

    When using the scan to file option there is no option to add destinations - there is a very limited choice (of memory just Documents and desktop).

    I have a folder called "scans" on my desktop and would like to add this destination in the drop-down list box "Scan to file."

    Is this possible and if so, how?

    Thanks in advance

    Hello bilfen,.

    Welcome to the Forums of HP Support!

    To get your question more exposure I suggest you post in the trade forums since it is a commercial product. You can do it at Business Forum.

    Concerning

  • The difficulty to position a div tag... help!

    Hello

    I can't post a div tag It is with the 3n1 inside logo label. All the other div tags move with a fluid page while this div glue right there in a way that is not elastic. It is created in the same way as the others are. I don't understand! Help, please!

    http://www.kathrynswezydesign.NET/KSwezy_local%20root%20NEW/3n1band.html

    I can't post a div tag It is with the 3n1 inside logo label. All the other div tags move with a fluid page while this div glue right there in a way that is not elastic. It is created in the same way as the others are. I don't understand! Help, please!

    Although it is one absolute positioning like others, his behavior is dictated by its unique position in the code.

    It's the only div outside the div container - which means its parent container is theTag, which means that it moves with the window of the browser.

    It must be inside of the

    who is positioned. Then, it will be constrained by the div container, not the body tag and moves compared to others the divs.

    Change


    3n1 logo


    TO

    3n1 logo



    You will also need to adapt the left coordinate of the div logo to visually match the Interior of the container

    Something like

    {#logoimage}
    height: 198px;
    Width: 192px;
    position: absolute;
    left: 750px; / * adjust according to * /.
    top: 335px;
    }

  • How do you do &lt; div &gt; tags line up in Dreamweaver CS6?

    Y at - there no way to make the div tags dash so that the opening and closing tags are aligned vertically?  How apply the formatting Source, sometimes the final tag is at the end of a line of code instead of wrapped to the next line and link up with its start tag.  Are there any settings for this to happen or extensions for this?

    Go in Edition > Preferences > Code Format > Tag Libraries.   After setting your formatting preferences.  Record.

    Access the commands > apply Source format.

    Nancy O.

  • SPAN or Div tags in ul OK?

    IM using a drop down menu like this:

    http://www.HtmlDog.com/articles/suckerfish/bones/

    I must apply 3 for the 2nd level ul background images. If they were normal div is then I would just add 2 spans more or divs around them to achieve. Is it OK to do this with links and lists or copy the following code is not valid?

    Thank you

    You will need two things to tie up your images, if you do not li and one of their coupling. I have a feeling that you will eventually break the menu if interpose you a div between the ul and li menu items. In fact, you can insert a div tag (without success), but the div will show no depth. If you do outside the submenu ul, it will show always; If you put the div only around items of li inside the ul tag, it will hide and show, but will still have no height for her. Thus, no background image.

    What about spacing your menu items such as you can use a background on the AMT for the left side, background, border and low (see instructions) and use the border of the right hand on the li elements. You would need to engineer the border so there no rough air, but you should be able to function.

    If you apply a style of menu, you can also use to do, using two images sliding doors.

    Make a picture that is a path that is wider than your typical menu item and which includes all three borders. Export the border of the right hand as an image on its own. Don't include the lower border.

    Use the first image as the background of the li element.

    Use the second image as the background of the element has . Background-position: right; Background-repeat: no-repeat;

    You want to make sure that the item has has display: block; applied. Also, be sure to make Background-color: transparent;

    The right border image will be actually on top of the background image and border left, but placed on the right side.

    Check if this isn't what you want.

    Beth

  • Oracle ADF fill drop-down based on the parameter

    Hi all

    I was faced with a scenario where we want the values in a drop of water down to be limited based on something special... For example, if the Department user ID. If this value exists in the view object that displays data and when I have my LOV it works very well to restrict the LOV based on the service id of the user.

    However, if this value is not in the object view we use to display the form as well as the LOV values then I can get the value list to be limited. I tried to run with params and a few other things (this works to restrict data on the page, but not the LOV).

    Advice on how I can limit a LOV based on a value that is not in the current t would be great.

    Thank you

    S

    Hello

    If it is a model based on the value list, you can filter the list with a criterion for the view. This point of view criteria can use a variable of liaison for the filtering of the list. The value of the variable binding type is adjustable to the expression. You can then use Groovy as adf.source.applicationModuleName.ViewObjectInstanceName('DepartmentId') to access a ViewObject instance in the same AM. I did not have the exact syntax in head but answered a similar question yesterday

    Frank

  • Something has happened to the "programs" list when I click on 'start '.

    Lasst Saturday when I was on the computer, I must have done something - I have no idea what - but all my icons disappeared and when I click on start and then all programs - all programs that have been missing there. I tried everything I can thru & assistance. It doesn't let me do a "System Restore" back in the day where the night before, he started. Any suggestions are appreciated!

    Hi KimBrusenhan,
     
    -What exactly happens when you try to perform the system restore? You receive an error message or error code? If Yes, indicate the same.
    -What version of Service Pack of Windows XP you are using?
     
    These problems occur if the value of the Start Menu common registry entry is inaccessible or if the value is not valid. In this case, Windows XP cannot initialize the shell program.
     
    Method 1: Try this method and check if it helps to fix the problem:
    Connection to an account administrator and do the following:
     
    a. Click Start. Click run.
    b. type the following command and press ENTER:
    regsvr32 /i shell32.dll
     
     
    Method 2: If you use the version of Windows XP Service Pack 2, then download and install the hotfix from the link below and see if the problem is resolved.
     
     
    If you use the version of Windows XP Service Pack 1 or 2, I recommend you to upgrade to Windows XP Service Pack 3 version that will improve the reliability of Windows by installing the software - new drivers for hardware updates and much more.
  • Color of the name of paratag in the quick list of paragraph Format (F9)

    (FM12.0.4 on Win7x64)

    Where can I set the background color of an entry tag paragraph selected in the quick list of paragraph Formats (F9)?

    Under Windows: Control Panel > personalization > window color and appearance? If so, which point?

    So I ask you: the background color is quite similar to the blue that is used for the characters of the tag name that I can't read the selected item.

    Edit 20150626: Adding a screenshot.QuickPickBackgroundColorAnomaly.png

    I don't remember noticed this problem in the quick list with 12.0.3.

    Best regards

    Found!

    Windows: Control Panel > personalization > window color > point: selected items

  • The error denied directory list

    I just upgraded my old laptop to a newer model desktop. I try to add all my previous Favorites from my old computer and can't be able to access my site from work now. When I try to log on to the site, I get this error message:

    The directory list refused
    This virtual directory does not content to enumerate.

    I had no problem to access this on my old computer through Mozilla, you can help me solve this problem?

    You can also go to the homepage of web sites,
    then work your way to the desired page.
    Then create a new bookmark / shortcut.

Maybe you are looking for

  • I want to go back to Firefox than Firefox 32 31. How can I do this?

    I found that Firefox 32 is not compatible with the theme of Windows 7 desktop that I currently use (high contrast white theme). I tabled this question like a bug on Bugzilla site, but until they get this issue fixed, I want to go back to Firefox 31.

  • How to recover the sparsebundle workspace?

    Hi all EL Cap 10.11.5 I made a my.sparsebundle which was for 2 GB - then I almost filled - then I deleted 50% - then run the Terminal command -Recovered 0 bytes -so I've removed everything inside and running the command again -always it recovered 0 b

  • I need a driver bluetooth for the PRODUCT ID:-F7P48PA #ACJ

    Please tell me how to download the file.

  • Replace the screen LCD 1280 1440 or 1680 for SL400

    My SL400 LCD screen broke. Right now I want to try LCD resolusion change 1280 1440 or 1680. My SL400 is 2743-CTO. 14.1 inch LED backlit panel. What if you need parts?

  • ICS voice entry Bug?

    I just receive ICS today and while going through it, I came across what I think is a bug/error in the operation of the systems. Voice input is not accessible unless the phone has data or WiFi turned on. Meaning, if I wanted to send a message text wit