Validation for changes on textfield in Extjs - extjs3

In my UI, I have a gridpanel and 'add' button. when you click the add button, an add window will appear with a few textfields to be filled in. Under in my add window, I have a button 'save' and 'close' at the bottom part. Now, whenever I filled in a data in my textfields and accidentally click the close button, I want to have a prompt message that saying 'there are data that haven't save yet' but if there's no changes, it will close automatically without prompting message.
text: 'Close',
handler:function(){
//...I believe this is where I have to put my code.
}

You can use the isDirty() method. Form components has this method available. It returns true or false.
Ext.getCmp('textfield1').isDirty();

Related

Softkeyboard's "check" button vs using .unfocus()

In this video I first click on a field within the first tab, then click the soft keyboard's "check" button. This hides the soft keyboard and takes the focus away from that field. I then navigate across tabs and back to the first. No field has the focus at this point. This is the expected behavior.
In the second iteration, I click in the notes field. Without closing the soft keyboard, I then click the submit button. That button calls FocusScope.of(context).unfocus(); which hides the soft keyboard and takes the focus away from the notes field (the teal border disappears). However, at this point I click on the next tab and the soft keyboard reappears. And when I click back the first tab the notes field once again has the focus.
Why does this happen?
What underlying code does the "check button" on the keyboard call and can I wire this up to the button rater than calling the .unfocus() method to get the expected result?
Edit: Still no explanation. The undesirable persistent keyboard does not occur on iOS.

Liferay Autofield with DatePicker

I have a aui form with Liferay.Autofields enabled.
The fields that I am duplicating with Autofield has a button and a textfield. The button click will trigger the datepicker and the selected value should be stored in the textfield.
And, when I click the "PLUS" button provided by Autofield, the fields are duplicated.
First, I need to know how I can bind the trigger event of all buttons to the datepicker. I know to do this for a single button. But since we are using autofield, I need to give the ID of the button with the index. Can anyone suggest how to bind the trigger event in my scenario
Second, once I click the date picker button, I should be able to get index of the Autofield row in which I have clicked, so that I can update my textfield

How to prevent GWT dialogbox from closing when clicking outside it

I plan to add a menu that pop ups when a user performs a certain action. This menu will include some fields that the user will fill out and then hit "Submit" which will close the dialog box and update the client based on information inputed.
However, I want the user to be able to close the dialog window by hitting cancel or submit, and not by clicking on the screen outside of the dialog box.
How can i do this? Or maybe I should just use a PopupPanel?
It's as easy as setting the auto-hide behavior to false, either at construction time or later.

Skillbuilders save before exit

I am using the Skillsbuilders Save Before Exit Oracle ApEx plugin within one of my pages but for some reason, I do not want it to fire when the user presses the "Save" button on the page that basically branches back to itself, when they change something on the page.
Now the "Save" button is fired as part of a Dynamic Action, which basically first calls a JavaScript function, followed by PL/SQL and then performs a apex.submit("SUBMIT") JavaScript call.
With this plugin, how can I prevent it from firing when the user presses the "Save" button because when a user changes a field on the screen and then proceeds to press the "Save" button, this plugin fires and displays the dialog to the user that changes have been made, which is not what I want. I just want it to save the changes and stay on the page.
See here for plugin details:
http://apex.oracle.com/pls/apex/f?p=46685:SAVE_BEFORE_EXIT:0:::::
I have read documentation http://skillbuilders.com/download/download-resource.cfm/instructions.pdf?file=Oracle-Apex/plugins/save_before_exit//instructions.pdf
You must change attribute of the plugin named "Disable Warning Selector". Specify jquery selector, applied for all buttons which you want to fire the dialog.

How can I display a dialog canvas in Oracle Forms Builder?

I have built a form in which the user can view multiple rows of data pulled from a table. The user has the option to select a row, then pressing a button to reject the data in that row, (to be marked as rejected in some STATUS field).
I have also designed a rejection confirmation dialog with the ability for the user to enter some comments or reason for rejection.
I have set up the dialog canvas to appear on its own window with the Type proeperty set to Dialog.
When the user selects a row to reject, here is the code that gets executed:
BEGIN
GO_BLOCK('BLK_ALL_RECORDS');
FIRST_RECORD;
IF :FRM_ALL_ROWS.CHK_SELECT = 1 THEN
:FRM_REJECTION.ID := :FRM_ALL_ROWS.ID;
GO_BLOCK('BLK_REJECTION');
SHOW_VIEW('CNV_REJECTION');
EXIT;
ELSE
NEXT_RECORD;
END IF;
END;
And the rejection form has two buttons, one to confirm and one to cancel. Let's just focus on the cancel button for now. Here is the code that is executed once the Cancel button is pressed:
:BLK_ALL_ROWS.CHK_SELECT := 0; /* Forces removal of the check mark */
GO_BLOCK('BLK_ALL_RECORDS');
HIDE_VIEW('CNV_REJECTION');
The only problem is : once the dialog form appears, it hides the parent form, until the form is dismissed. How can display the dialog form ontop of the parent form with both of them visible (in a modal way?)
The navigation between different canvases can be little bit tricky to get to work. Hard to say what is the problem with not having the form in front of me but the first thing I should do is making sure that the 'Raise on entry' canvas property of the 'main' canvas is set to 'Yes'. This should force this canvas to be displayed when you are moving the cursor back to block 'BLK_ALL_RECORDS'.
Another alternative could be to use SHOW_VIEW() in the cancel dialog logic to force the main canvas to be displayed.
I found out what was the problem finally.
The parent Window had a property [Hide On Exit] which is defaulted to Yes and that made the parent form disappear everytime another window is on display. I set it to NO and called the other form. This time both windows are visible, with the modal one always on top.