I have some standarized filter functionality for a panel/datasource in my application. After i have filtered the data, i want to set focus on the panel containing the filtered data.
Is there a way to find the first visible and enabled component on a panel, so that i can automatically set focus on that component after the filter action? (this could also be a grid column)
Currently, there is no way to achieve your request. We will discuss about it internally. I will get back to you next week.
answered 09 Jan '13, 07:43
Ibrahim Sand... ♦♦
You can use a query like the following and get the first record:
Two words of caution: 1) This code queries the formspider schema directly, and is based on the assumption that fhe IDE inserts the records in the order that the components appears in the XML. I have no idea how the IDE works internally.
2) All components (or at least the first one!!) must have the name attribute set. It is a good practice to name all components anyway.
For grid columns the query is most complex (selfjoin between t_bdf_paneldtl.bdf_paneldtl_oid and t_bdf_paneldtl.bdf_paneldtl_rfk)
answered 09 Jan '13, 08:54
I am testing with this query, which seems to do what i am looking for. Can you have a look at this cursor query and give some comments? Maybe i am missing something here..
Your query seems OK but here are some comments about it:
The "t_bdf_panel" and "t_bdf_paneldtl" tables are design time tables. The values could be updated on run-time by APIs so you cannot use them if you change visible or enable state of components on run-time. Instead of them you may use t_bdf_panelins and t_bdf_paneldtlins.
The "initorder_nr" attribute is not the order of components in panel. It is the order of components in XML that you write in IDE. You may write component to second cell but user may see it first in application. So you need to be sure that's OK for you.
If you use this line: "and d.name_tx is not null", you need to give "name" to all of your components in panel. At least the components which you want to set focus.
The "enabled_yn" and "display_yn" attributes are OK. You may also consider to add "editable_yn" to filter components which are not editable.
You filtered only "Grid" component in your query. You may also need to filter other components like "TextLabel", "Image", "Map", "Column" etc..
We said there is no way to achieve this above because:
Are you OK with those terms?
answered 09 Jan '13, 11:20