CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Attn PHP'ers abt EditableGrid

Print topic Send  topic

Author Message
DonB
Posted: 08/12/2002, 10:41 AM

My lack of PHP knowledge is a big hindrence...

Can you guys take a look at modifying a field on the fly (in one of the
"Before show" events) to see if you can turn a label into a textbox (either
with a grid or without a grid). I've done the standard thing - setting the
"type" to "HTML". I am doing what I do successfully in ASP, translating the
language as best I can into PHP.

I have just about given up. It seems there is something inherently
different about the way PHP (vs ASP) loads its template - as if it has
already established labels are labels, etc. - and the before show events are
too late to change it. This works just fine in ASP. I'm beginning to think
that some entirely different approach will be required for PHP - that the
firing of events is different enough from ASP that the ASP techniques won't
work.

The other problem I have is referencing the "current" row's data in a grid.
Despite all my attempts, I've only been able to display the first row's
values - apparently because I'm referencing "selected" row of the entire
grid, not the current row of the recordset. I've tried using the object
"$DS->fieldname" and several other variations but can't seem to find the
correct thing to reference it. I'd think in the beforeshowrow event, that
this would be formname->fieldname->value, but it's not (or I am butchering
PHP syntax and not realizing it).

Once I can get this to work, the next task will be a foreach loop that can
reference each row's value to do the database updates.


thanks,

don

Don Anderson
Posted: 08/12/2002, 1:00 PM

Hi Don,

I have started looking at this Editable Grid but have not yet figured out
anything useful.

The lack of Php documentation is something that causes a lot of frustration.

Can I suggest that you look at the CCS tutorial "Enhancing Application
Functionality with Programming Events (PHP)". There is an example of a
BeforeShow event changing a displayed value.

A common tripwire is the need to specify global variables in any function
that wants to use them.

You may need to add a line at the beginning of the event code;

global $bs_items;

and if you create a variable within a function that you want to be available
elsewhere then you need to do the same things within the function.

Good luck,
Don Anderson

PS. Have you looked at the tutorial in the PHP section. There is an
example of BeforeShow code:

I think you have to use

$formname->fieldname->GetValue()
$formname->fieldname->SetValue("NEW VALUE HERE");



"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:aj8s0e$ocu$1@news.codecharge.com...
> My lack of PHP knowledge is a big hindrence...
>
> Can you guys take a look at modifying a field on the fly (in one of the
> "Before show" events) to see if you can turn a label into a textbox
(either
> with a grid or without a grid). I've done the standard thing - setting
the
> "type" to "HTML". I am doing what I do successfully in ASP, translating
the
> language as best I can into PHP.
>
> I have just about given up. It seems there is something inherently
> different about the way PHP (vs ASP) loads its template - as if it has
> already established labels are labels, etc. - and the before show events
are
> too late to change it. This works just fine in ASP. I'm beginning to
think
> that some entirely different approach will be required for PHP - that the
> firing of events is different enough from ASP that the ASP techniques
won't
> work.
>
> The other problem I have is referencing the "current" row's data in a
grid.
> Despite all my attempts, I've only been able to display the first row's
> values - apparently because I'm referencing "selected" row of the entire
> grid, not the current row of the recordset. I've tried using the object
> "$DS->fieldname" and several other variations but can't seem to find the
> correct thing to reference it. I'd think in the beforeshowrow event, that
> this would be formname->fieldname->value, but it's not (or I am butchering
> PHP syntax and not realizing it).
>
> Once I can get this to work, the next task will be a foreach loop that
can
> reference each row's value to do the database updates.
>
>
> thanks,
>
> don
>
>


   


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.