Alpha Video Training
Results 1 to 9 of 9

Thread: Search bar not working when using phonegap

  1. #1
    Member
    Real Name
    Alex Mathews
    Join Date
    Mar 2015
    Posts
    2

    Default Search bar not working when using phonegap

    Hello,

    I am a relatively new Alpha user and could do with some help using the "search" features of Alpha.

    I have got a working app which I have built for mobile (I eventually want to distribute the app on the app stores, android first). The app is very similar to the "Conference App" that Alpha uses to demonstrate the basic functionality of mobile apps. The data for the list is based on an MS Access database (which I have used connection strings to link to the list) and seems to be working well (i.e. My list is populated and when the user clicks on the list item it will open a panel with the specific information regarding that list item). Yay!

    However, I have also included a search feature both on the main page and the panel that includes the list. These searches are both keyword searches that filter the list down based on the keyword search. When I run the Live Preview in Alpha, this search feature works fine and does exactly what I want it to do. However, when I then deploy the app using the PhoneGap builder (and subsequently install the app onto my device for testing) the search feature does nothing and the buttons don't seem to even respond.

    Is there something that I need to do to point the search button and text box at the database that the list is using, because I am using phonegap or is this something that should just work (and i have therefore, done something wrong).

    Thank you in advance,

    Alex

  2. #2
    Member
    Real Name
    Alex Mathews
    Join Date
    Mar 2015
    Posts
    2

    Default Re: Search bar not working when using phonegap

    Hello again,

    No one has replied to this last post despite lots of views. I am still having issues with the search feature on my mobile application. However, I have done some digging and I have noticed some stuff that will potentially make a bit of a difference.

    Firstly, I didn't mention before that I my database is a very simple database which has two tables that are linked. However, I am using a select query to gather the required information (all of the data across the two tables) and then loading that data into my List Control. To be honest, there isn't really any need to have the data stored in an external database because I am not recording anything and the data is static (i.e. A directory of websites that doesn't change). I have looked at the HTML file for my application and I have noticed that all of the information is included (because this is how the list is populated). Therefore, I think I should be able to run a search without needing to do any call-backs at all, as I am simply trying to apply a filter to the already loaded information.

    In an attempt to try things in a different way, I tried to build the data into the app permanently by setting the List Control up using static data, however, I must have too much information for this because it only let me add 54 or 120 records in the "Static Data - Text Import" feature. If I could add all the data in here I think I would have solved the problem.

    Therefore, I would really appreciate it if someone could let me know how to either:

    Add more data in the static data source property of the List control

    Or

    How to apply a filter to the list using the information that is stored in the HTML file for my application

    My eventual goal is to have my app running using phonegap (as explained in my previous post) where the search feature filters the data in the list. If this can be done (which I'm sure it should be able to) without having to make an external call back, I should be able to create my app using phonegap build and not require an external server at all (as the app is pretty much self contained). I would be happy to include the PhoneGap build link to my app in my next post if someone shows some interest or can help me further.

    Thanks in advance,

    Alex

  3. #3
    Member
    Real Name
    Bill Anderson
    Join Date
    Nov 2014
    Posts
    9

    Default Re: Search bar not working when using phonegap

    I wish someone would respond to your post. I am having the exact same issue.

  4. #4
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,702

    Default Re: Search bar not working when using phonegap

    Hi Alex,

    I think what you need to do is include specific details about how you are performing your search. What Alpha tools are you using... what are you calling, etc. I don't think it really matters how you are populating your List control. Once populated you can run a client-side filter on that List a couple of different ways.

  5. #5
    Member
    Real Name
    Bill Anderson
    Join Date
    Nov 2014
    Posts
    9

    Default Re: Search bar not working when using phonegap

    David, I have created a very small app, mainly just to test PhoneGap. I have created a UX page with a couple of panel cards. One card has a Button, a text box and a list object. I enter text to filter the list data in the text box, then click the button which runs a Java action script that simply sets the filter on the list box. This works fine when ran on my development computer; however, does not do anything when ran on my android device. I have tried a couple of different variations, and all have the same outcome.

    Your help with this is MUCH appreciated.

  6. #6
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,702

    Default Re: Search bar not working when using phonegap

    Again... you need to be very specific. "Java [sic] (Javascript) action script that simply sets the filter on the list box" leaves much to the imagination. Which specific action are you using (the exact name) and what are it's settings.

  7. #7
    Member
    Real Name
    Bill Anderson
    Join Date
    Nov 2014
    Posts
    9

    Default Re: Search bar not working when using phonegap

    David, does this show you what you are asking for? Again, it works fine on my desktop computer, just not after I send to PhoneGap.

    ListFilter.jpg

  8. #8
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,702

    Default Re: Search bar not working when using phonegap

    Yes... now we're talkin'...

    Here's one of the best tips in the whole world... read, read, read the notes the Alpha gives you. Notes give you very specific information as well as clues to what might be going on if you're not getting the results you expect. The action you're using performs an ajax callback to do a server-side search. This is fine... but... since you're dealing with a callback... and PhoneGap Build... then your component must be published and the URL for Ajax Callbacks must be correctly set in the PhoneGap Build builder.

    Unless you really want to do a server-side search I would suggest you do a client-side search. The notes in the action you're currently using tell you how to do that. Use the List Control Actions action... or use the Javascript methods of the List control .filterListClientSide or .setFilter.

  9. #9
    Member
    Real Name
    Bill Anderson
    Join Date
    Nov 2014
    Posts
    9

    Default Re: Search bar not working when using phonegap

    Yes... read, read, read is the BEST tip in the whole world! That was my problem. Thank you for your help.

Similar Threads

  1. Replies: 5
    Last Post: 12-31-2014, 09:52 AM
  2. PhoneGap Build Genie not working in Version 3.1
    By Selwyn Rabins in forum Mobile & Browser Applications
    Replies: 0
    Last Post: 12-20-2014, 09:22 AM
  3. phonegap security login not working?
    By brad.lindsay69@gmail.com in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 07-09-2014, 04:12 PM
  4. PhoneGap Builder QRCode for IOS is not working
    By phan9413 in forum Mobile & Browser Applications
    Replies: 25
    Last Post: 04-18-2014, 09:03 AM
  5. Hide Quick Search Bar When Nothing To Search
    By RankFirstPro in forum Application Server Version 11 - Web/Browser Applications
    Replies: 6
    Last Post: 03-13-2013, 06:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •