How do I display a default value when no suggestion found in suggestbox - gwt

I would like to display a default value (that I already set using setDefaultSuggestionsFromText()) when there is no suggestion displayed for the user entered value. Thanks for your help!

You need a SuggestOracle that always returns a suggestion. You could easily build one that wraps your current SuggestOracle and returns your canned suggestion when the wrapped oracle returns none.

Related

Create absolute link with specific value of cell in table view

I want to render a absolute link in table from value of cell but I got a relative link instead.
Here is my configuration:
What I got when click on cell:
http://10.93.9.209:3000/http%3A%2F%2F10.131.227.253%2Fjob%2FPerformance%20Testing%20Pipeline%2Fjob%2Fstable%2F21%2F
In Grafana 7 (new table panel) it's ${__data.fields[2]} where number is column index.
This is a change introduced in one of the new Grafana versions. If you want an absolute URL, you must use ${__cell:raw} instead of ${__cell}. Reference
If you want to reference another column when clicking:
This is possible, I am using 9.1.7 and originally used the old table; however, after migrating noticed the same issue. That said, I found a way to make this work:
Add the ID column that you want to hide; example simID
If the column is the first column, say 0; then use:
var-whatever=${__data.fields[0]}
Now, override the column, field with name: simID Add option ‘Hide in Table’ and turn on
I also had to format the number, e.g. remove decimals & set unit to standard
Hope that helps someone… took me a good 2 hours to figure.
Btw, it also works on graphs and you do not have to hide; aka reference your original query in the datasource and add a data link with the same options.
What result do you get if you try $__cell_2?
The syntax above no longer works. The value is now ${__value:raw}
$__cell_2 above solution worked for me.
With the new table panel introduced in Grafana either ${__cell} or ${__cell:raw} do not work for this now.
You must use ${__value:raw}

How to prevent writing before prefix in GWT valuebox

I am using GWT ValeBox with GWT Renderer to show amount with $ as prefix.
Now I want not to allow user to type any thing before dollar sign. I tried various GWT event handlers like ValueChangeHandler and some others but unable to achieve goal.
Still struggling for it. If anybody know good solution for it, please share here.
Regards,
The easiest would be to not include the currency as part of the value, but next to the field.
Alternatively, you could replace the value with a numeric-only value on focus, and reformat it as a currency on blur.
Couple of solutions:
Use a label before the valuebox. Label value will be $ and valuebox will contain the numeric value.
You can use empty text in the valuebox. Empty text will specify user to enter $ value.

Live search combo in Ext JS 4.2.2

I'm trying to implement a live search combo. It suppose to work like this:
When I enter a character into the combo field I read the current value and send it as a parameter to the store's url. In the backend the parameter is used to return any value from the database that contains it, so the store behind the combo gets filled only with those filtered values.
As I continue to enter characters into the combo, the parameter should be updated and sent again to the backend and so on, getting like this a smaller and smaller store.
I tryied to achieve this behaviour using the combo's event keypress, even keyup, but the problem is it's impossible for me to get access to the current value from the combo field.
For example, when I entered the "for" string into the combo, how can I obtain this value using the combo object? comboName.getValue() doesn't work, it returns nothing "".
I already saw the live combo example here: http://docs.sencha.com/extjs/4.2.2/#!/example/form/forum-search.html but doesnt help me at all.
So my big question is: how do i get the current value while still editing the combo's field?
Any help would be appreciated, thanks.
You should be able to use
comboName.getValue();
or
comboName.getRawValue();
Where comboName is your combo box. Are neither working- I note in your post you state getValues() which is an improper method. You may want to also check whether when you're referring to your combo box object, that the reference is actually correct. The first argument from the key events is actually the object itself, so you should be able to do, e.g.
listeners:{
keyup:function(comboBox){
var value = comboBox.getValue() || comboBox.getRawValue();
console.log(value);
}
}
Swapping you the value getting method as appropriate.
I found that the combo already has a quick search behaviour, I just have to set queryMode on 'remote' and some other small configurations. More details here:
Ext Js 4.2.2 combobox queryMode

org.eclipse.ui.dialogs.ListSelectionDialog input options?

i try to display a dialog for selection the fields of a source.
i like to use the ListSelectionDialog, but i'm not sure what to use for the input parameter.
all the examples in the web uses the
ResourcesPlugin.getWorkspace().getRoot()
as input and yeah, all the projects are displayed.
but i have a list of Fields (IField[]) that i want to show for selection.
the constructor of ListSelectionDialog accept the parameter, but the dialog shows nothing... :(
does anybody has an idea?
thanks a lot!
Sven
I don't think using BaseWorkbenchContentProvider is right. Try ArrayContentProvider.
So something like:
new ListSelectionDialog(shell, fields, new ArrayContentProvider(), labelProvider, msg);

Value of textfield with Zend_Test_PHPUnit_ControllerTestCase

Could anyone advice on the correct way to retrieve and check the value of a textfield with Zend_Test_PHPUnit_ControllerTestCase? The assert conditions are fine for css selectors, but I cannot see a way of checking that a textfield or other form element is correctly populated? any clues much appreciated!
you should validate data entry with Zend_Validate (which is part of the production code). you then would unit test that the value is retrieved correctly after it was stored in the DB.