ferobert
Posts: 10
|
Posted: 02/29/2004, 11:10 AM |
|
Hello
I use CCS, and have a form with many rows/fields, from which I need to hide some when inserting, but show them when the form is in EditMode. I thought to include such a row in a custom block, like below:
<!-- BEGIN Status_block -->
<tr>
<td>Property Status</td>
<td>
<!-- BEGIN RadioButton status --><input type="radio" value="{Value}" name="{status_Name}" {Check}>{Description} <!-- END RadioButton status --></td>
</tr>
<!-- END Status_block -->
For EditMode I want to display the whole row (Status_block), but don't want to manually assign values for the status radio buttons. Is it possible to mix a custom block with controls handled automatically by CCS? If so, what would be the PHP code for my above example?
I also tried to manually add Extended HTML around the row, but it doesn't seem to work with $PropertiesForm->Status_block->Visible = true; I see in the Help, that Extended HTML starts with something like <!-- BEGIN Link Status_block --> but I'm not sure what should I write instead of "Link" for my case.
Thanks and Regards
Robert
|
|
|
Sixto Luis Santos
|
Posted: 03/01/2004, 5:43 AM |
|
Robert,
For that to work, you would need to manually move the template pointer
inside your custom block, then render its content. Otherwise, you wont see a
thing in your page.
For example (in the BeforeShow event of the form):
global $form_name;
global $Tpl;
if($form_name->EditMode){
$oBlk=$Tpl->block_path; // Save the template pointer
$Tpl->block_path="$oBlk/Status_block"; // Move pointer to your block
$form_name->status->Show(); // Render the control
$Tpl->block_path=$oBlk; // Restore template pointer
$Tpl->parse("Status_block"); // Render the block
}
Regards,
Sixto
"ferobert" <ferobert@forum.codecharge> wrote in message
news:54042392a7b49b@news.codecharge.com...
> Hello
>
> I use CCS, and have a form with many rows/fields, from which I need to
hide some when inserting, but show them when the form is in EditMode. I
thought to include such a row in a custom block, like below:
>
> <!-- BEGIN Status_block -->
> <tr>
> <td>Property Status</td>
> <td>
> <!-- BEGIN RadioButton status --><input type="radio"
value="{Value}" name="{status_Name}" {Check}>{Description} <!-- END
RadioButton status --></td>
> </tr>
> <!-- END Status_block -->
>
> For EditMode I want to display the whole row (Status_block), but don't
want to manually assign values for the status radio buttons. Is it possible
to mix a custom block with controls handled automatically by CCS? If so,
what would be the PHP code for my above example?
>
> I also tried to manually add Extended HTML around the row, but it doesn't
seem to work with $PropertiesForm->Status_block->Visible = true; I see in
the Help, that Extended HTML starts with something like <!-- BEGIN Link
Status_block --> but I'm not sure what should I write instead of "Link" for
my case.
>
> Thanks and Regards
> Robert
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
bb
|
Posted: 04/09/2004, 9:50 AM |
|
This technique works well in a Record Form, but so far doesn't seem to work in a Grid form. Generally, should the "$oBlk=$Tpl->block_path;" area code go in the form's BeforeShow or BeforeShowRow event or somewhere else?
|
|
|
Francesco
|
Posted: 04/27/2004, 4:24 AM |
|
Could you post the same code for ColdFusion? thanks
Francesco
|
|
|
mirec
|
Posted: 07/14/2004, 3:01 PM |
|
I have the same problem with custom block in grid. It is does not work. Can someone help me ?
|
|
|
|