SAPUI5 TableSelectDialog Search Value - sapui5

I'm using TableSelectDialog control where I'm also performing some search. In order to get the search value on livesearch, i'm using oControlEvent.getParameters.value but it returns me undefined as I see it in an alert box.
Any idea why it is giving me undefined or any other way I can get the value I typed in search field.

This works with oEvent.getParameters().value.

Another idea, as most used way to find the query value is for a SeachField, we use
oEvent.getSource().getValue
Here, you can also find the query string similarly:
oEvent.getSource()._oSearchField.getValue()

Adding to the other answers here you can also do:
onSearch: function(oControlEvent) {
oControlEvent.getParameters("value");
}
https://sapui5.hana.ondemand.com/#/api/sap.m.TableSelectDialog/events/search

Related

How can you filter search by matching String to a field in Algolia?

I'm trying to create filters for a search on an Android app where a specific field in Algolia must exactly match the given String in order to come up as a hit. For example if Algolia has a field like "foo" and I only want to return hits where "foo" is equal to "bar", then I would expect that I would have to use a line of code like this:
query.setFilters("foo: \"bar\"");
Any guesses as to why this isn't working like I see in the examples or how to do so?
Ah, I thought that attributesForFaceting was done by setting what was searchable or not. It was on a different page within the dashboard than I was previously using. Thanks #pixelastic.

Is there a way in the AtTask API to get every project where a custom field is not null?

I want to search for a project where a custom field is not null. Something like this:
GET /attask/api/project/search?status_mod=notnull&&DE:Custom Field_mod=notnull
I see it's working for normal fields, but when I try this for a custom field it's crashing, when I extend the field with _mod.
I'm a bit late on this but have you tried something like this?
GET /attask/api/project/search?status_mod=notnull&DE:Custom Field=0&DE:Custom Field_mod=notnull?
You usually need to give it a value before you try to modify the value from what i understand.
You can use below request url
GET attask/api/project/search?apiKey=xxxxx&status_mod=notnull&categoryID_Mod=notnull
It will return all project which contains custom_fields(part of category)
GET attask/api/project/search?apiKey=xxxxx&status_mod=notnull&DE:Custom Field_Mod=notnull
you need to use "_Mod" (M in caps) with any custom_field which should be present on Workfront.

Possible to isElementPresent(:id, "id") in watir webdriver

Using Watir Webdriver, I wanted to have a helper that would check for any element with given id. I may not know what type it is ( button or link or text). Can I just do
browser.Element(:id, id).exists
All of the examples i've found on google check against a specific element type, as in
browser.button(:id," ").exits
If there is a way, please share the syntax.
In Watir-Webdriver, I would use something like this:
browser.element(class: 'post-tag').exists?
which would find the watir-webdriver tag on this page and report that it exists. Note that I used the 1.9 syntax instead of the alternative syntaxes of:
browser.element(:class => 'post-tag').exists?
or
browser.element(:class, 'post-tag').exists?
As Dave points out, there is #element method. (You were wrong just in capitalization, it is not #Element.)
Since you are asking about accessing it using id attribute, try this:
browser.element(:id => id)
I've never gotten .exists? to work right on it's own.
What I've had to use in these cases has been to explicitly validate the "exist?"... like:
cf_checbox = #browser.text_field(:id=>'continue-ring', :value=>true).exists?
assert( cf_description == true)
without that explicit assertion, I would always get a "true" even when the value didn't exist.

Get statuscode text in C#

I'm using a plugin and want to perform an action based on the records statuscode value. I've seen online that you can use entity.FormattedValues["statuscode"] to get values from option sets but when try it I get an error saying "The given key was not present in the dictionary".
I know this can happen when the plugin cant find the change for the field you're looking for, but i've already checked that this does exist using entity.Contains("statuscode") and it passes by that fine but still hits this error.
Can anyone help me figure out why its failing?
Thanks
I've not seen the entity.FormattedValues before.
I usually use the entity.Attributes, e.g. entity.Attributes["statuscode"].
MSDN
Edit
Crm wraps many of the values in objects which hold additional information, in this case statuscode uses the OptionSetValue, so to get the value you need to:
((OptionSetValue)entity.Attributes["statuscode"]).Value
This will return a number, as this is the underlying value in Crm.
If you open up the customisation options in Crm, you will usually (some system fields are locked down) be able to see the label and value for each option.
If you need the label, you could either do some hardcoding based on the information in Crm.
Or you could retrieve it from the metadata services as described here.
To avoid your error, you need to check the collection you wish to use (rather than the Attributes collection):
if (entity.FormattedValues.Contains("statuscode")){
var myStatusCode = entity.FormattedValues["statuscode"];
}
However although the SDK fails to confirm this, I suspect that FormattedValues are only ever present for numeric or currency attributes. (Part-speculation on my part though).
entity.FormattedValues work only for string display value.
For example you have an optionset with display names as 1, 2, 3,
The above statement do not recognize these values because those are integers. If You have seen the exact defintion of formatted values in the below link
http://msdn.microsoft.com/en-in/library/microsoft.xrm.sdk.formattedvaluecollection.aspx
you will find this statement is valid for only string display values. If you try to use this statement with Integer values it will throw key not found in dictionary exception.
So try to avoid this statement for retrieving integer display name optionset in your code.
Try this
string Title = (bool)entity.Attributes.Contains("title") ? entity.FormattedValues["title"].ToString() : "";
When you are talking about Option set, you have value and label. What this will give you is the label. '?' will make sure that the null value is never passed.

Facing issue when search using Zend_Lucene

I am using zend_lucene for search functionality.I 've the following code,
$doc->addField(Zend_Search_Lucene_Field::Text('categoryName', $result->name));
Here name in "$result->name" is varchar type in Database. Also have some following values like dinesh,kumar123,3333. For testing purpose i have stored number in name field. when i search dinesh , Search comes with exact result but when i use number search, That is 3333 Search has no result. What i done wrong on the code Zend_Search_Lucene_Field::Text.
Is there any way for search number/char/alphanumeric (kumar123) ?
Thanks in Advance
Finally i found by declaring "Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive());" and use Zend_Search_Lucene_Field::Keyword instead of Zend_Search_Lucene_Field::Text