Hi,

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)

Thanks, Michiel

asked 09 Jan '13, 06:00

Michiel%20A's gravatar image

Michiel A
5161543
accept rate: 13%

edited 09 Jan '13, 06:01


Hi Michiel,

Currently, there is no way to achieve your request. We will discuss about it internally. I will get back to you next week.

Regards, Ibrahim

link

answered 09 Jan '13, 07:43

Ibrahim%20Sandalli's gravatar image

Ibrahim Sand... ♦♦
1.5k5
accept rate: 25%

Hi, You can use a query like the following and get the first record: cursor c1 is select d.name_tx from formspider.t_bdf_panel p, formspider.t_bdf_paneldtl d where p.bdf_application_oid = [application ID] and p.name_tx = '[Panel Name]' and d.bdf_panel_oid = p.bdf_panel_oid and d.name_tx is not null order by bdf_paneldtl_oid; fComp varchar2(100); begin open c1; fetch c1 into fComp; close c1; api_component.request_focus([Panem Name] || '.' || fComp); end;

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)

Akis

link

answered 09 Jan '13, 08:54

Vlisidis%20Akis's gravatar image

Vlisidis Akis
163119
accept rate: 5%

Hi Akis,

Thanks for your answer. Indeed I was looking in that direction also. I am experimenting with a similar query now. There is an initorder_nr attribute in t_bdf_paneldtl which seems to be equal to the display order. Also we got enabled_yn and display_yn to get the rest of the properties..

See the next answer, as the query does not fit into the comment..

Thanks again, Michiel

(09 Jan '13, 10:33) Michiel A

Hi,

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..

select d.name_tx
from formspider.t_bdf_panel    p,
     formspider.t_bdf_paneldtl d
where  p.bdf_application_oid = <application oid>
and    p.name_tx = '<panel name>'
and    d.bdf_panel_oid =  p.bdf_panel_oid
and    d.name_tx is not null
and    d.componenttype_cd is not null
and    d.componenttype_cd <> 'Grid'
and    decode(d.enabled_yn, null, 'Y', d.enabled_yn) = 'Y' 
and    decode(d.display_yn, null, 'Y', d.display_yn) = 'Y'
order by d.initorder_nr;

Thanks,
Michiel

link

answered 09 Jan '13, 10:39

Michiel%20A's gravatar image

Michiel A
5161543
accept rate: 13%

edited 09 Jan '13, 10:40

Hi Michiel,

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:

  • We may need to consider components in inner Panels if inner Panels exist.
  • Finding the first component is more complicated then the order of components in XML. There are different ways to find first component for each layout (TableLayout,BorderLayout and XYLayouts).

Are you OK with those terms?

link

answered 09 Jan '13, 11:20

Samet%20Basaran's gravatar image

Samet Basaran
1372
accept rate: 24%

Hi Samet,

Thanks a lot for your comments. - Indeed we need to look at the runtime instance tables, so i will adjust the query for that.

  • I can work around the inner panel issue, by means of a naming convention for the filter panel

  • As for the layout, most of the panels i want to filter currently all have table layout. When using borderlayout, and just includes panels you can work around that.

So, al things considered, i think i can live with these conditions, although it would be nice to have something like api_panel.getFirstNavigableComponent

Thanks,
Michiel

(10 Jan '13, 02:42) Michiel A
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×36
×1

Asked: 09 Jan '13, 06:00

Seen: 1,390 times

Last updated: 10 Jan '13, 02:42


© Copyright Gerger 2017