mcapelati
Posts: 17
|
| Posted: 04/07/2011, 5:58 PM |
|
Hi Folks,
I have an EditableGrid called cc_vnd_Grid, and it will be used to perform some UPDATE operations on database.
I need to have total control on UPDATING, so, I set Custom Update Type to SQL, and Custom Update is "SELECT 1+1", so, no default operations will be performed.
Then, I added a Custom Update Event on "After Execute Update" Event.
Up to here, all things are fine...
But, I need to have only one additional field to use on my UPDATEs queries: it is called "date_oper" , it has a date value, and its value will be used on my updates.
So, on top of this EditableGrid, just below the first Error line, I added a line, and add the textbox field called "date_oper", which have Default Value as "Current Date", that is working perfectly.
The problem is:
Inside the code of "After Execute Update" Event, when I try to get the value of this added field, no information is returning...
What I tried without success (language is PHP):
$date_oper = $cc_vnd_Grid->date_oper->GetValue();
$date_oper = $cc_vnd_Grid->date_oper->Value;
$date_oper = $cc_vnd_Grid->date_oper->GetText();
If I force the value, it works (like this):
$date_oper = $cc_vnd_Grid->date_oper->SetText( "TEST" );
$date_oper = $cc_vnd_Grid->date_oper->GetText();
But I need to get a value that should be type on field, just before processing the UPDATE code...
I try to look at Classes.php, to understand how it works, but I couldn't find nothing...
What is wrong with my code ?
Thanks in advance for any help !
Regards,
_________________
=Marcello Capelati= |
 |
 |
datadoit
|
| Posted: 04/07/2011, 6:59 PM |
|
Make sure you place your field between BEGIN ROW and END ROW. Placing
it between BEGIN ERROR and END ERROR will only 'display' that row when
there's an error.
|
|
|
 |
mcapelati
Posts: 17
|
| Posted: 04/08/2011, 4:47 PM |
|
Quote datadoit:
Make sure you place your field between BEGIN ROW and END ROW. Placing
it between BEGIN ERROR and END ERROR will only 'display' that row when
there's an error.
Thanks datadoi, but my field is not between BEGIN ERROR and END ERROR: it is located outside them, just above the column names.
And, if I put it between BEGIN ROW and END ROW, it will repeat for each line on Grid, and I don't want this: I want just one single field which value will be used for all lines of Grid.
Where it is located is where I want, but the problem is that I couldn't get its value
_________________
=Marcello Capelati= |
 |
 |
damian
Posts: 838
|
| Posted: 04/08/2011, 7:57 PM |
|
if it works when you set its value by SetValue() then perhaps it is a date format issue?
if you programmatically use SetValue to set it to the date (instead of using toolbox) can you retieve date successfully using GetValue()?
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
damian
Posts: 838
|
| Posted: 04/09/2011, 4:38 AM |
|
i wonder also if you should try changing your variable name to something other than the same name as the field name?
$date_oper = $cc_vnd_Grid->date_oper->GetValue();
$date_oper = $cc_vnd_Grid->date_oper->Value;
$date_oper = $cc_vnd_Grid->date_oper->GetText();
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
datadoit
|
| Posted: 04/09/2011, 5:58 AM |
|
Also note that if the field is defined as date, then it'll be in an
array. So when you assign a variable to that field, or go to retrieve
the value for that field, you'll need to parse the array.
Try echoing the field's or variable's value to screen using print_r() to
see what's there. Echo then exit is your built-in debugger for PHP. In
your After Execute Update event, after building your custom SQL, echo to
see what you'll be writing to the db.
|
|
|
 |
mcapelati
Posts: 17
|
| Posted: 04/10/2011, 2:59 PM |
|
Quote damian:
if it works when you set its value by SetValue() then perhaps it is a date format issue?
if you programmatically use SetValue to set it to the date (instead of using toolbox) can you retieve date successfully using GetValue()?
Hi damian,
In fact, I also tried using other data types (for example, "Text"), and the problem still occured.
Thanks.
_________________
=Marcello Capelati= |
 |
 |
