Hi.

I want to get data from a grid current row (right click mouse event) and send them to the appropriate controls of the dialog window. How to create popup menu and actions, I already know. I do not know how to populate dialog window controls from the current row data. Please, help me in the following task.

asked 17 Aug '12, 01:14

DPushkashu's gravatar image

DPushkashu
1629
accept rate: 25%


Hi Dmitry,

As an addition to Michiel's answer, before displaying your dialog, you should set the right clicked row of your grid component as the current row of your datasource using api_component.getrightclickedrowid and api_datasource.setcurrentrow APIs at rightClick event of your grid.

procedure gridRightClicked is
  v_rightClickedRow_id number;
begin
  v_rightClickedRow_id := api_component.getrightclickedrowid(your_panelDotGridComponent_name);
  api_datasource.setcurrentrow(your_datasource_name, v_rightClickedRow_id);
...
end;

Kind Regards, Ibrahim

link

answered 17 Aug '12, 02:09

Ibrahim%20Sandalli's gravatar image

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

Hi Dmitry,

Different approach can be to not create 3 different datasources, but create one datasource, one grid and one dialog and set the where clause of the datasource dynamically using api_datasource.setFilterWhereClause

If you can use this approuch depends a bit on your usecase though.

link

answered 17 Aug '12, 02:58

Michiel%20A's gravatar image

Michiel A
5161541
accept rate: 13%

This is the best approach, I think. Thanks.

(17 Aug '12, 04:01) DPushkashu

Hi,

This is how you do it: Create a dialog window and a panel with the necessary controls. When creating the controls, just link them to the same datasource as the grid, like for example:

<textField column="your_datasource_column_name" dataSource="your_datasource_name"/>

Formspider will then automatically show the current row data of the defined datasource.

best regards, Michiel

link

answered 17 Aug '12, 01:46

Michiel%20A's gravatar image

Michiel A
5161541
accept rate: 13%

Great, very simple ...

(17 Aug '12, 02:19) DPushkashu

The same question but in other form. I have 3 queries (so I defined 3 data-sets), the result of queries are equal (column set is the same) but different where conditions. I define three different grid, and I want to edit the data using a single dialog box. What can I do in this case? I do not want to duplicate the same dialog box 3 times.

link

answered 17 Aug '12, 02:19

DPushkashu's gravatar image

DPushkashu
1629
accept rate: 25%

Hi Dmitry,

To achieve this, create 3 separate panels based on each of your data-set and create a single dialog box. In your dialog XML, enter a cell name value for the dialog cell which will contain your panel. In the following example, "cell_center" is used as the cell name;

<dialog width="500" height="500">
  <borderLayout>
    <cell docking="Center" name="cell_center"/>
  </borderLayout>
</dialog>

Then, just before displaying your dialog box, place the appropriate panel in your dialog box using the api_dialog.addPanel API;

...
 api_dialog.addpanel(your_dialog_name, 'cell_center', panel_name_to_be_displayed);
 api_dialog.setVisible(your_dialog_name, 'Y'); 
...
link

answered 17 Aug '12, 02:51

Ibrahim%20Sandalli's gravatar image

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

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:

×85
×16
×8

Asked: 17 Aug '12, 01:14

Seen: 2,421 times

Last updated: 17 Aug '12, 04:01


© Copyright Gerger 2017