Passing Table data from a view into another view

I have a view called InventoryDynamicView which has 3 embedded views in it.
image

I have a table in the Inventory view.

I want to be able to select a Row and click the Edit button which will switch the View to the EditInventoryView.

I want the EditInventoryView to grab data that I have selected in the Table in InventoryView and pass it to the text/numeric fields in the EditInventoryView.

What would be a good way to accomplish this?

If every part number is unique, in theory you only need to pass the part number and get the the rest of the info on the new page from the database.

So on your edit button, have a mouse event..

param1 = self.getSibling("Table").custom.Selected
system.perspective.navigate(view = 'YOURNEWPAGE', params = {'id' : param1})

On the view your navigating to, you need to have parameters set to recieve that data.

image

Note that I call it id, you may call it part number but either way the names have to match what's in your query to what's defined on the view.

Once you have the partnumber in the view you can do SQL to get the other values

I must be missing something because I can see I grabbed the PartNumber, but do not see the value update in the EditInventoryView.

I missread where you had the embedded views on the same page.

On your table view, not the embedded one but the actual view that you made that page you need a ouptut parameter.
image
This value binds to where you get your part number from in the table.

One your view with the embedded views you will now see this value…

image

Then on your edit view, again not the embedded one but the real one where you created that page you need a input parameter… Yours would say PartNumberIn or what ever you call it.

image

Then on your embedded views you can bind the input parameter you get in the table embedded view with the output parameter in your edit embedded view.

In my example its id, yours would be PartNumberOut for example. so in the picture your binding PartNumberIn to PartNumberOut.

Clear as mud :grinning:

Your have 2 options, get all the values you need from the table and pass them all as parameters, or just get the part number and use that as a sql so get the rest

Select ItemCode
From MyTable
Where PartNumber = {PartNumberIn}

In not sure on the exact syntax on that but that could be a named query using partnumber as a parameter.

Im not exact on this one, would need to try it out but you could use the same named query for all the results… Someone with better knowledge could correct me on this…

Select {XXX}
From MyTable
Where Partnumber = {PartNumberIn}

I got that to work. Thank you! Now the fun part.

Let’s say I have a Breakpoint container because this will be used for Desktop and Mobile configurations.

Unfortunately, the layout is different between the two. Is there a way I can reference the same parameters from the two different views?

The idea of the breakpoint container is that one view will work on both devices. You wouldn't need two different views.

Let’s say the Desktop has the Search Bar on top and the Mobile has the Search Bar on bottom for functionality.

I would try to put the search bar at the top and the bottom and enable one or the other based on the device type. (You'll have to study to see if there's a property you can hook this into.)

You can enable / disable things based on which view size is being used…

{view.params.size} != "small"

I have found a solution. Thank you everyone!