Using cftree

Discussion in 'Programming' started by ICEMAN2303, Dec 12, 2006.

  1. #1
    I load the tree with an cfquery and i display the Agent name and the AgentNo as the value.

    Here is the code
    _________________________________________________
    <cfif "#session.masteragentno#" eq "478928535" or "#session.masteragentno#" eq "507806807" or "#session.masteragentno#" eq "360646731">
    <cfquery name="getAgentsView" datasource="AgentSys">
    SELECT [First Name] + N' ' + [Last Name] AS Name, AgentNo As agent
    FROM tblAgentMaster
    WHERE ([Group] LIKE N'%Headrick%')
    ORDER BY [First Name] + N' ' + [Last Name]
    </cfquery>
    <cfelseif "#session.masteragentno#" neq "">
    <cfquery name="getAgentsView" datasource="AgentSys">
    SELECT tblAgentMaster.[First Name] + N' ' + tblAgentMaster.[Last Name] AS Name, tblAgentMaster.AgentNo As agent
    FROM tblHierarchyColumns INNER JOIN
    tblAgentMaster ON tblHierarchyColumns.ColumnID = tblAgentMaster.HierarchyColumn
    WHERE (tblAgentMaster.TeamLeader = N'#session.masteragentno#')
    ORDER BY tblAgentMaster.[First Name] + N' ' + tblAgentMaster.[Last Name]
    </cfquery>
    </cfif>
    <cfformgroup type="HBox">
    <cfformgroup type="VBox">
    <cfif getAgentsView.Name neq "">
    <cftree
    format="flash"
    Name="Hirearcy"
    Width="175"
    Height="300"
    HScroll="yes"
    VScroll="yes"
    Border="yes"
    AppendKey="yes">

    <cftreeitem value="agent"
    display="Name"
    query="getAgentsView"
    queryasroot="no"
    img="Person2.jpg"
    imgopen="Person2.jpg"
    expand="Yes,Yes,Yes">

    </cftree>
    </cfif>
    ______________________________________________________________

    What i need to do is when the user selects an agent i need to call the same form but i need to pass the form the agentno that the user just selected can anyone help>
     
    ICEMAN2303, Dec 12, 2006 IP