Jan K. van Dalen
|
| Posted: 07/29/2008, 10:47 PM |
|
Ok, I'm pretty new @ PHP and still trying to figure out how CCS handles it.
I have a "Label" (content is a database column) which I'll like to hide if
another column has the value "No".
I added a Hide-Show Component to the Before Row Show. I selected
"Expression" but nothing that I have tried works.
The Label is called "Title", the field that will decide if to display is
"DisplayTitle". The form is called "content"
I have tried several options and I keep getting this error: Fatal error:
Call to a member function Show() on a non-object in
C:\Inetpub\wwwroot\Caracol\index2.php on line 169
Any help will be great ....
|
|
|
 |
Gena
Posts: 591
|
| Posted: 07/29/2008, 11:39 PM |
|
Put Pannel around your Label (which you want to hide), set it to visible.
Don't use Hide-Show Component with the Before Row Show event - it will not works well because produces non complete code like:
if ($Component->DisplayTitle->GetValue()=="something")
$Component->PanelTitle->Visible = false;
that is not covers all cases.
instead use just Custom code like:
if ($Component->DisplayTitle->GetValue()=="something") {
$Component->PanelTitle->Visible = false;
}else{
$Component->PanelTitle->Visible = true;
}
_________________
Gena |
 |
 |
Jan K. van Dalen
|
| Posted: 07/30/2008, 7:31 AM |
|
Gena ... many thanks ... got it working.
1 more question, if the field I want to evaluate is not in a control but it
is part of the query ... how would I substitude if
($Component->t_linkh->GetValue()=="")? Would I have to use CCDLookUp?
(seems inefficient).
"Gena" <Gena@forum.codecharge> wrote in message
news:548900cbf24722@news.codecharge.com...
> Put Pannel around your Label (which you want to hide), set it to visible.
>
>
> Don't use Hide-Show Component with the Before Row Show event - it will not
> works well because produces non complete code like:
>
> if ($Component->t_linkh->GetValue()=="")
> $Component->PanelLink->Visible = false;
>
> that is not covers all cases.
>
> instead use just Custom code like:
>
>
> if ($Component->t_linkh->GetValue()=="something") {
> $Component->PanelLink->Visible = false;
> }else{
> $Component->PanelLink->Visible = true;
> }
>
> _________________
> Gena
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
Gena
Posts: 591
|
| Posted: 07/30/2008, 9:36 AM |
|
Just put that field as Hidden box somewhere in grid row and then use it as described above.
_________________
Gena |
 |
 |
Gena
Posts: 591
|
| Posted: 07/30/2008, 9:38 AM |
|
of course you can use CCDLookUp but this will slow down your grid...
_________________
Gena |
 |
 |
Jan K. van Dalen
|
| Posted: 07/30/2008, 12:36 PM |
|
LOL ... that is what I was doing but there should be a better way ... glad
to know that as a PHP novice ... I was not that far off (although this is a
CCS issue).
Thanks.
"Gena" <Gena@forum.codecharge> wrote in message
news:54890988ed16d0@news.codecharge.com...
> Just put that field as Hidden box somewhere in grid row and then use it as
> described above.
> _________________
> Gena
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
Gena
Posts: 591
|
| Posted: 07/30/2008, 12:47 PM |
|
Quote Jan K. van Dalen:
LOL ... that is what I was doing but there should be a better way ... glad to know that as a PHP novice ... I was not that far off (although this is a CCS issue).
The better way is really depends of what you need to do. If you can add than field in the query and then put it as hidden box - this is fast and easy.
If you need to do some complex check you can use lookup function or ever create your own check function.
_________________
Gena |
 |
 |
datadoit
|
| Posted: 07/30/2008, 2:07 PM |
|
Jan K. van Dalen wrote:
> 1 more question, if the field I want to evaluate is not in a control but it
> is part of the query ... how would I substitude if
> ($Component->t_linkh->GetValue()=="")? Would I have to use CCDLookUp?
> (seems inefficient).
-------------------------
If it's part of your query or dataset, then you should be able to get to
it via:
$Container->ds->f("YourField");
|
|
|
 |