Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.

Editable Table - Device & Desktop

Reply
 
LinkBack (1) Thread Tools Display Modes
  #11 (permalink)  
Old 09-03-2008, 08:40 AM
Senior Member
 
Join Date: May 2007
Posts: 174
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi

I made this changes on Erel's EditableTable...but doesn't work when selecting partially diplayed cells and scroll bars...

Code:
Sub eventScrollH_NewEvent
btnAccept_Click
End Sub
Sub eventScrollV_NewEvent
btnAccept_Click
End Sub
Needs to put it back to original...

Code:
Sub eventScrollH_NewEvent
pnlEdit.Visible = 
False
End Sub
Sub eventScrollV_NewEvent
pnlEdit.Visible = 
False
End Sub
CORRECTED File on my previous post...

My only problem now is on device, when updating cell entry and then drag scroll bars, the cell will display unchanged content, but when you select this cell again, it will appear the updated content. What is the best thing to do?
__________________
Rioven

DEVICE: Motorola ATRIX (Dual Core) Android 2.2.1
DESKTOP: Intel Pentium Dual-core E5200; Microsoft® Windows® Vista Home (Basic); Hard Disk:320GB; Memory:4096MB

Last edited by Rioven : 09-03-2008 at 09:05 AM.
Reply With Quote
  #12 (permalink)  
Old 11-21-2008, 09:01 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

A new version (1.10) was uploaded. See the first post.
__________________
Basic4android documentation
Reply With Quote
  #13 (permalink)  
Old 12-13-2008, 01:39 PM
Junior Member
 
Join Date: Dec 2008
Posts: 43
Default

Hi to you all. Can someone help me how the sub: Sub Validate(column, value) is called? I wanna check if i can add another parameter (the row or another field value of that record, like the primary key field).
If i can, then it is easy to update de database by a SQL command.
I can´t believe i was the entire morning with this isue. Help me masters please.

Thanks,
Reply With Quote
  #14 (permalink)  
Old 12-13-2008, 02:12 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Sub btnAccept_Click
If cmbEdit.Visible = True Then
value = cmbEdit.Item(CmbEdit.SelectedIndex)
Else
value = txtEdit.Text
End If
pnlEdit.Visible = False
If tables(currentTable).validator <> "" AND _
CallSub(tables(currentTable).validator,Control(Tab leName,Table).SelectedCol,value, New Parameter) = False Then
Return
End If
Control(TableName,Table).Cell(Control(TableName,Ta ble).SelectedCol, _
Control(TableName,Table).SelectedRow) =value
End Sub
__________________
Basic4android documentation
Reply With Quote
  #15 (permalink)  
Old 12-14-2008, 01:03 AM
Junior Member
 
Join Date: Dec 2008
Posts: 43
Default

Good night, Erel i have a problem that i´m not able to solve. As I said today, I´m struggling to get database update working. As it is right now, the DB is updating but gives a overflow error. I tried to put the SQL update where you said, but in there is before the validation process, so i put it after that process.
Could you please take a look when you can? I don´t like to be asking things all the time, i like to fight the things till i figure it out how to solve, but in that case is very hard, i guess i started with a not newbie project.

Thanks again for all your help.

Regards
Attached Files
File Type: zip Inventario update error.zip (5.5 KB, 26 views)
Reply With Quote
  #16 (permalink)  
Old 12-14-2008, 05:49 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You should use ExecuteNonQuery instead of ExecuteTable.
An UPDATE operation doesn't return any value. ExecuteTable takes the result of a query and inserts it to a table.
Code:
 (line 36)
        cmd.CommandText = 
"UPDATE inventario SET conta = "& value & " WHERE IDPK = "& chave
        cmd.ExecuteNonQuery
__________________
Basic4android documentation
Reply With Quote
  #17 (permalink)  
Old 12-14-2008, 10:10 AM
Junior Member
 
Join Date: Dec 2008
Posts: 43
Default

Thanks Erel, i need to read more the Basic4PPC commands to avoid stupid questions like i did. Now it works fine on the desktop but gives me always errors on the device: "NullReferenceException". I searched the forum but i was not able to find any related problem.
Anybody here had the same issue?

Thanks,
Reply With Quote
  #18 (permalink)  
Old 12-14-2008, 12:36 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Which line gives this error?
__________________
Basic4android documentation
Reply With Quote
  #19 (permalink)  
Old 12-14-2008, 01:18 PM
Junior Member
 
Join Date: Dec 2008
Posts: 43
Default

Hi Erel, don't indicates lines:

First - An error occurred on sub __main_tamanhocolunas. NullReferenceException
Continue? -- If I put yes then i try to change a cell value and:

Second - An error occurred on sub __main_validate.
NullReferenceException
Continue? -- If I put yes ther errors repeat on the sames choices.

Never updates. On desktop all OK.

Thanks

Last edited by outlawz : 12-14-2008 at 01:22 PM.
Reply With Quote
  #20 (permalink)  
Old 12-14-2008, 02:55 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Please start a new thread and also post the code of these two subs.
Thanks,
Erel
__________________
Basic4android documentation
Reply With Quote
Reply



LinkBacks (?)
LinkBack to this Thread: http://www.basic4ppc.com/forum/code-samples-tips/2609-editable-table-device-desktop.html
Posted By For Type Date
Pocketinfo Dev-Challenge: Opdracht 3: Omrekenkoersen | Pocketinfo.nl » Blog This thread Refback 12-11-2008 09:42 PM
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using rapi from desktop to copy file from device to desktop sunnyboyj Questions (Windows Mobile) 19 10-27-2010 02:08 PM
Editable table davelew1s Questions (Windows Mobile) 6 06-18-2008 04:06 PM
XYCalc -graphs an equation or editable table of figures in regular, bar or pie chart HarleyM Code Samples & Tips 2 11-24-2007 08:21 AM
Editable Table RandomCoder Code Samples & Tips 3 06-29-2007 11:17 PM
editable table ? giannimaione Questions (Windows Mobile) 2 05-13-2007 11:34 AM


All times are GMT. The time now is 03:49 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0