damian
Posts: 838
|
| Posted: 04/10/2011, 3:57 PM |
|
Quote damian:i wonder also if you should try changing your variable name to something other than the same name as the field name?
$date_oper = $cc_vnd_Grid->date_oper->GetValue();
$date_oper = $cc_vnd_Grid->date_oper->Value;
$date_oper = $cc_vnd_Grid->date_oper->GetText();
did you try this?
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
mcapelati
Posts: 17
|
| Posted: 04/11/2011, 4:25 AM |
|
Quote datadoit:
Also note that if the field is defined as date, then it'll be in an
array. So when you assign a variable to that field, or go to retrieve
the value for that field, you'll need to parse the array.
Try echoing the field's or variable's value to screen using print_r() to
see what's there. Echo then exit is your built-in debugger for PHP. In
your After Execute Update event, after building your custom SQL, echo to
see what you'll be writing to the db.
Hello datadoit,
I tried using TEXT as well, and it didn't work...
Ans I move the code to AfterSubmit Event, and the same error happens
_________________
=Marcello Capelati= |
 |
 |
mcapelati
Posts: 17
|
| Posted: 04/11/2011, 4:26 AM |
|
Quote damian:
if it works when you set its value by SetValue() then perhaps it is a date format issue?
if you programmatically use SetValue to set it to the date (instead of using toolbox) can you retieve date successfully using GetValue()?
I tried with TEXT type and the error persists
_________________
=Marcello Capelati= |
 |
 |
Oper
Posts: 1195
|
| Posted: 04/11/2011, 5:40 AM |
|
Just 1 Question :
Does Field where added after the Grid was created?
ifanswer is yes, Then the ID of your Fields are missing
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
mcapelati
Posts: 17
|
| Posted: 04/11/2011, 9:28 PM |
|
Quote Oper:
Just 1 Question :
Does Field where added after the Grid was created?
ifanswer is yes, Then the ID of your Fields are missing
Hello Oper,
Yes, the field was created after the Grid was created.
But, do you really think that its ID are missing ? If yes, how do I fix it ?
Here is the HTML code where it is defined:
<!-- BEGIN EditableGrid cc_vnd_Grid -->
<form method="post" name="{HTMLFormName}" action="{Action}">
.
.
.
<table class="Grid" cellspacing="0" cellpadding="0">
<!-- BEGIN Error -->
<tr class="Error">
<td colspan="8">{Error}</td>
</tr>
<!-- END Error -->
<tr class="Caption">
<th colspan="8">General Data: <input value="{dt_general}" maxlength="10" size="10" name="{dt_general_Name}" autocomplete="off">
</th></tr>
And this is an example of one of Editable Grid fields definition, in HTML:
<td><input style="TEXT-ALIGN: center" value="{ref_lcto}" maxlength="16" size="6" name="{ref_lcto_Name}"></td>
They look very similar to me: both have almost the same type of declaration.
And, as I said, I could Get a value of this field if I Set a value to it before, like this example:
$cc_vnd_Grid->dt_general->SetText( "TEST" );
$dt_general_got = $cc_vnd_Grid->dt_general->GetText();
(I think that, if its ID was missing, I couldn't even Set a value to it, right ?)
But what I need is that user could type some value on it, so the code could get its value and use in the UPDATE query.
Very tricky...
_________________
=Marcello Capelati= |
 |
 |
Oper
Posts: 1195
|
| Posted: 04/11/2011, 10:16 PM |
|
Yes taht the isue,
go to the property of a new and old campo and check the ID
yiu will see how diferent they are.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
mcapelati
Posts: 17
|
| Posted: 04/12/2011, 4:45 AM |
|
Quote Oper:
Yes taht the isue,
go to the property of a new and old campo and check the ID
yiu will see how diferent they are.
Well, both are TextBoxes.
Both have its "Name" attribute, and "Caption" attributes, and their "Data Type" are Text.
The only difference I see are on Control Sources:
a) old fields are "Database Column", because they could be related to fields on DB (but I won't use this, because UPDATEs are all made inside my code)
b) new field is "Code Expression", because it does not relates to any particular field on DB: it is only an auxiliary field
So... do you know how do I fix it ?
_________________
=Marcello Capelati= |
 |
 |
