Is it possible to create a Form with an empty Domain model?

0
Is it possible to create a Form with an empty Domain model?  
asked
4 answers
1

You can create a form with only labels. These labels are static, so you are restricted to creating forms without dynamic data. Therefore, option 3 is probably the best answer.

 

The rest of this answer is not to be taken seriously.

Technically, you are unable to create a form with an empty domain model, since there is always the System module which you cannot delete, and the domain model of the System module has entities. Disregarding this for a moment, all answers are wrong: you can create a form with dynamic data while you have an empty domain model. I created a form with a container with class "quote". After that, I imported the HTML snippet widget from the AppStore. I placed the widget below the container. In the HTML snippet, I set the content type to JavaScript and added the following code:

 

    (function() {
      var quotes = [
        {
          text: "text1",
          img:  "http://i.stack.imgur.com/FqBE6.jpg?s=32&g=1"
        },
        {
          text: "text2",
          img:  "https://www.gravatar.com/avatar/ca3e484c121268e4c8302616b2395eb9?s=32&d=identicon&r=PG",
        }
      ];
      var quote = quotes[Math.floor(Math.random() * quotes.length)];
      document.getElementsByClassName("quote")[0].innerHTML =
        '<p>' + quote.text + '</p>' +
        '<img src="' + quote.img + '">';
    })();

Running this, you have dynamic data while having an empty domain model.

answered
0

It was a questions with 4 possible answers which I answered wrong:

Is it possible to create a Form with an empty Domain model?

  1. No, you need some definition of the domain model
  2. Yes, with a custom microflow that displays the values of an object
  3. Yes, though it cannot be used displaying dynamic data
  4. No, a form can only be generated from an entity
answered
0

I don't want to answer your quiz question for you, but I can give you some information.

 

The domain model is where you define your database. In the domain model you can create entities (entity is a table) and add attributes to these entities. When creating a form, you have to add a dataview to a page and set the data source to one of the entities from your domain model. Then you can use a number of different widgets to connect to the attributes of that particular entity. 

Now Ill let you decide if you can create a form with an empty domain model. 

answered
0

It's a bad quiz question. Yes, when your domain model is empty, you can create a form. Just try, no problemo. Of course, there is no data to select, so no dynamic data. So there is your answer: 3.

But the modeler will show an error: 'No entity configured as the data source of this dataview. Since your domain model is empty, you can not assign one. You are left with the option to remove the Dataview, but then your form is no longer a form, it is just a page.

answered