Twitter bootstrap typeahead Bloodhound remote with minLength 1 - twitter-typeahead

I have a multiple datasets auto-complete implemented using the Bloodhound with default suggestions and second with a remote source.
minLength is set to '0' and so it works for default suggestions on focus, perfectly.
But the request to the remote is also executed on focus and so alongwith the default, second dataset result is also displayed.
How to make sure that the remote dataset is displayed only when the minLength is more than 0. i.e. 1 or more.

Related

The validation in interactive grid in oracle apex

My problem is that the validation is not working well in interactive grid in my application. I have tried all the possible ways, but nothing is working. The validation works well in the interactive report, but not with the interactive grid.
The problem is that the error message keeps appear even if the data is correct. EX: if the validation condition is "Column is not null", the error message is shown even if I fill the column with data.
..
Another thing, if I made the option of value required on, the same problem appears.
Is their anything to do?
I'm curious about how the validation worked for Interactive Report, anyway here's an example about how to create page validations:
In your Interactive Grid Page, navigate to validations and make sure that editable region and column are set up correctly.
When you run the page, you'll be able to see the error message when column is null. Once the column has a value, it will possible to save the changes.
I'm doing what the solution states, however, the error notification message "1 Error has ocurred" followed by the validation error message doesn't show up, I just get a red frame with an X icon on the field, and when saving, it just shows a notification message "Correct errors before saving". For the validations, The editable region and column are set up correctly, just like on the example image.

How to clear a text field using Robot Framework?

