Android - What does question mark signify in searchable.xml? - android-contentprovider

I'm debugging SearchableDictionary sample on android 4.0. In searchable.xml, what does question mark signify in this attribute, android:searchSuggestSelection=" ?"?
Here is the snippet :
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="#string/search_label"
android:hint="#string/search_hint"
android:searchSettingsDescription="#string/settings_description"
android:searchSuggestAuthority="com.example.android.searchabledict.DictionaryProvider"
android:searchSuggestIntentAction="android.intent.action.VIEW"
android:searchSuggestIntentData="content://com.example.android.searchabledict.DictionaryProvider/dictionary"
android:searchSuggestSelection=" ?"
android:searchSuggestThreshold="1"
android:includeInGlobalSearch="true"
>
Thanks.

It stands for the query typed by the user. See the docs
android:searchSuggestSelection [String]
This value is passed into your
query function as the selection parameter. Typically this is a WHERE
clause for your database, and should contain a single question mark,
which is a placeholder for the actual query string that has been typed
by the user (for example, "query=?").
Alternate
android:searchSuggestSelection="word MATCH ?"

also had a problem on this one, SearchableDictionary sample. cannot find the Resource folder because R.java is not generated which is probably the same problem you were experiencing that's why your debugging the XMLs. this is the solution that worked for me. link
Right-click on your project
Choose Properties
Choose Android in the left menu
Tick a box next to the appropriate Project Build Target.*****
Click Apply and OK
My additional instructions:
*****Choose build higher than API 10 or starting from API 11. If you choose lower than 11 you will still get the error. This worked for me. tried most of the suggestions ahead of this. finally solved it.

Related

Zapier Cli - Setting choices on outputFields does show value, not displaytext

I have an outputField "mchoice2". This is the definition of the outputField:
[{"label":"mchoice2","choices":{"m":"Mac OS","w":"Windows 10"},
"type":"text","key":"mchoice2","required":false,"help_text":""}]
My request returns:
{ mchoice2: 'm' }
But UI shows an "m" instead of "Mac OS". Is it normal behaviour or is there anything wrong in my definition?
David here, from the Zapier Platform team.
That's working as intended. As the schema notes, choices is a map of value to label. So while users see Mac OS (which, as a total pedantic sidenote, should be macOS), the value that comes through in later steps is m. You can reverse these or set it up differently depending on the type of behavior you want.
​Let me know if you've got any other questions!

Understanding basics of iOS uiautomation selector strategy for Appium

