Hi Skyline community,
I have a page in my App which contains a table component (Table 19). My page is opened from an URL containing a string feed with a specific DOM instance ID.
I would like to select by default the row from my table matching this ID.
I tried to use the "On page load" event from the page, and add an action "Execute component action" and "select an item" for my table (see screenshot attached).
But I did not find in doc how to choose the selected row. Can you help please?
Thanks
Kévin
Thanks guys!
To summarize with concrete examples using Wout's response.
USE CASE 1 :
In my Low Code App page, the "component id" from my table is 18.
The table is populated from query "get object manager instances". I only select 2 fields --> 2 columns (ID and Name).
I want my page to be opened from another app, and a row to be selected from a known DOM instance ID. I am going to add data in URL query.
Open the page in Chrome, and click on "Developer Tools" menu. Open the "Network" tab and refresh the page.
You can use a filter "OpenQuerySession", and select the query matching the table and open "Preview" tab.
In my case, I found values for my 2 columns:
"ID"
- column ID is : 4405e9d3-63c4-4d60-b2f8-6b4caab149de_ID
- name is : ID
- clientType is : string
"Name"
- column ID is : 4405e9d3-63c4-4d60-b2f8-6b4caab149de_Name
- name is : Name
- clientType is : string
Now I can construct the data for my URL query (see previous response)
data={"components":[{"cid":18,"select":{"query rows":["v:1\u001F4405e9d3-63c4-4d60-b2f8-6b4caab149de_ID\u000EID\u000Estring\u001F4405e9d3-63c4-4d60-b2f8-6b4caab149de_Name\u000EName\u000Estring\u001E\u001E487ee78fd6bf498e83b99c085e346348"]}}]}
after encoding
data=%7B"components":%5B%7B"cid":18,"select":%7B"query%20rows":%5B"v:1%5Cu001F4405e9d3-63c4-4d60-b2f8-6b4caab149de_ID%5Cu000EID%5Cu000Estring%5Cu001F4405e9d3-63c4-4d60-b2f8-6b4caab149de_Name%5Cu000EName%5Cu000Estring%5Cu001E%5Cu001E487ee78fd6bf498e83b99c085e346348"%5D%7D%7D%5D%7D
NOTE 1 : YOU MUST INCLUDE ALL THE COLUMNS OF THE QUERY (even when the table itself is filtered to show only a few of them).
NOTE 2 : YOU MUST REMOVE DASH CHARACTERS FROM OF THE DOM ID you want to use as KEY (487ee78f-d6bf-498e-83b9-9c085e346348 --> 487ee78fd6bf498e83b99c085e346348)
With the new URL https://...?data=%7B%22components...
The row is now selected by default! 🙂
USE CASE 2 :
In this second use case, i changed my query to filter rows using a join with adhoc source.
Doing that, I noticed that the row was no longer selected, even though I hadn't changed the columns.
The issue was due to the key that i use in the data. This key has changed after join operation.
To solve it:
Open the page in Chrome, and click on "Developer Tools" menu. Open the "Network" tab and refresh the page.
You can use a filter "GetNextQuerySessionPage", and select the query matching the table and open "Preview" tab.
As you can see, the keys have changed:
The key is now the dom instance ID (without dash character) + suffix "/row-index"
Key: "487ee78fd6bf498e83b99c085e346348/1"
After changing the key in the query data, it fixed the issue.
data=%7B"components":%5B%7B"cid":18,"select":%7B"query%20rows":%5B"v:1%5Cu001F4405e9d3-63c4-4d60-b2f8-6b4caab149de_ID%5Cu000EID%5Cu000Estring%5Cu001F4405e9d3-63c4-4d60-b2f8-6b4caab149de_Name%5Cu000EName%5Cu000Estring%5Cu001E%5Cu001E487ee78fd6bf498e83b99c085e346348/1"%5D%7D%7D%5D%7D
It worked, but it's difficult to know the row index in advance.