how to make text Editable.

0
Hello guys.   how can I Make text Editable when i click a button. I have no idea how to triger in microflow. can anybody help?
asked
3 answers
2

Hi Ablikim Abdulkarim,

 

You cant access the UI elements’ property in a microflow to make it editable. But you can specify editability condition on the element itself on the page.

Mendix provides three options regarding the editability.

  1. Show always 
  2. Based on attribute – You can use this option to allow editing based on attribute’s value (only incase of enumerations).

 

 

  1. Based on expression – You can use this option when you want to define your own condition of editability (You can use only the attributes of the datagrid’s entity to define the condition)

 

 

 

Update

Although, a microflow doesn’t allow accessing UI properties, you can still change the properties of UI elements on the go using a nanoflow which uses JavaScript (Client side Language).

 

Steps:

  1. Define a custom class (I used “Editablitytoggle”) to the textbox you want to be able to make uneditable on the go (using a button).

 

  1. Create a JavaScript action and write the JavaScript code below.

 

var d=document.getElementsByClassName("Editablitytoggle");
  d[0].getElementsByTagName("input")[0].setAttribute("readonly","readonly");

 

  1. Create a button below the textbox on the page and make it call a nanoflow. Add a JavaScript action activity in the nanoflow that calls the JavaScript action you just created

  

 

 

 

 

 

 

 

answered
8

Hi,

You can use visibility condition. Add two containers, in first one you can add non editable and in 2nd you can add editable fields. 

You can add one attribute to play with visibility condition. Just change the attribute value with the help of any button.

 

Hope this will help.

 

answered
1

Hi Ablikim Abdulkarim,

In the edit button, you have placed in your widget, when you double click there will be an Onclick section where you can select a microflow/nanoflow and make your boolean true or false .

 

 

Hope it helps

answered