antonizick
Posts: 3
|
| Posted: 10/26/2004, 2:54 PM |
|
In the grid below the user searches (data query) by date, unit, and possession. I need to populate the DATE, UNIT, and POSSESSION fields on the grid to match the search criteria when the user updates the LINE textbox.
How can I use code to determine that a value has been entered into LINE textbox and then make that rows DATE, UNIT, and POSSESSION values on the grid equal to s_date, s_unit, and s_possession in the searchbox above? It can either be a client or server side event.
I cannot use the Default Value option because it will cause numerous bogus line inputs when the user submits less than the available 5 empty lines. I've tried numerous events but had no luck as of yet. Thanks for any help you can give.

|
 |
 |
DonB
|
| Posted: 10/26/2004, 3:25 PM |
|
With the CmdExecution property (in V2.3.x), you should be able to "kill" the
empty lines so that they are not inserted(although they will, unfortunately,
still be processed as inserts). Set CmdExcecution to false if the fields are
empty, or whatever criteria you need in your situation, to prevent a row
from being inserted (also works for update and delete operations). Do you
checks and set it false in the releveant Before Execute Insert/Update/Delete
events.
--
DonB
http://www.gotodon.com/ccbth
"antonizick" <antonizick@forum.codecharge> wrote in message
news:6417ec7922a190@news.codecharge.com...
> In the grid below the user searches (data query) by
date,
> unit, and possession. I need to populate the DATE, UNIT, and POSSESSION
fields
> on the grid to match the search criteria when the user updates the LINE
> textbox.
>
> How can I use code to determine that a value has been
> entered into LINE textbox and then make that rows DATE, UNIT, and
POSSESSION
> values on the grid equal to s_date, s_unit, and s_possession in the
searchbox
> above? It can either be a client or server side event.
>
> I cannot use the Default Value option because it will
> cause numerous bogus line inputs when the user submits less than the
available
> 5 empty lines. I've tried numerous events but had no luck as of yet.
Thanks
> for any help you can give.
>
> 
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
antonizick
Posts: 3
|
| Posted: 10/26/2004, 10:51 PM |
|
Thank you very much DonB for the quick and very helpful response! That worked perfectly!
Thank's for helping out.
Just as a point of interest though...... I tried to use code to adjust the values using the three events you indicated and I could not alter the values with code ( code is shown below )
If daily.line.Value < 1 Then
' *** No Line Number Entered - Do no process information
daily.DataSource.CmdExecution = false
Else
' *** Line Number Contains a Value
' *** Set the Date and Unit equal to Search Box Values
daily.date1.Value = dailySearch.s_date.Value
daily.unit.Value = dailySearch.s_unit.Value
End if
I ended up setting the values of these fields by using the 'Default Value' and it all works great. I'm the type that likes to know the 'WHY' behind things. Simply as a matter of curiosity why didn't the code above work?
|
 |
 |
mrachow
Posts: 509
|
| Posted: 10/27/2004, 12:58 AM |
|
I cannot give a direct answer. But
these search values should be available as parameters so you should be able to access them by using CCGetParam() or CCGetFromGet().
Regards,
Michael
_________________
Best regards,
Michael |
 |
 |
DonB
|
| Posted: 10/27/2004, 12:09 PM |
|
I think you've lost sight of the way webpage processing occurs. You had a
grid displayed, then submitted the <FORM> containing it. all the form data
(grid fields) were passed back to the server where you had access to them in
the event routine. The submit returned you to the same page, but the data
for the form was refetched from the database (not from variables you updated
in the event routine). The returned values are "perishable" and will be
lost upon returning to the page after all submit processing has completed.
--
DonB
http://www.gotodon.com/ccbth
"antonizick" <antonizick@forum.codecharge> wrote in message
news:6417f374ce39b9@news.codecharge.com...
> Thank you very much DonB for the quick and very helpful
response!
> That worked perfectly!
>
> Thank's for helping out.
>
> Just as a point of interest though...... I tried to use code
to
> adjust the values using the three events you indicated and I could not
alter
> the values with code ( code is shown below )
> If daily.line.Value < 1 Then
> ' *** No Line Number Entered - Do no process information
> daily.DataSource.CmdExecution = false
> Else
> ' *** Line Number Contains a Value
> ' *** Set the Date and Unit equal to Search Box Values
> daily.date1.Value = dailySearch.s_date.Value
> daily.unit.Value = dailySearch.s_unit.Value
> End if
>
> I ended up setting the values of these fields by using the
> 'Default Value' and it all works great. I'm the type that likes to know
the
> 'WHY' behind things. Simply as a matter of curiosity why didn't the code
above
> work?
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
antonizick
Posts: 3
|
| Posted: 11/02/2004, 9:35 AM |
|
Don That's a great explationation that also highlights the fact that I still have to get used to this enviornment. ( I'm new to ASP/ Web application programing ) Thank you again for your time.
Mrachow I will give that a shot. Thanks for the tip !
|
 |
 |
|