Hdden property not recognized on Android, but works as desired on IOS


#1

I am using NativeScript. I used a JSON metadata to build a form, the JSON File has few fields that have “ignore”:true; Now, I am using typescript and doing property.hidden = false; This makes the fields initially ignored appear on IOS platform. But the same is not reproduced on Android.

I am pasting my JSON, and XML, And typescript file here for review. Any help is appreciated.

Here’s a little part of my JSON object:

{
  "name": "city",
  "displayName": "City",
  "index": 3,
  "editor": "Picker",
  "valuesProvider": ["New York", "Washington", "Los Angeles", "Boston", "Bloomington"],
  "groupName":"Group2"

},
{
  "name": "street",
  "displayName": "Street Name",
  "ignore":true,
  "index": 4,
  "groupName":"Group2"
  
},
{
  "name": "streetNumber",
  "displayName": "Street Number",
  "ignore":true,
  "index": 5,
  "editor": "Number",
  "groupName":"Group2"
}

Here is my Typescript code behind file:

export function changeHidden(argvalue) {
var streetproperty = dataform.getPropertyByName(“street”);
var cityProperty = dataform.getPropertyByName(“city”);
var streetNumberProperty = dataform.getPropertyByName(“streetNumber”);

var j = cityProperty.value; 
var cityArray:String[] = ["Washington", "Boston"] 

    if (cityArray.indexOf(j)>-1){

        streetproperty.hidden = argvalue;
        streetNumberProperty.hidden = argvalue;

    }else{
        streetproperty.hidden = !argvalue;
        streetNumberProperty.hidden = !argvalue;
    }
    viewModel.PersonModel.bind;

}

Here my property.hidden works exactly as I want on IOS, but nothing appears on Android.

Here is my XML,

<Page.actionBar>
    <ActionBar title="Data-form" icon="" class="action-bar">
    </ActionBar>
</Page.actionBar>

<!-- >> dataform-metadata-xml -->
<df:RadDataForm id="idDataForm" source="{{ person }}" metadata="{{ metadata }}" />

Again, any help is appreciated.

Thank you!