DB Populated, but now records from sql?

Malky

Active Member
Licensed User
Longtime User
Hi, I have created a database on the external card, inserted rows for the first table, but when I query that table to generate a view (ScrollView), I get a count of 0 records and no scrollview?

I tried dbutils, but my maps list still showed an empty array, so tried the manual sql, which I know works and when I copy the db to my PC, it is populated with the correct results? However, in the app I get zero results after the query?

Unless it's a timing or committal thing, I can't see where I'm going wrong?

It is in trial mode, but I've attached the zip if anyone can help? PLEASE?

Malky
 

Malky

Active Member
Licensed User
Longtime User
Strange! I attached it last night?

Will try again, cheers Klaus.

Malky

Edit: The zip file was too large, but ok now.
 

Attachments

  • MalkScrollView.zip
    376.7 KB · Views: 176
Upvote 0

klaus

Expert
Licensed User
Longtime User
As Erel already explained you are trying to fill the database before the HTTP request is finished.
I removed FillScrollView from Activity_Create and
added this code at the end of the JobDone routine.
B4X:
If ListOfJobs.Size = 0 Then
   FillScrollView
End If
Best regards.
 

Attachments

  • MalkScrollView1.zip
    18 KB · Views: 162
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Hi Klaus, we both must have posted at the same time?

Thanks for that, but I though that the fact that I was waiting on the jobs done being equal to zero then calling it would have worked regardless? (The original call was inside the loop, but I remmed that line and move the call to after the loop but still had the problem.

Obvioulsy I've been calling it in the wrong place!

Thanks very much guys and have a nice day.

Cheers,

Malky
 
Last edited:
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Update!

Hi guys, I tested this at work and was getting an error when it came to displaying the first image. I checked this on the sd card and there was nothing saved? The others were saved correctly. I know I was on my data connection at the time which isn't the fastest, so I wondered if this could be a problem?

On the PLUS side, I got home tonight and tested it via wireless and hey!!!! Spot on, it works perfectly and everything seems ok, so can't thank you enough.

When I click on the scrollview though nothing happens and know I should have a click function. Would this create an event regardless of me clicking on the image part of the panel, text or any blank area? Also, what return value could I expect to receive in such an event?

I know I can set the value in the listview options.

If there are any tutorials or examples on this that you can point me to, I will happily go and read them as I know you have enough keeping everything going as it is.

Once again, many thanks,

Malky
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
When I click on the scrollview though nothing happens and know I should have a click function.
Sure !
How to do it depends on what you want and need and how you populated the ScrollView. You can define what view(s) should have the event(s).
Almost everything is possible with a scrollview.

Have a look at ScrollView Examples there you have lots of quite different examples.

Best regards.
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Hi Klaus, I have been reading this, but from what I gather (maybe foolishly) is that I have to create a click event for everything ie. label1, label2, image1, label3 etc? With a small screen the user can click on any?

If this is so, is it possible to handle them all with one event if I only want to return the tag value or some index number or do I have to code every click event for every component?

Malky
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Hi Klaus, I have been reading this, but from what I gather (maybe foolishly) is that I have to create a click event for everything ie. label1, label2, image1, label3 etc? With a small screen the user can click on any?
Oh, fortunately no !
In the filling routine you should define a same event name for all the views of same type for which you want events being raised.
Then you should set the Tag property of these views to the row index.
And one event routine for each different view can handle the event.
To know what view has raised the event we use the Sender function which returns the view that has raised the event and with it's Tag property we know the row index.

If you want I could change the project from post#5 or a more recent one you could post.
But for that you must tell me what information you want to get back from what view.

Best regards.
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Hi Klaus, I think I get what you mean as I have assigned tags to each label, (not sure if I can do that with an image, but am still trawling the forum).

My problem is the first langauge scrollview ( I need 5 in all) will require a different return/send value. Initially, I just need the language abbreviation for the selected language i.e. 'en' for English then the menu items will rely on the index and then the others rely on a relative db connection i.e. if item 2 is selected then the next table displays villages in area 2 and it drills down as such.

No Scrollview will be the same. All I want to do is connect each with a previous click value.

Hope that makes sense, it's getting late here and it doesn't make sense to me

Thanks again,

Malky
 
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Sorry Klaus, didn't see your offer of the update which would be very welcome.

Just getting a bit buried in forum posts and searches.

File attached if it's ok?

Cheers,

Malky
 

Attachments

  • updated scrollview.zip
    18 KB · Views: 162
Upvote 0

Malky

Active Member
Licensed User
Longtime User
Hey Klaus, get some peace and relaxation.

This is fantastic though, can't thank you enough.

Very much appreciated.

Malky
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…