Create Text Box without Entity

Hi, Can I create Text box without connect to any entity? and how to pass that value from that text box to microflow if I am not connect to any entity?
1 answers

Hi Felix


As far as I know, there is not really a way to have a textbox within your Mendix project without it being linked to an entity attribute. However, there is a quick workaround with a non persistable entity, which I will explain shortly:


  1. Create a non persistable entity within your domain model called (for example) PageHelper and give it an attribute of type string called Textfield. (the length of the string is dependent on your use case)
  2. On the page where you want to display the textbox, add a page parameter of the PageHelper entity by going to the page > properties > parameters. This is required so that the non persistable PageHelper can be passed to the page.
  3. When navigating to the page, you might need to revise your method, since the page now ‘expects’ an object of the helper entity. I suggest a microflow/nanoflow which looks like this (please note that in my case the helper is called ‘Filter’): 
  4. On your page, add a dataview with the entity linked being the page parameter we just created
  5. Within this dataview, create a text field, with as its attribute, the textfield attribute
  6. When you want to pass the value of the text you filled in to a microflow, you can do this in two ways:
    1. You can edit the on change/on leave activity of the text field, and add a microflow which has a parameter of the PageHelper entity
    2. Within the data view, you can add a button (or anything with an on click) to launch a similar microflow, which has a parameter of the PageHelper entity

Let me know if this was clear, and if you encounter more issues!