CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Errors reading a db field value from a form, please help thanks.

Print topic Send  topic

Author Message
joejac

Posts: 242
Posted: 04/04/2008, 8:19 AM

Hello,

I want to change a css class when a menu category changes and have an Active link on the current page, so I have this HTML code for the menu:

<div id="menu1">

<!-- BEGIN Grid categorias -->
<!-- BEGIN Row -->
<input type="hidden" name="{categoria_no_Name}" id="categoriascategoria_no{categorias:rowNumber}" value="{categoria_no}" />
<a href="{categoria_nombre_Src}" id="categoriascategoria_nombre{categorias:rowNumber}" class="{activelink}">{categoria_nombre}</a>
<!-- END Row -->
<!-- BEGIN NoRecords -->
<p>No records</p>
<!-- END NoRecords --><!-- END Grid categorias -->

</div>

In Before Show event I have:

global $Tpl;
global $categorias;
$Categoria_number=$categorias->ds->f("categoria_no");
echo $Categoria_number;
if (CCGetParam("categoria_tope","") == $Categoria_number) {
$Tpl->SetVar("activelink", "active");
}
else {
$Tpl->SetVar("activelink", "noactive");
}

But I get the error:
Fatal error: Call to a member function f() on a non-object in W:\www\customer\Header_events.php on line 17

If I change line 17: $Categoria_number=$categorias->ds->f("categoria_no");
for this one: $Categoria_number=$categorias->categoria_no->GetValue();

I get this other error:

Fatal error: Call to a member function GetValue() on a non-object in W:\www\customer\Header_events.php on line 17

Please help, What am I doing wrong?

Regards
joejac
View profile  Send private message
joejac

Posts: 242
Posted: 04/07/2008, 9:03 AM

Hello,

Support helped me with this, the problem is that I was working with an includable page (Header) and it needs the exact reference, this works perfect:

$Categoria_number=$Header->categorias->categoria_no->GetValue();

In general:

$Includable_Page_Name->form_name->field_name->GetValue();

Regards
joejac
View profile  Send private message

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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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