Field must be entered not shown - oracle

I have a required field. It has two triggers:
key next item
when validate item
The built-in message FRM-40202 - field must be entered is not shown in status bar, but when I delete key next item trigger it is shown .
Please, explain to me why this happened and how can I solve this or - at least - how to show the built in message .
thanks

Check form's Property Palette, its "Validation Unit" property. What is it set to? Should be "Item" if you want that validation fires when you leave that required item.
Apart from that, KEY-NEXT-ITEM trigger is here for backward compatibility to Forms 3.0 which was the last version that used character mode, where there was no mouse involved (i.e. navigation was only through keyboard actions).
Nowadays, people use mouse and click here and click there to move through the form, so there's no guarantee that KEY-NEXT-ITEM will ever fire. Its code should be moved to WHEN-VALIDATE-ITEM which you already have. So, if both of them contain same code, and if you (as you said) deleted the KEY-NEXT-ITEM trigger, so be it. It is useless anyway.

Related

CarouselView control: how to block user from getting to the next item in certain situations

I use the latest ver of .Net Maui. In the scenario there is ObservableCollection of items bound to ItemsSource's CarouselView. User is supposed to do some actions upon the current item to make it "valid" in order to be able to move to the next one. CarouselView should block user from swiping card to the next one until the current one is valid, and valid state is defined by properties of the item.
First thing that came my mind was to subscribe for one of Scroll or PositionChanged event and cancel the action propagation, but I do not think the events are cancelable, did not find it in the even arguments. Second less desirable way to implement is to add items dynamically to the ObservableCollection of items once current item got valid. It won't be able to go to the next just because the current is always the last. It though seems to be a bit of a hacky way to resolve this, and I would prefer to implement it on a view level rather than model level (adding items on the fly). So if you know more direct ways to get it implemented please let me know. Thanks.
Update: I'd like users to be able to swipe to all previously handled items (all valid), getting back and forward, but only for valid cards.
Set the property IsSwipeEnable to false when the current item is not yet valid.
From docs
IsSwipeEnabled, of type bool, which determines whether a swipe gesture will change the displayed item. The default value is true.

Why is my Oracle APEX DML Form stuck in edit mode and not going back to create mode?

I have created a page based on "Form & Report" template. So there is the Report page on which there is the create button. That create button leads to the form page which contains.
It is pretty simple. I don't know if there is a cache memory not emptying itself or if there is a setting that I have not properly set.
When I want to create a new database record, Oracle Apex behaves as if I asked it to update a record (though it still presents me with empty text fields).
Below the image of what's happening.
Create button of the Report
Buttons for edit are shown when I click the create button
Those edit buttons are shown instead of the buttons below => This means that the Apex software is behaving like I asked to edit a record not to insert a record.
Why is this happening?
You need to take a look at your create button. Is it passing a value to the form? If so, you probably don't want that. Is it clearing the cache of the form? If not, you probably want to clear it.
Also, on the form page take a look at your processes.. specifically the Automated Row Fetch (ARF) process.. what's the primary key that this process is using?
Also, take a look at the conditions for each button on your form. For the delete/save buttons you likely want a condition type of "value of item / column in expression 1 Is NOT NULL".
For your create button you would want the opposite.. "value of item /... IS NULL".
In both cases for the expression 1 you'd want to use the item that your ARF is leveraging.
#Bloomberg58 if you used the wizard that should not have anyway try to validate the create button in report page and the server-side validation of create and save button in form page

Access 2016 Form Control Validation Rule Not Firing

I have a simple unbound access 2016 form. On the form, I have several controls including text and combo boxes. On the first text box control I would like to require a data value (underlying table field data type is short text).
I have set the Validation Rule property for the control in the property sheet to "Is Not Null" and added an appropriate validation text message.
For an unknown reason I have not been able to get this validation rule to ever fire. I have cleared the validation rule on the table to make sure it wasn't interfering, however, no luck.
It's like the validation check is not happening when focus leaves the control. There is no other event procedure that has been written that would interfere either.
Thanks for the help.
You can give the control a default value, then
Form_load()
Yourcontrol.setfocus
Sendkeys "{DEL}"
The requirement was to validate the control for a missing value using the validation rule when the control lost focus (ie user tabbed out of text box without ever entering a value). I wanted the user to get immediate feedback that they needed to provide a value for the given control.
As Rene pointed out in the comments, the validation rule does not fire unless there has been a value change.
The Sendkeys solution has issues, I only use Sendkeys as a last resort.
The solution in this case was to put the validation test in the Control_OnExit event handler. The user gets immediate feedback as desired and does not wait until the record is submitted.
One further note that could easily be missed; in an unbound form, the before_update event will never fire.

Get value from autocomplete text field in ApEx

