We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38666
    • 98 Posts
    I hate to resurrect an old thread but after several frustrating days the time has come.
    As in the previous posts I am trying to create two dependent dropdown lists, The first is a list of Parishes the selected value of which will load the churches from that parish.

    An abbreviated schema
    <?xml version="1.0" encoding="UTF-8"?>
    <model package="opc_database" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
    	<object class="Church" table="church" extends="xPDOObject">
    		<field key="PKChurchId" dbtype="int" precision="11" phptype="integer" null="false" index="pk"  generated="native" />
    		<field key="ChurchName" dbtype="varchar" precision="50" phptype="string" null="false" default="" index="index" />
    			<index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE" >
    				<column key="PKChurchId" length="" collation="A" null="false" />
    			</index>
    			<index alias="ChurchName" name="ChurchName" primary="false" unique="false" type="BTREE" >
    				<column key="ChurchName" length="" collation="A" null="false" />
    			</index>
    			<index alias="FKParishId" name="FKParishId" primary="false" unique="false" type="BTREE" >
    				<column key="FKParishId" length="" collation="A" null="false" />
    			</index>
    			<aggregate alias="Parish" class="Parish" local="FKParishId" foreign="PKParishId" cardinality="one" owner="foreign" />
    	</object>
    	<object class="Parish" table="parish" extends="xPDOObject">
    		<field key="PKParishId" dbtype="int" precision="11" phptype="integer" null="false" index="pk"  generated="native" />
    		<field key="ParishName" dbtype="varchar" precision="50" phptype="string" null="false" default="" />
    		<field key="FKCountyId" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="index" />
    			<index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE" >
    				<column key="PKParishId" length="" collation="A" null="false" />
    			</index>
    			<index alias="FKCountyId" name="FKCountyId" primary="false" unique="false" type="BTREE" >
    				<column key="FKCountyId" length="" collation="A" null="false" />
    			</index>
    			<composite alias="Church" class="Church" local="PKParishId" foreign="FKParishId" cardinality="many" owner="local" />
    	</object>
    </model>


    My TV's
    ParishTV
    name: ParishTV	
    	input type: dynamic_dropdown
    	dddx Group: opc_database
    	first row text: -- choose Parish --
    	packagename: opc_database
    	classname: Parish
    	idfield: PKParishId
    	namefield: ParishName
    	where: {"FKCountyId":"[[+county]]"}


    ChurchTV
    name: ChurchTV	
    	dddx Group: opc_database
    	first row text: -- choose Church --
    	packagename: opc_database
    	classname: Church
    	idfield: PKChurchId
    	namefield: ParishName
    	where: {"FKParishId":"[[+ParishTV]]"}


    Resource:
    <div class="container">
        <div class="panel panel-default">
          <div class="panel-heading">Select Parish and Related Churches</div>
          <div class="panel-body">
             <label for="title">Select Parish:</label>
               <select id="parish" class="form-control">
                   [[*parishTV?county=`116`]]
               </select>        
          </div>
          <div class="panel-body">
             <label for="title">Select Church:</label>
               <select id="church" class="form-control">
                   [[*ChurchTV`]]
               </select>        
          </div>
        </div>
    </div>


    Output:
    <div class="panel panel-default">
          <div class="panel-heading">Select Parish and Related Churches</div>
          <div class="panel-body">
             <label for="title">Select Parish:</label>
               <select id="parish" class="form-control">
                   <option></option>
               </select>        
          </div>
          <div class="panel-body">
             <label for="title">Select Church:</label>
               <select id="church" class="form-control">
                   
               </select>        
          </div>	  
     </div>


    From the output it appears as though the ParishTV is firing but not picking up the data. As a result the second, ChurchTV has no input. Error log is clear.

    Can any one lend a helping hand?
    Thanks
      Give a man the answer, and he’ll only have a temporary solution. Teach him the principles that led you to that answer, and he will be able to create his own solutions in the future.