I'm using the Sikuli Library with Robot Framework to run tests for a local windows application. Most solutions online are selenium based but I believe that only to work for web applications.
Entering text has been fine for the empty fields when there isn't a default value concerned.
Currently, I'm dealing with a field that contains a default value of 5000 but I need to change it to 10.
Text Field:
So far I've tried things such as:
Double-clicking the field first to highlight then type over (Input Text single clicks and removes highlight anyway)
Single-Clicking as Input text single clicks itself (Does not happen fast enough to simulate a double click)
I will answer in Sikuli terms. You just execute Ctrl+a to select content of the cell and then type 10
type('a', KeyModifier.CTRL)
type('10)

Install4j console handler for directory selection

My app has an installation directory chooser form. It validates whether dir has required available space. Screen looks like:
some text
Dir chooser component
A label which prints the available disk space. This is bound to a context variable availableSpace.
Disk space is calculated in "validation expression".
This works correctly in UI mode. In console mode - the behaviour is:
A. #1 is shown.
B. #2 asks user to select dir
(user selects a dir)
C. #3 shows the label text. Since there is no calculation done yet, availableSpace is not updated yet. User sees an old value.
D. Validation logic triggers and the UI is rerendered.
E. #1 is shown. #2 is shown and user enters the dir again. #3 shows the value which was set in #C.
From UI's perspective the form has already calculated data so #C is correct.
But from console user's perspective, user entered a dir and so #C is confusing to user. Because he just entered a dir and space value is old. He thinks that the dir has space, why is application shows old value ?
How to fix this behaviour ?
One solutionis to not show #C on console mode and instead use a Util.showMessage().
Can ConsoleHandlerFormComponent solve this ?
Is there a handler for DirectoryChooserComponent selection ? That can check for space in real time.
Thanks for your help.
In console mode, the "Validation script" property of the "Installation directory chooser" form component is executed as soon as you confirm the selection.
The problem in your case is that the label is not updated. This is because form components are initialized only once at the time that the screen is created. You can call
formEnvironment.reinitializeFormComponents();
in the "Validation script", then the contents of the label will be evaluated again.

XPages Dojo DataGrid and REST Service do not save editable columns changes

We have a REST Service and Dojo DataGrid that does not save the changes to editable columns on the initial load -- meaning the XPage loads and changes are made. The only way the changes are saved is after the close() or revert() method for the REST service is called, then the save() method is called. The REST Service is pointing to another database on the same server, and uses the keys property:
<xe:restService id="rsVictims" pathInfo="rsVictimsData">
<xe:this.service>
<xe:viewItemFileService defaultColumns="true"
viewName="InvoiceGridVictims" contentType="application/json"
databaseName="voca\vocadatastore.nsf" keys="k28ts71zrjsw">
</xe:viewItemFileService>
</xe:this.service>
</xe:restService>
Here is the DataGrid:
<xe:djxDataGrid id="djxDataGrid1" storeComponentId="rsVictims"
autoHeight="90">
<xe:djxDataGridColumn id="djxDataGridColumn1"
label="Target" width="35px" field="victimTarget">
</xe:djxDataGridColumn>
<xe:djxDataGridColumn id="djxDataGridColumn2"
label="Oct" width="35px" field="month_10" editable="true">
</xe:djxDataGridColumn>
</xe:djxDataGrid>
It flows like this:
Open the XPage with the REST service and DataGrid
Make changes to the editable columns
Click the Save button which calls this code (code is copied from Brad Balassaitis' demo, 06 Custom Control):
<xp:button value="Save Changes" id="victimsSaveButton">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script><![CDATA[// Save the changes...
editedRows = [-1];
var args = {onError: function() {alert('error!');}};
rsVictims.save(args);
//Refresh the grid
rsVictims.close();
dijit.byId('#{id:djxDataGrid1}')._refresh();]]></xp:this.script>
</xp:eventHandler>
</xp:button>
DataGrid is closed, refreshed, but changes are NOT saved
Make changes again and click the Save button
DataGrid is closed, refreshed, and changes are now saved
What I have noticed is that the DataGrid is loaded twice when the XPage is opened -- I see this is Firebug in the Net tab. On the first GET, it retrieves the grid correctly -- the Response is correct, the JSON is formatted correctly, and the start=0 with a count=25.
On the second GET, it seems to lose the grid -- the Response is empty, the JSON items is empty, and the start=25 with the count=25. I have tried setting the start property in the REST Service to 0, but that does not do anything. I have tried setting the count property to 500 as well, but that does not fix it either.
The interesting fact about this is, when the view is moved inside the current database -- so the databaseName property on the REST Service is not used -- the Save button works perfectly. Also, there is only one GET when loading the DataGrid, not two GETs when pointing to a view in another database on the same server. I know there are some issues when looking to another server, but these databases are on the same server.
I know I have posted about this topic before, but I did not get an answer that worked. I am hoping this sheds some more light on what I may be missing.
Thanks in advance!
Dan,
I have nearly an identical situation in my current project. I have mine working perfect so I think I can help. I assume that you already took Per Lausten's suggestion in your previous SO. You wouldn't be able to save at all if you didn't.
The difference between your code and mine is that I am using a xe:viewJSONService instead of a xe:viewFileItemService. The extention library book says that you have to use the viewFileItem if you want it updatable, but this is NOT true.
I had nothing but trouble with the viewItemFileService, see this blog post for the issues I had (http://notesspeak.blogspot.com/2013/07/going-with-extjs-grid-and-giving-up-on.html) I nearly gave up entirely on the dojo grid, but came back to it because it works on mobile.
Using the viewJSONService just works. Instead of a keys property, use the category filter. For you category have code similar to this:
var category:String = lineItemBean.getThisUNID();
if(category == null){
return "show nothing"
} else {
return lineItemBean.getThisUNID();
}
//prevents all records from being returned
You need to be careful, because if the category is null, all records are returned, which could be a big problem or security hole. In my example, I pull from a bean, but you could put a document reference there as well.

how to use QTable::editCell()

I don't understand how QTable::editCell() should be used. I am trying to do some error checking based on entries made by user in a QTable as mentioned in my another question.
I would like to give user an opportunity to re-edit the cell which has error. For example, if name column entry has some special characters such as '(', the user should be prompted for the error and the control should go back to same cell in edit mode. I tried using QTable::editCell() in my code as shown below.
Table->editCell(row, 0, TRUE);
name = Table->text(row, 0);
However, this doesn't work as expected. The control doesn't stay in the cell at all and obviously the name is not correctly collected. So, my question is how to ensure from within code that a cell of QTable can be edited so that the edited contents can be accessed immediately in next statement (as shown in above code).
Note: I am working with qt 3.3.8 only.
I don't think you can do that. You'll have to go back to the event loop, and wait for one of the signals (like valueChanged(row,col)) to be fired to re-validate the data.
A blocking wait on a GUI object is often not a good approach (except for modal dialogs).
I know I'm a little late here but you should use the following connect statement with your own custom function to do your specific needs such as below. You can also use this method to disable users from entering in special characters within you custom function. That way they wont ever have to correct undesirable characters.
connect(ui->tableWidget, SIGNAL(cellChanged(int,int)), this, SLOT(customFunction(int,int)));
void updateTable
{
//remove invalid characters
}

Resources