I'm looking for some help with a Mendix native-app running on Mendix 9.24.13. We are working on a native-app where we require the ability to disable a button on the app. I have reviewed the documentation found here https://docs.mendix.com/refguide9/mobile/designing-mobile-user-interfaces/widget-styling-guide/ and referred to the reactive native styling that the document refers to here https://reactnative.dev/docs/view-style-props. I've created a test app to try to figure this out. From the screenshot below, I've successfully been able to set the button to a "grey" background color, but the button can still be clicked. I created a blank native mobile app from https://marketplace.mendix.com/link/component/109511. I set the start up module as a UI resource as I want to replicate this on our actual app. I created a new JS called "NativeMobileBranding.js" and added the code snippet below. NativeMobileBranding.js is used in main.js with the following: export * from "./NativeMobileBranding"; // import { nominalTypeHack } from "prop-types"; import colors from "../../atlas_core/native/core/helpers/_functions/colorwords"; //Brand Style export const btnDisabled = { container: { backgroundColor: 'grey', onclick: 'disable', enabled: 'false' // pointerEvents: 'box-none', // disabled: 'true' // opacity: .5 // display: 'none' }, caption: { // TextStyle properties fontSize: 20 } } Based on the documentation, https://reactnative.dev/docs/button this snippet shows how I should disable a button. How to I convert this and apply it to the above Mendix JS? <View> <Text style={styles.title}> All interaction for the component are disabled. </Text> <Button title="Press me" disabled onPress={() => Alert.alert('Cannot press this one')} /> </View> Thank you in advance for your assistance.
asked
Joe Avelar
1 answers
0
Hi, in the nanoflow after your button you can set a decision if an attribute is true or false, a show message "cannot press this one" when the button is disabled , you can also set a dynamic class based on that attribute to set your btnDisabled class.
or you can also use a containers with onclick and set one without onclick and switch visibility if an attribute is true or false.