hi,

i'm trying to evaluate the formspider, witch seems to be a very usefull tool for fast developments. now, i,ve created a data source ds, based on a simple table users (usrid,usrname,usrpasswd), usrid is treated as an auto incremented field (using trigger at insert time).

i've build a grid with datasource ds. i have 2 events, on dubleclick on a grid element,a new dialog is open, containing a panel with all the inforation reqarding that line. The elements on the new panel are also linked with the data source; after modification on some record information by pressing 'save' button i've see the modification in the grid, but doesn't commit into the database, even if a use api_application.doCommit; on the other hand , i have also on the grid a button for new record, when i open the same dialog, but empty, because firts i,ve create datasource new row; by saveing i've got an error, something like not new row in data source;

what am i doing wrong? witch is the best practice in this situation?

thanks, bsd

asked 16 Aug '11, 12:51

bsd's gravatar image

bsd
2614
accept rate: 33%

edited 16 Aug '11, 12:53


hi,

i was able to manage also the inserts; seems that i have to set insert trigger disable;

here is the sample of what i've done:

--create a new row if the for is open by the button

if api_application.getevent().objectname_tx = 'usersGridPanel.btnNew' then

  v_row_id:=api_datasource.createrow('dsusers1');
  api_datasource.setCurrentRow('dsusers1',v_row_id);

end if;

--on save

 v_row_id := api_datasource.getcurrentrowid('dsusers1');
 v_row := api_datasource.getcolumnvaluetx('dsusers1.USRID',v_row_id);
 if v_row is null then
    api_application.showpopupmessage('new Row');
    select users_seq.nextval into i_id from dual;
    api_datasource.setcolumnvalue('dsusers1.USRID',i_id,v_row_id);
 end if;   
 Api_Application.Docommit;
 api_application.showPopupMessage('Done'|| v_row);

-- on form close if the data is not save we have to clear the created row

if api_datasource.getcolumnvaluetx('dsusers1.USRID',api_datasource.getcurrentrowid('dsusers1')) is null then api_datasource.deleteCurrentRow('dsusers1');

end if;

regards, bsd

link

answered 21 Aug '11, 14:19

bsd's gravatar image

bsd
2614
accept rate: 33%

Hi BSD,

Could you please send us the export of the application and the PL/SQL code you wrote? You can export a Formspider application from the menu var at the top FIle->Export. Please email the export and the PL/SQL code to support (at) gerger.co . Thank you.

link

answered 18 Aug '11, 23:15

Yalim%20K.%20Gerger's gravatar image

Yalim K. Gerger ♦♦
1914
accept rate: 20%

Hi,
to commit changes on a Datasource, your Datasource Definition should have a primary key and also should have permissions for delete, update and insert. You can check these properties on Datasource Definition Dialog.

link

answered 18 Aug '11, 23:29

Ugur%20Kocak's gravatar image

Ugur Kocak ♦
5616
accept rate: 23%

edited 18 Aug '11, 23:30

hi,

it seems that i've forgotten to put the ds updatable; i will check also with the inserts;

thanks, bsd

link

answered 20 Aug '11, 05:21

bsd's gravatar image

bsd
2614
accept rate: 33%

edited 20 Aug '11, 05:22

Great. Let us know how it all worked out.

link

answered 21 Aug '11, 13:11

Yalim%20K.%20Gerger's gravatar image

Yalim K. Gerger ♦♦
1914
accept rate: 20%

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:

×7
×3

Asked: 16 Aug '11, 12:51

Seen: 2,428 times

Last updated: 21 Aug '11, 14:19


© Copyright Gerger 2017