View a Page that shows and allows editing of one object

1
Hello, I am a new Mendix developer and am using a test app to learn.  What I am trying to do is have a page where I can have a list of products and then adjust the costs for each of them.  Those costs would be used on a separate page for other people to create an order.   I have created an entity called “ProductPrices” with attributes like “Product1Cost”, “Product2Cost”, etc.  I have tried using he Data View data container, and it populates the fields like I want.  However, I get errors saying the home page button that I use to navigate to this screen “expects an object of type ‘ProductPrices’, which is not available here.”  It also doesn’t automatically show the values I have typed in there before. I might be missing something easy, but I can’t seem to figure it out.
asked
2 answers
2

Hey carter,

 

Since you are using a data view, it expects an object of a type that you want to enter your data in. But for that you have to create an object in which you want to enter the data.

There's a step by step procedure for that.

First you have to add a button which creates an object and then after creating the object you need to go to a page where you can enter the data in the created object. This way it will not throw error.

 

What you can do is,

Add a page, on which there's a ' list view/data grid ' which is used to show the data that is saved in the database. And to add some new data in the database, you need to add a button(eg. Create object or add data) above the ' list view/ data grid'.

Now , set the button to create object. And on click, it should lead you to a page, where a data view is there, so either you can create a new page from the button or create a new page by yourself, both a totally fine if they have a data view, linked to the same entity, from which the list view page is calling it.

This way you can easily add and save data.

Let me know if you face any issues.

 

Hope it helps!

 

 

 

answered
0

Hi Carter,

 

I will suggest create an entity ProductList  , Add some attributes like product name , productprice , quantity etc Then right click on ProductList  entity and select generate overview pages , This will create a folder  Overview page which contains List of all the  Product ,and  a new and edit page .This way you will have an overview of all the products you can also add / edit new products .

 

Now add ProductListOverview page to Navigation . 

 

Hope this helps . You can also go through Learning path there is already a sample order management app .

 

 

answered