Country State Dropdown dependency - AngularJS

Its been some time since I have written in this blog. Its mainly because of my work schedule. Cutting short personal note, let me introduce the problem.

I have a plain HTML page which has two drop-down which is my interest in the article. The first one is Country, second one is Region/State.


My requirement is to change the Regions when Country is selected/changed. I was trying to implementing this on my own, rather than trying to use features provided by AngularJS. Then with this stackoverflow thread, I was blown out. It was as simple as a filter clause in ng-options. I had never ever dreamed of anything simpler.

Of course in my JSON, region data has a country id which made this approach simpler. Let me share my JSON.

{
    "states": [
    {
            "id": 1,
            "code": "KAR",
            "name": "Karnataka",
            "country": 1,
            "region": 1
    },{
            "id": 2,
            "code": "KER",
            "name": "Kerala",
            "country": 1,
            "region": 1
    },{
            "id": 3,
            "code": "MOS",
            "name": "Moscow",
            "country": 2,
            "region": 5
    }]
}

In my HTML this is how I had implemented the ng-options for country and region.  Should I tell you that country 1 is India, and 5 is Russia?

<select ng-model="editData.country" ng-options="option.id as option.name for option in country.countries"></select>
<select ng-model="editData.region" ng-options="option.id as option.name for option in region.regions | filter:{country:editData.country}"></select>

Now notice the text in Bold, that is all required for this magic to happen. Really hats of to the person who commented on stackoverflow, and AngularJS team for making such a simple framework for people like me. The comment is really easy to miss, and I am reproducing this for my future reference.

ng-options="state.name for state in states | filter:{country:countryCode}"

[SOLVED] FRM-30401: Warning: Formula ignored for non-formula item

This was a strange error which was daunting me for couple of hours today. The field name reported by Forms Builder had no formula attached to it.


The property of all fields in the block was also same. But since this was a warning, I tend to ignore. But after some more time, bogged over with the unnecessary popup while creating FMX.

Some googling gave me an answer that this was a Form Builder Bug. Then in no time, I got the solution from Oracle Forums. 

Specify some dummy formula in the field which is reporting error, and later clearing the property to None and no Formula removed the warning thrown. 

Recording for my reference.

Oracle Apex: Dynamic Action Bug

I was struggling to find a fix for the problem. Only now I recognized it was a bug in Oracle APEX Version 4.2.3.00.08.

The scenario:

1. I have two regions with Interactive & Classical Report
2. When a value is modified in select item in page, I need to refresh these reports. (Used dynamic action to refresh regions on page item change)
3. I used jQuery tabs for the reports (instructions on how to created it is here)
4. I modified the Template of the reports to "No Template"
5. The region refresh stopped working.

I was assuming that the refresh did not work because of jQuery tabs. But later I realized that the "No Template" caused the bug.

To fix this you may either create a new Template or use a region which has a template. I have used the "Borderless Region (no heading)" and the dynamic refresh works.

Not sure about this being fixed in later versions of Apex.