OnKeyup in input field tied to partial refresh not working on last backspace - onkeyup

I have written an web page in XPages. I have an input field that fires the onkeyup event when a value changes. In the onkeyevent I fire a partial refresh of a div that contains a view of data. I subset the data using what the user types. So, for example, the list may begin with
Alan
Brad
Bryan
Bill
Chad
If the user types "B" then we are left with only the middle three names, if they then add an r for "Br" we are left with only Brad and Bryan and so on.
If the user backspaces then the process is reversed.
It all works perfectly but for one problem. When the user backspaces such that the input field is blank the view should revert back to all names, but it doesn't, it stays just the same as when it had 1 letter. If I backspace AGAIN, THEN the view gets all values.
I have struggled with this for hour with no success and would really appreciate any help.
Thanks,
Bryan

Are you using a viewScope variable to control the view content?
I have a Filter Tool for my views where when typing (onKeyUp) the data is written to viewScope.query. the partial refresh is set on the viewPanel
The data of the view I have set the "Search in view results:" to viewScope.query
Try adding a check if viewScope.query is not null then send back the viewScope.query

Related

Highlight fields in form that have been modified

I was wondering if someone can give me a general guideline or example for the following. I have created a form with several input box fields. When a user inputs something, the field highlights it orange. When a user goes to another field, the highlight goes away and the new box gets highlighted. When the user hits "save" button, the form gets saved. When the user hits "modify" button, it allows them to change the values in the fields. However, this time I would like to have the highlighted box stay highlighted on all the fields that have been changed (and obviously the fields that are not touched remain not highlighted). Is there anyway someone can send me a tutorial or create a quick example to demonstrate this? I am using Angular 1.5 and used Bootstrap to create a simple form.
Thank you
You Can use $touched property to know whether user clicked on that particular form field.
Ex:
custFrom.inputName.$touched
To know actual value modification use $dirty in the same way
Ex:
custFrom.inputName.$dirty
Please find working plunker

Dynamically-populated <select> not populated during testing with Codeception

