restrict the autocomplete search results to a user input. - input

I want to restrict the autocomplete search results to the areas and places of a specific city. Ex: user select his city in a first "autocomplete" and the the second "autocomplete" show airports of this input. Thanks you in advance.

Set onchange attribute to the first select box which calls a function when user select a value.
The function should send an ajax request to the server.
in server side, query airports under the specific city and respond the details.
4.Again in client side, parse the response and suggest it.

Related

Access 2013 vba ability to grab a parameterized queries current SQL

Is there a way to get the SQL of the current query if that query has parameters? EX. say SELECT * FROM Orchard WHERE AppleCount=[how many apples]; and the user wrote in 5. I would want to get SELECT * FROM Orchard WHERE AppleCount=5; My current method is to ask the user with input boxes for the parameter but I may be told thats not acceptable, don't ask why.
The proper way to do it is to use your own traps for input - either input boxes or a form, then take those results and pass them to a querydef object via parameters (yourquerydef.parameters("param name") = <user input>
You get the parameters from the user, and pass them to the query yourself - no more popups will be presented to user

Set value dynamic action not working in apex

I have a problem creating sql dynamic action in oracle apex v4.2. I have two fields, Department number and department name. Department number is a text field with autocomplete. The department name is a display field. On changing the department number, the department name should be displayed by an sql query.
I created a set value dynamic action on department number, giving the correct values in page item to submit and the correct sql query referencing P3_DEPARTMENT_NO.
When i run the page, after select a department number, the department name is not coming up automatically.
Could you please suggest on what i might be missing.
Thanks in advance.
You can try use this way:
First step: In the Shared Components -> Application Processes: create a process myProcess an put your sql dynamic in.
Second step: Create a javascript function myFunction to call the process myProcess.
Third step: Use onChange event to call your javascript function myFunction.
Also you can find a lot of exemples on Denes Kubicek app: https://apex.oracle.com/pls/otn/f?p=31517:101:116042570427567.
Best regards,
iulian
The exact behaviour of autocomplete lists is probably browser dependent, but generally speaking, don't rely on the "Change" event, as it won't necessarily fire when you select from the list.
You'll need to experiment to get the behaviour you want in your particular situation, but as a starting point you might want to try replacing the "Change" event type on your dynamic action with "Lose focus". That way the dynamic action should always be triggered when you tab or click away from P3_DEPARTMENT_NO.
In similar situations in the past, I've used "Key release" instead of "Lose focus", and I've created a second dynamic action which does the same thing, but triggered by "Get focus". That combination ensures that the display field stays synchronised with the user's selection, whether a value is keyed in or selected from the autocomplete list. Whether or not you go this route depends on how happy you are about the database being hit with your department name query every time a user interacts with P3_DEPARTMENT_NO in any way.

Rails 3 Saving User Searches DataModel

I am working on a piece of my app where the client is wanting the ability for user searches to be saved (these searches are completed by the user completing a set of dropdowns and then entering in a value in an input field).
I was curious to know if the use for an HSTORE could be beneficial here or should I just simply save out each piece of the search?
For Example (from a UI perspective):
User Selects a category, the next select is populated with stats tied to the selected category, the next select drop down is displayed which allows the user to select a predicate (greater than, less than, equal to, not equal to, etc) and then the input field is shown where the user can enter in their value they are searching for. If the user would like to add another search filter, they can click a button and then the user follows the same pattern as the first
The server side params look like this:
Parameters: {"utf8"=>"✓","authenticity_token"=>"FCvOdXuxtEhEchwDn8U2yaEPShfHW2VosgSoR8eSzV8=", "refresh"=>"1", "search"=>{"0"=>{"category"=>"1", "stat_type_id"=>"5", "predicate"=>"Greater Than", "q"=>"200", "type"=>"stat"}}, "unselected"=>""}
These searches won't really be updated, when a user enters in a new search, it will be saved explicitly.
Once we figure out the best route for this project, I will post the code as the answer

LinkedIn connection search by first name and last name

Is there way to search first name and last name for linkedin connection filter using LinkedIn API?
Suppose I am authenticated by linkedIn and show connection in popup.LinkedIn connection response only 500 connection one time request. So I do paging 500 connection. But I want to send invitations to two persons, so I want to give search widget by first name and last name from my LinkedIn connections.
You could use the People Search API to search on first and last name, restricting the search to just your connections:
http://api.linkedin.com/v1/people-search?first-name=Clair&last-name=Smith&facet=network,F
Update:
In terms of 'filtering' the returned values to remove the current user making the call from the result set, you should check for the returned user's relationship to the viewer:
http://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,relation-to-viewer:(distance)))?first-name=Clair&last-name=Smith&facet=network,F
Then check the results, and remove the users that have a relation-to-user of 0.

Is there a way to return the search term with the Foursquare user search API?

I'm doing bulk user lookups via email address (e.g. users/search? email=joe#foo.com, fred#bar.com, etc), but I noticed that it's not returning the email addresses with the search results. Is there anyway to do this?
Alternatively, I could do a single email address search per request, or do a user lookup by id on all the results I get back, but these options seem wasteful and inefficient.
User email is not one of the fields that the API returns for /users, see:
https://developer.foursquare.com/docs/responses/user.html
Usually API's don't return emails in the clear.