I want to create a dynamic action, that will set a value to an item on the page, when the value of another item (autocomplete text field) is set.
So the proccess goes like this:
Click on the autocomplete field
type some letters
choose one of the suggested values
I cannot find an event that will be executed when the selection of one of the suggested values happens. This way, I cannot see how I can read the value of the autocomplete field, once a suggested value is selected.
The change event doesn't fit my needs, it doesn't execute when one suggested value is selected.
I had the same problem, found this link: https://community.oracle.com/thread/2130716?tstart=0 and modified my dynamic action as follows to get the desired behaviour:
Event = Custom
Custom Event = result
From the link:
the problem seems to be the default behavior of the browser. When you
enter some text into the autocomplete and the list is displayed, the
focus is still in the text field. Also if you use the keyboard cursors
to pick an entry the focus will still be in the textfield. That's why
the change event of the textfield doesn't fire. It only fires if you
leave the field.
On the other side if you pick an entry with the mouse, the browser
will remove the focus from the text field for a moment (before the
JavaScript code puts the focus back), because you clicked outside of
the field. But that's enough so that the browser fires the change
event.
I had a look into documentation of the underlaying jQuery Autocomplete
widget
(http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/) and
there is actually an event called "result" which can be captures if an
entry is selected from the drop down list.
Try "Lose Focus" as event. It will trigger your dynamic action when you leave the autocomplete field, i.e. your curosr is moved to another field.
This probably depends on the APEX version you are using.
In case of 18.2, because the underlying component is based on Oracle JET's "inputSearch" component, you need to use following configure to capture the select change event for text with autocomplete:
event: Custom
custom event: ojupdate
Reference:
https://docs.oracle.com/cd/E87657_01/jet/reference-jet/oj.ojInputSearch.html#event:optionChange
I turned on the browser console, then turned ApEx Developer toolbar debug, and found that, on the contrary, the "Change" event does fire upon user clicking with the mouse on one of the selections. However if the user uses keyboard (type a few letters to narrow the list down, then use down arrow key to arrive at desired value, then press enter) then the Change event does not fire, just as you say.
Moreover: even when you do get the value sent back via mouse-click initiated Change event, the value isn't the autocomplete's complete and valid value, but instead the possibly partial and wrong-case value just as typed by the user. I.e., the the change event's submission of the value precedes the autocomplete's substitution.
The answer that #VincentDeelen gave is the best alternative that I can see, although it doesn't quite give that "instantantenous synchronicity" feel. You could maybe use the "Key Down" event, but be careful with that. You could get a really excessive amount of web and db traffic as each and every keystroke (including corrections) results in another firing of the dynamic action.
Testing environment: ApEx 4.2.3 with Chrome 33 as well as IE 9.
p.s. This might be worth a mention to the ApEx development team as well.
It's not really ideal, but you could use onfocus(). I'm looking for the same thing you are, I think, a custom event that fires when the selection of a suggested value happens. I haven't found it yet though and that is my work-around for now. It will run whatever function you've created for this initially with no value, but once the selection is made it will return focus and run the function again with the right value. Like I said, not ideal but it works.
Jeffrey Kemp is right. You can set it up through a dynamic action using the custom event, result. You can also register it on page load using document.getElementById("{id}").addEventListener("result", {function}); or $("#{id}").result( function( event, data, formatted ) { //something here });.
Oracle apex 19 now added a "component event" when you create a dynamic action called "Update [Text Field with autocomplete]" - this action is fired when you select a value from the list, but not when you leave the field (similar to adding the custom event "ojupdate").

How to design this page in razor world

In MVC-3/Razor, I need to create a page which will have five set of controls. Each set will have a drop-down and a text box. User will select an option from drop-down and then provide some feedback on text box.
When the view is shown very first time, I only have to enable controls in first set. Whereas all controls in 4 other sets should be disabled. Once user perform action in first set of controls (select optino from drop-down and enter in text box), the second set should become enable now, whereas other set of controls should still be disbaled. The data shown in this second drop-down is dependent upon what user has selected in first drop-down. Once user complete action in this second set, the data in third drop-down will depend upon whatever user selected in first and second drop-down etc.
I am a web-form aspx developer and not sure what will be the best way of designing this in MVC-razor world (because there is not view state etc).
Step 1)
What needs to be clarified is what will cause the other “sets” to be enabled?
Is it after the user has selected an item in the dropdown
OR
Is it after they have entered some text in the textbox?
What also needs to be clarified is if you have a dropdown AND a textbox are they both enabled at the same time or is the textbox only enabled after you’ve selected an item in the dropdown?
Once you’ve got that figured out, move on to the next step.
Step 2)
Do the users need to visually see the 4 sets from the beginning (disabling the 3 other sets) or can you simply show the other sets (on the fly) once the previous one has been successfully filled?
Depending on the answers, this may vary your approach.
As for me, the way I’d do it is simply have/show one set that loads at the beginning.
Once the user has selected an item from the dropdown, I would make an AJAX call passing along the selected item and get back a list of values for the second dropdown.
Then, using jQuery, I would duplicate the row (or div) of the first set all while changing the values in the second dropdown box.
Repeat process for when an item is selected in the second dropdown.
But wait! There’s more!!!
Let’s assume you’ve reached the third set. What if the user decides to change the value in the first dropdown? What are your requirements if that happens? Should you remove all other sets and start back at square one? I guess so…
Since we are not aware of the full set of specs for your tasks, we can only assume stuff and this may (or not) be the best path to take.
Duplicating a row (or a div) using jQuery is quite fun and performance wise, it’s nice.
Keep in mind, you will have to give a different ID to your controls (dropdown + textbox) so when you submit the form, you could use the FormCollection to get those dynamically generated controls.

Resources