Manage Relational Table - Working Tutorial?
Hello,
Just wondering if there is a working tutorial for the Manage Relational Table (MRT) Server Behaviour? I have done some reading from the site and can't quite get it working. None of my checked items get inserted into the binding table.
I have three tables (Contracts, Venues, Link_CV.)
Contracts - contains contract information
Venues - contains venue information
Link CV - has unique ID and two fields "venue_ID" and "Contract_ID"
1. On insert page I have removed redirect URL from DataAssist insert behaviour.
2. I have created a looping checkbox set using a database query that retrieves all of the venues.
<?php $setRows=0; ?><?php do { ?>
<?php
// RepeatSelectionCounter_1 Begin Loop
$RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;
while($RepeatSelectionCounter_1_IterationsRemaining--){
if($RepeatSelectionCounterBasedLooping_1 || $row_getVenues){
?>
<div id="repeatBox">
<label>
<input type="hidden" name="WADA_RepeatID_venue_id_<?php echo $RepeatSelectionCounter_1; ?>" id="WADA_RepeatID_venue_id_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_getVenues["venue_id"]; ?>" />
<input <?php if (!(strcmp($row_getVenues['venue_id'],WA_AB_returnPreSelectValue($WA_PreSelect_RelationalTable_1, $row_getVenues['venue_id'])))) {echo "checked=\"checked\"";} ?> type="checkbox" name="venueCheck[<?php echo $row_getVenues['venue_id']; ?>]_<?php echo $RepeatSelectionCounter_1; ?>" id="venueCheck_<?php echo $row_getVenues['venue_id']; ?>_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_getVenues['venue_id']; ?>"/>
<?php echo $row_getVenues['venue_short']; ?></label>
</div>
<?php $setRows++; echo $setRows; if ($setRows == 3) { echo "<br/>"; $setRows=0; }?>
<?php
} // RepeatSelectionCounter_1 Begin Alternate Content
else{
?>
No records match your request.
<?php } // RepeatSelectionCounter_1 End Alternate Content
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
if(!$row_getVenues && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}
$row_getVenues = mysql_fetch_assoc($getVenues);
}
$RepeatSelectionCounter_1++;
} // RepeatSelectionCounter_1 End Loop
?>
<?php } while ($row_getVenues = mysql_fetch_assoc($getVenues)); ?>
3. added MRT behaviour to page using:
WIZZARD PAGE 1
Trigger - Button:Insert Pressed
DB connection
relational table set to link table
goto set to results page
WIZZARD PAGE 2
Foreign key column - contractID from link table
data type - numeric
key value - set to created insert record id from contract table (WADAnsertRecordID)
WIZZARD PAGE 3
foreign key column - linked table venue id
data type - numeric
options form field - wada repeat id venue id in repeat selection
WIZZARD PAGE 4
no changes made
Something is wrong - maybe with the name or ids given to my looping checkboxes? Any help would be appreciated - and when this is working I will make a step by step guide for this as nobody else has done it yet. :)
Thanks.