Hi, I have a master-detail form ( a grid with checkboxex - master, and a list - detail ), so if i tick a chechbox a relevant info shows up in a list in a new dialog window. In this window i select row from the list and press OK button Here is an action:

procedure OKbuttonPress is
  v_selectionValue varchar2(400);
  begin
    v_selectionValue:=FORMSPIDER.api_component.getValueTX('subEventsDetailsPanel.eventList');
    FORMSPIDER.api_component.setValue('groupsOfEventsPanel.eventsInfoGrid',v_selectionValue);
    FORMSPIDER.api_dialog.setVisible('simpleDialog','N');
 end;
 END;

So i would like the chosen row to be shown in another grid on a master screen. But it doesn't work. It works only with TextField or TextLabel... And I've tried to add an insert into the OKbuttonPress procedure: "insert into org_event (id,name) values (5,v_selectionValue)"; This doesn't work too, so how should i do insert operations into db?

asked 22 Feb '14, 12:01

Smith's gravatar image

Smith
115
accept rate: 0%

edited 22 Feb '14, 12:02


Hi Smith,

You can use api_component.getselectedvalues(in_paneldotcomponentname_tx IN varchar2) API to achieve this. More info at this link: http://theformspider.com/API/api_component.html#getselectedvalues(varchar2)

By the way, you don't need to prefix every API with the schema name FORMSPIDER. The installation creates public synonyms. If you don't want to use public synonyms, go to Tools-->API Synoynms and Grants in the IDE and follow the instructions to create synonyms in your development schema for Formspider API's.

Hope this helps,

Kind Regards, Yalim

link

answered 22 Feb '14, 12:09

Yalim's gravatar image

Yalim ♦♦
2.8k5
accept rate: 21%

Hi,

procedure OKbuttonPress is
  v_selectionValue varchar2(400);
  begin
    v_selectionValue:=api_component.getselectedvalues('subEventsDetailsPanel.eventList');
    api_component.setValue('groupsOfEventsPanel.eventsInfoGrid',v_selectionValue);
    api_dialog.setVisible('simpleDialog','N');
 end;
 END;

I tried to use the method which you've mentioned, but it doesn't work and an error occurs ("expression is of wrong type").

link

answered 23 Feb '14, 13:17

Smith's gravatar image

Smith
115
accept rate: 0%

Hi Smith,

You should use api_component.setselectedvalues API to set the selected values.

Kind Regards,
Yalim

link

answered 23 Feb '14, 13:23

Yalim%20Gerger's gravatar image

Yalim Gerger ♦♦
1.8k5
accept rate: 15%

Now i got no compiling error but error occurs in application. Here is the name of it: Undefined API "setSelectedValues" for component type "Grid". Maybe i need to use another function for filling grid with selected row in a list? And one more question please. How can i make the insertion of data into database? I've tried smth like this:

procedure OKbuttonPress is
  v_selectionValue FORMSPIDER.api_component.tt_selectedvalues;
  begin
    v_selectionValue:=FORMSPIDER.api_component.getSelectedValues('subEventsDetailsPanel.eventList');
    FORMSPIDER.api_component.setSelectedValues('groupsOfEventsPanel.eventsInfoGrid',v_selectionValue);
    insert into ank.org_info(id,name) values (5,v_selectionValue);
    api_dialog.setVisible('simpleDialog','N');
 end;
 END;
link

answered 23 Feb '14, 15:01

Smith's gravatar image

Smith
115
accept rate: 0%

Hi Smith,

I apologize. I thought you are trying to get selected values from the List component. If you are trying to retrieve the selected rows from a Grid (with multi select enabled) please use api_component.getSelectedRowIDs. To set the the selected values in a Grid use api_component.setSelectedRowIDs

Not sure why we made two separate API's for Grid and List. In hindsight, it seems to me that there should be only one. However, this is the state of things as it stands.

Kind Regards,
Yalim

link

answered 24 Feb '14, 07:37

Yalim%20Gerger's gravatar image

Yalim Gerger ♦♦
1.8k5
accept rate: 15%

Hi Yalim, I've tried these methods but they doest'n suit to my situation. TO make it clear, i'm trying to get selected value from the List ( no multi selection enabled) and set it to the Grid and then insert these values (from the grid) to a DB

(28 Feb '14, 19:34) Smith

Hi Smith,

Sorry to hear this. I think there are several problems here:

It seems like you expect the Grid to perform insert operations. This means that the value you select from the list does not exist in the Grid's datasource. So you must create them first.

The list's get API returns a value but the grid's set API requires RowID's. So after you create a corresponding row in the Grid'ds datasource you need to find its RowId to set it as selected.

The insert to the DB should happen automatically when you use the api_application.doCommit API. Whether the commit will succeed depends on whether your datasource definition is updateable. i.e. whether it's based on a table or on an updateable view.

The use case you are trying to implement is quite common and it works in Formspider just fine. Did you see this demo? http://formspideronline.com/formspider/main.jsp?name=DemoMain#DemoShuttle

Kind Regards, Yalim

(01 Mar '14, 02:43) Yalim ♦♦
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:

×9
×6

Asked: 22 Feb '14, 12:01

Seen: 1,615 times

Last updated: 01 Mar '14, 02:43


© Copyright Gerger 2017