CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 hide form based on a query

Print topic Send  topic

Author Message
manuel

Posts: 48
Posted: 03/26/2013, 10:38 PM

Hi, I need to hide a Grid based on the result of a query, I'll do a Count(*) based on a url parameter, and if the result is not null (or =1) then display the grid, else, hide it.

I know how to hide the grid:

if (CCGetFromGet("s_employee_id",-1) == -1)
$Component->Visible = False;
else
$Component->Visible = True;

and it works fine, the problem for me is how to insert the query validation.

Thanks in advanced,
View profile  Send private message
DataDoIT
Posted: 03/27/2013, 12:20 AM

In the grid's Before Show, add a Dlookup action and do your query. Set
the result to a variable.

Then, add another action for Hide/Show Component under the Dlookup
action above, and set to Hide, Expression and value: $MyVariable < 1
manuel

Posts: 48
Posted: 03/28/2013, 6:55 PM

I tried, but it doesn't worked:

//DLookup @105-EF7D4249
global $DBConn_TestDDBB;
global $ident_student;
$Page = CCGetParentPage($sender);
$ccs_result = CCDLookUp("id_student", "base_students", "id_student =".. CCGetFromGet("s_studentid",""), $Page->Connections["Conn_TestDDBB"]);
$ccs_result = intval($ccs_result);
$ident_student = $ccs_result;
//End DLookup

to check if the variable was filled, i added a textbox, and set the "retrieve value for control" to the variable: ident_student

but the textbox remains empty.
View profile  Send private message
DataDoIT
Posted: 03/28/2013, 8:04 PM

"id_student ="..
DataDoIT
Posted: 03/28/2013, 10:10 PM

Another way to see output is to use the 'Print Text' action. So after
the lookup add a Print Text action and set to: "ident_student: " .
$ident_student; exit

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.