I am relatively new to Codeception and am trying to perform acceptance testing of a form using it and Selenium WebDriver with Firefox. The form (available at http://www.brighton-hove.gov.uk/content/parking-and-travel/parking/find-your-parking-zone ) consists primarily of a text box and an auto-populated which is inserted into the DOM in the event that the input into the text box results in multiple matches; each field also has a submit button.
The issue I am experiencing is that, when tested normally in Firefox the behaves as expected and is auto-populated in cases where the initial, textual search returns multiple matches (for example, entering any Brighton postcode, although the particular scenario is to search for 'Brighton Town Hall, Bartholomew Square', which returns 3 results). However, when attempting to test via Codeception (either running a complete test or attempting each step via the console), the gets inserted into the DOM but never appears to be populated with real results (the only element it contains being 'Please select your address...').
My test steps are as follows:
$I->amOnUrl('http://www.brighton-hove.gov.uk/content/parking-and-travel/parking/find-your-parking-zone');
$I->fillField('Enter your postcode or house number and street','Brighton Town Hall, Bartholomew Square');
// XPath is used here as the form elements' 'id's, 'class'es and 'name's are auto-generated (the one above just happens to have a label).
$I->click("//div[#id='achieveform']/form/div/div/div[1]/div[1]/div/div[3]/div/input[#type='submit' and #value='Search'])";
// I've also tried using 'submitForm(...)' here, rather than just clicking the button.
// Wait an unnecessarily long amount of time in the hope that the dropdown appears and is also populated...
$I->waitForElement("//div[#id='achieveform']/form/div/div/div[1]/div[1]/div/div[7]/div/div[3]/div/div[1]/span/select", 5);
// The first option is there...
$I->seeElementInDOM("//div[#id='achieveform']/form/div/div/div[1]/div[1]/div/div[7]/div/div[3]/div/div[1]/span/select/option[1]");
// ...but it doesn't have 4 options, as expected.
$I->seeNumberOfElements("//div[#id='achieveform']/form/div/div/div[1]/div[1]/div/div[7]/div/div[3]/div/div[1]/span/select/option", 4);
Although the test I am looking to perform is essentially black-box my next course of action is to attempt to look into tracing the form submissions and DOM updates, even though that level of knowledge of the underlying structure of the system should not be necessary. Am I overlooking something simple? Any pointers would be appreciated.
Apologies, it turns out it wasn't anything to do with Codecepetion after all: the issue was partly to do with the backend logic behind the search form (which doesn't seem to like the comma) and partly due to me for not noticing that the behaviour with the empty dropdown did actually also occur when performing the same actions outside of Codeception.
Moderators: this thread can be closed/removed (as the issue was a non-issue within the context of Codeception) now.
Seems you are not filling value in the right field or the text input field of the search box:
instead of:
$I->fillField('Enter your postcode or house number and street','Brighton Town Hall, Bartholomew Square');
Use:
$I->fillField('.dataelr input', "Your Value here");
Hope it helps.

Changing the style of an inputbox for memos

I am a beginner at Microsoft Access trying to creating a database and one of the fields is a memo field. I would like to request user input for that field; However, the standard inputbox has a single line for the user to enter data, and although you can use that to add large amounts of text, it is not pleasing.
I want an inputbox that accepts memos so as the user inputs a paragraph of text, he can see the entire paragraph when he submits.
How would I do it using an inputbox and not a form? Is this possible?
I am guessing you are entering the data directly into the table. If so you can simply hover over a line between two rows until you get the double arrows and click and drag. When closing the table it will ask you if you want to save your changes. if you say yes then every time after that it will appear the same when when opened. This will give you more viewing area per field. However, I do agree with HansUp, this is best controlled via a form. Here is a snapshot of a table with more room per row.
The same can be done with query results.

How do I copy a populated field, say a "company" name from one web page to another?

I want to copy (populated) data, say a "company" name from a form, to another form, and/or web page. This (populated) data field changes, based on what the client enters, however, the resulting data is always a "company".
Is there code I can paste into my HTML document to do this?
To better clarify what I want to do, please see as follows:
("To: ____")
This is on the top half of my web page in a word document contained in a form.
("Bandera") is the company name.
This is on the bottom half of my page in a word document contained in another form.
All I want to do is copy the "company" name (in this case Bandera) to the "To:___" on that form.
I only mentioned the fact that the company name "Bandera" changes, in case this has any affect on the issue.
I am not a programmer and do not know any languages, so I am looking for the easiest way (a code I can paste into my HTML document) to accomplish this.
Thank you,
Michael
This doesn't look like a problem with a simple cut and paste solution. Since you haven't specified what technologies you're using, i'll keep it generic. Two options that I see are:
Have the user submit the form, take the entered value on the server side and set it as a value/default in the resulting (your other) form that you return.
If you're just looking to populate another form on the same page, you can hook the onblur/onchange event of the input control with javascript and populate the value of a second form using something like the dom/javascript function GetElementById or GetElementByName.
Hope this helps point you in a useful direction.
It sounds like you are referring to a data-bound fields?
I am assuming further that the Company is populated from a database as an ID/Name hash/datatable.
If you are using ASP.Net, there a few options of which some are: storing your key for the data-bound field in Session, moving it across to another page using inline variables, or storing the selected Id against a user details table, and retrieving the ID on the other web-page.

Get selected text within an text item in Oracle forms

There is following scenario:
In Oracle Forms 10, there is a TextItem with text in it. User selects a part of the text using his mouse or keyboard and presses a forms button with trigger behind it.
How do I find the portion of the text selected by the user?
In VisualBasic, there is something like SelectionStart, SelectionEnd, SelectionText. What is the equivalent in forms? Is there any chance to do it with WebUtil?
Thanx
There are 3 built-ins in Oracle form for handling this sort of thing:
COPY_REGION
CUT_REGION
PASTE_REGION
They are all restricted built-ins, so you need to be choosy about which trigger you call them in. Refer to the documentation, it will tell you whether restricted built ins are allowed or not in that particular trigger.
They take no parameters, only operating on the currently selected item (see :system.cursor_item). So, the user is in "textfield1" and they select a certain portion of the data. You need to decide which trigger to issue COPY_REGION in (the easy one is KEY-NEXT-ITEM). For your example, when the user would then press the button to copy, your code would navigate to the intented TextItem and issue the PASTE_REGION built-in.