C cwt Active Member Licensed User Longtime User Dec 31, 2020 #1 I need to preset the value of a B4XSwitch in B4i - I can get the value after it has been changed but cannot find anywhere on how to preset the value when the page displays - using B4XPages.
I need to preset the value of a B4XSwitch in B4i - I can get the value after it has been changed but cannot find anywhere on how to preset the value when the page displays - using B4XPages.
roumei Active Member Licensed User Jan 1, 2021 #2 What's wrong with B4XSwitch1.Value = True/False ? Upvote 0
C cwt Active Member Licensed User Longtime User Jan 1, 2021 #3 I get a runtime error - it appears I am not initializing the B4XSwith view properly. Below is the runtime error: Unexpected event (missing RaisesSynchronousEvents): tabstrip1_pageselected: Error occurred on line: 134 (B4XSwitch) Object was not initialized (NSObject) Below is my code to initialize the switch: MySwitch.Initialize(B4XPages.GetNativeParent(Me),"BillingSameAs") The switch view is on a CustomListView that is added to a TabStrip Upvote 0
I get a runtime error - it appears I am not initializing the B4XSwith view properly. Below is the runtime error: Unexpected event (missing RaisesSynchronousEvents): tabstrip1_pageselected: Error occurred on line: 134 (B4XSwitch) Object was not initialized (NSObject) Below is my code to initialize the switch: MySwitch.Initialize(B4XPages.GetNativeParent(Me),"BillingSameAs") The switch view is on a CustomListView that is added to a TabStrip
C cwt Active Member Licensed User Longtime User Jan 1, 2021 #4 roumei said: What's wrong with B4XSwitch1.Value = True/False ? Click to expand... My mistake and my apologies - I had the view name in the layout different than the name for the data declaration. Your code works fine and now mine does too. Last edited: Jan 1, 2021 Upvote 0
roumei said: What's wrong with B4XSwitch1.Value = True/False ? Click to expand... My mistake and my apologies - I had the view name in the layout different than the name for the data declaration. Your code works fine and now mine does too.