mcapelati
Posts: 17
|
| Posted: 04/12/2011, 4:59 AM |
|
Quote Oper:
Yes taht the isue,
go to the property of a new and old campo and check the ID
yiu will see how diferent they are.
1) I tried to change its Control Source to Database: does not fix...
2) I tried to associate it to a table field (on ControlSource): it gives error...
3) I tried to create the field inside the Grid, and move it upside, to the place of the new field: it gives the same error...
Any new idea ?
I have an idea that should work (but it is not too much safe and elegant...): to create hidden fields inside the Grid, and use javascript on newfield "OnChange", and copy its value to fields on Grid. But I think that should be an easier and safer way - what if the Javascript was turned off on browser ?
_________________
=Marcello Capelati= |
 |
 |
Oper
Posts: 1195
|
| Posted: 04/12/2011, 6:58 AM |
|
None of the 3 option are the answer
Check the ID property on th eProperty window (normaly on the right when you click the Field
there is some id like formwhatever_{row} <--- Somthing like that
i'm confident that the isue. and your solution
I post Picture in few second
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
Oper
Posts: 1195
|
| Posted: 04/12/2011, 11:40 AM |
|
check:
btw i duplicated your isue. Creating a new Editable grif
CREATE DURING WIZARD

CREATE AFTER

_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
mcapelati
Posts: 17
|
| Posted: 04/13/2011, 5:30 AM |
|
Quote Oper:
None of the 3 option are the answer
Check the ID property on th eProperty window (normaly on the right when you click the Field
there is some id like formwhatever_{row} <--- Somthing like that
i'm confident that the isue. and your solution
I post Picture in few second
Sorry, Oper, but there is no ID content here, really.
I've look in every inch of Properties panel, even on "Format" tab that you show me, and nothing.
Not only on the Text Boxes (<INPUT>) inside the Editable Grid (that was inserted by Editable Grid Builder), nor my own Text Box included by myself.
I even tried to put different names on ID Property, and use it on my tests with GetValue(), and the same thing: couldn't get its value...
For this project, I am using here CodeCharge Studio 3.2.0.6 - maybe this could be a bug on this version...
_________________
=Marcello Capelati= |
 |
 |
Oper
Posts: 1195
|
| Posted: 04/13/2011, 6:52 AM |
|
Could you take and Picture and show me please?
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
mcapelati
Posts: 17
|
| Posted: 04/13/2011, 8:03 PM |
|
Quote Oper:
Could you take and Picture and show me please?
Of course ! Let's go, it will be a BIG reply because of images:
(this is the real project, so, many things are not translated - my language is brazilian portuguese - but I think that you could understand...)
1) This is my Editable Grid, with additional field selected - it's name is "dt_baixa_geral" (which means something like "general-date-to-process"). See its Format properties on right side. See that I put its own name on "id" property, but it didn't work... And note that all those fields on second column are all Hidden fields, which will be used in inside my code.

2) On the next image, I roll the grid to left, so you can see its right part. The field "dt_baixa_geral" is still selected, but its Properties is now the Data tab. Now you can see the last 6 columns with its fields (they are all database related)

3) Now, next image shows the last field selected ("dt_baixa", which means something like "date-to-process-this-particular-row"): I am using this fields individually, for each row, just because I coudn't use the only one "dt_baixa_geral" field (my very problem). If I have dozens of rows, I have to type dozen of values...

4) The same field selected, but showing it's ID property. As you can see, no "id" value is there.

5) Next image show the HTML code of "dt_baixa_geral" field. See its "id" value ? That's because I just enter there manually...

6) Next image show the HTML code of regular Editable Grid fields

7) Next image show PHP code on After Submit event, where I am trying to get its value, and didn't work...

_________________
=Marcello Capelati= |
 |
 |
Oper
Posts: 1195
|
| Posted: 04/13/2011, 8:17 PM |
|
None has the ID really odd
2 More Question
1) Version of CCS
2) Its and old Cobertted Project?
(also do a small sample a new grid editable (new onw) and check if the ID are created)
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
datadoit
|
| Posted: 04/14/2011, 5:40 AM |
|
In the Before Execute Update event, echo the field's value to see if you
have anything there. It should echo for each record shown.
|
|
|
 |
mcapelati
Posts: 17
|
| Posted: 04/15/2011, 6:36 AM |
|
Quote Oper:
None has the ID really odd
2 More Question
1) Version of CCS
2) Its and old Cobertted Project?
(also do a small sample a new grid editable (new onw) and check if the ID are created)
Hi,
1) In this project I am using CCS version 3.2.0.6
2) Wht do you mean "cobertted" ?
3) I made a new Editable Grid below the existent, using Editable Grid Builder: no fields has ID defined...
4) I try with manual Editable Grid: same problem
_________________
=Marcello Capelati= |
 |
 |