I am writing UI automation tests for an iOS native app using Appium and gradually realizing how most of the element locating strategies don't reliably work for iOS. Apart from XPath which randomly works, other options that I have are:
Accessibility ID (did not work for me)
name (not every element will have value for 'name' attribute)
class (makes sense when you are working with a list of elements)
iOS UiAutomation predicates (steep learning curve for beginners)
I have been trying to understand how to use iOS UiAutomation locator strategy and find elements using it but it's not working on Appium Inspector. I have referred to these documentations (Appium iOS Predicate reference, Apple UIAutomation reference) but I feel they cater to an advanced Appium user audience who have some knowledge on iOS development, not for beginners.
Currently the element hierarchy that I am trying to find element in is something like this:
My current automation setup is:
XCode 6.3.2
Appium 1.4.8
iOS 8.3
Appium Java Client 3.1.0
What will be the locator I can use to locate the highlighted element using UiAutomation predicate strategy? I have been trying a few options on the Appium Inspector like:
applications()[0].windows()[0].navigationBars()[0].textFields().withPredicate("value == 'Search eBay'")
.textFields().withPredicate("value == 'Search eBay'")
These did not work. What am I doing wrong here? Are there any other documentations which clearly explain iOS UiAutomation locators from ground-up? It will really help if someone can explain these basics.
I have never worked with Appium before but I have worked with UIAutomation in javascript.
You can probably find the element using:
....textFields().firstWithName("Search eBay")
Note that UIAuatomation uses UIAccessibility protocol. The value for UITextField is its accessibilityValue and that one will be equal to the searched text, not the placeholder. Once you type something to the field, you will be able to use value.
Of course, in your case grabbing the first text field would work too, as there is only one in the navigation bar.
Just use this .navigationsBars()["EBUH_whateverstring"].textfields()["Search eBay"].textfields()["Search eBay"].
Better way is to ask dev to add accessibility id in case the code is in Obj-C or accessibility identifier if the app code is in Swift. Otherwise if the passed on element value is dynamic then the test will fail in asserting or doing action upon this element.
Another failsafe method is using array values.
.navigationsBars()[0].textfields()[0].textfields()[0] --> Check the array values of your element is [0] or any other. U can use this appium app to get the array value from where it shows xpath value for the element. Or you can use XCode Instruments if you have access to the code to find the exact value as UIAutomation interprets it.
If you are trying to find elements in Appium you will have to write code to do so. Assuming you are using Java, which is what I am using for code, the way you locate these elements is through the driver, tables, and rows.
What do I mean by this? Each element has an XPath associated with it, so one way of doing this is saying
driver.findElementByXPath("xpath_string_here");
This can be very useful when trying to run assertions, for example. using the above code, let us say we want to assert that its name is valid. we can say:
AssertEquals(driver.findElementByXPath("xpath_string_here").getAttribute("name"), 'Practice Example");
When I mention tables and rows, I mean doing something like this:
MobileElement table = (MobileElement) driver.findElementByXPath("string here");
List<WebElement> rows = driver.findElementByClassName("Class name here");
What does this code do? it creates a variable of type MobileElement which will go through the xPath you want, and then the rows value will find elements of that class name present inside of that table view. So in the above image, I would stop at the XPath for the UIAWindow, and then tell my rows to find the elements using class name of "UIAButton" for example.
At this point it is a matter of a simple loop if you want to run some actions on them such as .click(); using their indexes using the .get(int i) method. So for example: rows.get(i).click();
Does this help you with your question?

FastReport4: Refresh Dataset

My Report.ShowPreparedReport didn't recognize a new addition to my frxDBDataset.
So, I was building 1 report using TfrxDBDataset linked to a TVirtualTable.
Previously only 10 fields stated in Report1.fr3 and it works well.
I do the SaveAs from Report1.fr3 to Report2.fr3 in designer mode
Get back to my Delphi and add 1 new field "tec" in my TVirtualTable
Go back again in ReportDesigner (file Report2.fr3) and see that my new "tec" field is listed in Data tree.
Add the "tec" field to the report.
Preview while on designer and it was normal.
Run the program and call to preview report, it says "field 'tec' cannot be found" or something like that.
Anyone got solution?
Thanks
Please Try.
TVirtualTable.Refresh;
frxDBDataset.FieldAliases.Clear;
When you clear aliases then call Designer
FastReport automatically updates aliases.
That was the perfect solution for me.

Using Hyperlink Type ReportExecution in JasperReports Server

All I want to do is create a Drill down report from say report "one" to report "two"
I can't find ANY documentation or examples on how to use Hyperlink Type ReportExecution for JasperReports Server
It all seems straight forward but it doesn't work (parameters aren't sent through)
HOW ITS CURRENTLY SETUP:
Target is set to "Self"
Type is set to "ReportExecution"
In reference tab I have correct link (it links to drill-down report successfully)
"./flow.html?_flowId=viewReportFlow&reportUnit=%2FNWU%2FStudentInformation%2FCurriculumManagement%2FAPQIBI005drill"
Anchor and page tab is empty (have no Idea what to put here since I cant find any Docs on it)
Link parameters have values in that should work but aren't (double checked everything here many times)
campusAndFaculty | $P{campusAndFaculty}
campus | $F{cn_campusname.cn_campusid}
Tooltip Tab is empty
What am I doing wrong? Why aren't the params being sent through?
NOTE:
Using JasperReports Server Pro 5.0.1 &
Using iReport 5.0.0
I also know of the sample report (/Reports/Samples/Employee List report.), but our server doesn't have any sample reports
Remove the link from your Reference tab. On the Link parameters tab, add a parameter named
_report
and set the expression for _report to reflect the path to the target report:
"/reports/myFolder/myReport"
Remember to include the quotation marks.
Also, it would seem that the Jaspersoft document site is down at the moment, but for future reference you can access the iReport guide here:
http://community.jaspersoft.com/documentation?version=7114

auto_complete_for: prevent the first item from being auto-selected

The auto_complete_for dealio from script.aculo.us is great an all, but is there a way for me to selectively disable the fact that it always auto-selects the first item in the list?
The problem is that, if I want to type my own entry that is new, and novel, I don't want the first item in the list to be auto-selected. The reason is because when I TAB out of the field, it selects, and fills the text box with that first item.
I got around that, somewhat, by making the first item in the list the same as what I'm typing, but that's not perfect either, because the auto_complete list doesn't always update with every keystroke, depending on how fast I type. I've tried setting the list refresh rate to the lowest value (1 millisecond) but no go.
What I really want is an option in "auto_complete_for" that doesn't select that first item at all - the same way that Google Instant doesn't automatically select the first suggested search phrase - you have to arrow-down to select one.
Maybe I can do this via an HTML option that I'm missing?
Looking at the source, there doesn't appear to be an option for that, but I bet if you changed line 284 of controls.js to this.index = -1; it would do what you want.
Otherwise, it might be time to look for a different autocomplete widget.
If your requirements are too far away from the available plugin, then I guess there is no point in tinkering around. Its best to write your own JS code.
You might want to consider this: https://github.com/laktek/jQuery-Smart-Auto-Complete
or this : https://github.com/reinh/jquery-autocomplete
I'll add another alternative that works great with Rails 3:
http://github.com/crowdint/rails3-jquery-autocomplete
I recently implemented auto complete for more than a field for Rails 2.0.2.
The plugin I used is:- https://github.com/david-kerins/auto_complete . Not sure if it supports Rails 3.
I have also encountered issues on implementing the above scenario and have posted questions( Implementing auto complete for more than one field in Rails ; Implementing a OnClick kind of functionality and formatting wrt Rails Partial-Views ) on stackoverflow for the same, I have been lucky on getting things working for me based on my requirement.
Kindly refer to these questions, they might have relevance to your requirement.

Resources