Categories > TinyButStrong general >

Still not able to create the syntax for (...ope=html;select)

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Olifants
Date: 2007-06-14
Time: 14:00

Still not able to create the syntax for (...ope=html;select)

Hello,

I tried a lot, but I didn't find the correct syntax to create 3 (or more)
select-lists.
How do I have to manage the thing with the 'selectedItem'? (See at the '?')

$formItems = array(array('itemLabel' => 'Label 1', 'itemId' => 'ListA', 'itemValue' => $_GET['listAEntry']),
                             array('itemLabel' => 'Label 2', 'itemId' => 'ListB', 'itemValue' => $_GET['listBEntry'])
                             array('itemLabel' => 'Label 3', 'itemId' => 'ListC', 'itemValue' => $_GET['listCEntry'])
);

for ($i = 0; $i < count($formItems); $i++) {
    $itemArea[$i] = array('itemLabel' => $itemLabel, 'itemId' => $itemId);

    while ($row = $setupForm->dbQueryResult()) {

        foreach ($row as $tableKey => $tableValue) {
            if ($itemValue == $tableValue) $selectedItem = $tableValue;
            $itemArea[$i]['item'][] = array('itemValue' => $tableValue);
        }
    }
}

$Nbr = $tmpl->MergeBlock('showItemLabel','array','itemArea') ;
if ($Nbr > 0) $tmpl->MergeBlock('showItem','array','itemArea[%p1%][item]');


<div>[showItem.itemLabel;block=div]
    <select name="[showItemLabel.itemId]" class="normal">
        <option>[showItem.itemValue;block=option;p1=[showItemLabel.$]]</option>
?        <option>[showItem.selectedItem;ope=html;select)</option>
    </select>
</div>

Thanks for help

Ronny
By: Skrol29
Date: 2007-06-16
Time: 00:30

Re: Still not able to create the syntax for (...ope=html;select)

Hi,

I think the correct template is something like this:
<div>
  [showItemLabel.itemLabel;block=div]
  <select name="[showItemLabel.itemId]" class="normal">
    <option> [showItem.itemValue;block=option;p1=[showItemLabel.$]] </option>
    <option> [var.itemArea.[showItemLabel.$].selectedItem;ope=html;select] </option>
  </select>
</div>

This is because option items are not yet merged when you are merging the block "showItemLabel".
If you use a [var] filed, it is merged at the end, when calling $TBS->Show().