datadoit
|
| Posted: 04/15/2011, 6:44 AM |
|
Editable grids and row ID's were changed for more consistency in v4. A
lot of the answers given in this thread were under the premise that
you're on the latest version. You should upgrade. You're running 4
year old software, which in the internet world equates to 10+ years.
|
|
|
 |
Oper
|
| Posted: 04/15/2011, 9:00 AM |
|
_________________
____________________________ http://www.ccsTalk.com http://www.7bz.com (Free CMS,CRM Developed in CCS) http://www.GlobalDevelop.com
(SWISHMAX + CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first
---------------------------------------
Sent from YesSoftware forum http://forums.yessoftware.com/
|
|
|
 |
Oper
Posts: 1195
|
| Posted: 04/15/2011, 9:01 AM |
|
No Much i Can do Now, that why i asked you about version,
Like Datadoit said, the Editable Grid was changed dramaticly. (a lot)
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
mcapelati
Posts: 17
|
| Posted: 04/15/2011, 11:07 AM |
|
Quote Oper:
No Much i Can do Now, that why i asked you about version,
Like Datadoit said, the Editable Grid was changed dramaticly. (a lot)
Hello Guys,
I am very sorry, but I told you my CodeCharge version on post of 04/13/2011, 5:30 AM
See the last line where I said:
Quote :
For this project, I am using here CodeCharge Studio 3.2.0.6 - maybe this could be a bug on this version...
I was really thinking that could be a problem on CodeCharge version....
Well, in fact, I do have version 4.2.00 here, fully functional (I bought it).
I just didn't move from 3.x because it is a big project, and I was afraid to loose some things...
And another thing: for any new field I insert in a form, it brings me those <label> tags, which I have to clean everytime... (is there a way to avoid this...?)
But, if you really think that this could solve my problem, I could migrate. Do you think it would be better ?
*** PS: I would thank you so much for all you cooperation and patience until there !!! Thanks so very much !
Cheers,
_________________
=Marcello Capelati= |
 |
 |
datadoit
|
| Posted: 04/15/2011, 11:36 AM |
|
The latest version is 4.3.00.7676. Your serial should work.
Backup backup backup.
Yes you will likely need to spend considerable time sorting things out
for a large project.
For the ID tags, if you're using or referencing them in some capacity
(such as javascript) in your existing project, then I suggest not
letting the conversion adjust them.
|
|
|
 |
mcapelati
Posts: 17
|
| Posted: 04/16/2011, 12:33 PM |
|
Quote datadoit:
The latest version is 4.3.00.7676. Your serial should work.
Backup backup backup.
Yes you will likely need to spend considerable time sorting things out
for a large project.
For the ID tags, if you're using or referencing them in some capacity
(such as javascript) in your existing project, then I suggest not
letting the conversion adjust them.
Bad News Guys:
1) I installed CodeChargeStudio version 4.3.0.7676, and migrate my project from 3.2.0.6 to 4.3.0.7676
2) The final phase of migration process give me a message that was creating the "ID" references - I thought "great, maybe this could solve my problem"
3) But when I edit my old Editable Grid, and select their fields, no ID references was there at all
4) I even try to create a new Page, with totally new Editable Grid, and same thing: no ID references to their fields (!).
5) But I try to run my code to see if it could GET its value: no way. No values was returned...
So, what can I do now ?
I don't know what to try now...
*
*
*
WAIT A MINUTE... I think I solve the problem of no values on ID attribute !
It seems to be a Windows Vista problem, which was not recording the changes made...
What I have done:
Just before the migration process, I got the ownership of everyfile and directory inside de project, and define its file attributes as "Total Access"
And, now, all fields has its ID attribute set !!!
But now, I have a new question: How do I relate the field ?
In my example, that "dt_baixa_geral" field has its Attribute like this:
. name = {dt_baixa_geral_Name}
. ID = cc_vnd_Griddt_baixa_geral
How do I get its value ?
_________________
=Marcello Capelati= |
 |
 |
Oper
Posts: 1195
|
| Posted: 04/17/2011, 10:59 AM |
|
Not sure about PHP
but in ASP is just one line
in before show Event or Before show row, etc
Newvalue=-Sender.value
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
|