Selecting object in mobile form

0
Hi, Mendix newbie here. Trying to do some mobile forms to show all expenses for a specific employee selected from a list. Have got a form that shows the list of employees, and a click action to show a form that lists all expenses, but that is ALL expenses, and not for a specific employee. Can't seem to select just a single employee and get their expenses. I'm obviously missing something very basic, as this does seem to be a simple task. Pointers please. Many thanks.
asked
3 answers
0

Assuming you've created a domain model with an Employee and an Expense entity with a 1 to many relatie between them:

If you click on an employee, you should open a new form with a data view containing the employee you've just selected.

This data view should contain a data grid. There are two ways to show only relevant expenses here:

  • When selecting the entity of the data grid, you can browse the relation from Employee to Expense and dubble click Expense (this is the easiest solution, but it's not always applicable)
  • When selecting the entity of the data grid, you can just select the Expense entity and add an XPath constraint, where you specify that only expenses of this emplyee are relevant. This would something like: [Employee_Expense = '[%CurrentObject%]' ]
answered
0

Thanks Rom. I can't seem to find a Data Grid for Mobile forms, only for Web forms. Is there an equivalent for Mobile?

answered
0

Sorry Guys, but I'm going round in circles here. Have tried as follows: In all cases I've started with a list view of employees, with a click action that either... 1 - shows a dataview of the (correct) selected employee, and a listview in the same form to show expenses; or 2 - shows a dataview of the (correct) selected employee, and has a Show Form widget that points to Expenses form; or 3 - the click action on the employee list goes direct to the Expenses form. In all cases, if the Expenses datasource has no xpath constraint, then all expenses for all employees are shown. If I include the constraint [xxxModule.ExpenseDetail_Employee='[%CurrentObject%]'], then no expenses are shown. This should be so simple (and i'm sure it is) but its just not falling into place!! Note - this is for MOBILE forms, not WEB. Thanks

answered