Home » Developer & Programmer » Forms » Opening a canvas/windows
Opening a canvas/windows [message #141458] Mon, 10 October 2005 06:26 Go to next message
orahugo
Messages: 32
Registered: October 2005
Location: England
Member
Hello,

I've got a canvas in which a user can edit general information about a customer. The client needs to double click on the field and a box should appear where they can edit the information. They then close this box and the field gets updated.

I've set up another window/canvas that I would like to appear as the box when the field is double clicked. I understand that you'd set a doubleclick trigger on the field to be edited, and that this needs to open up the box/canvas/window. What code would you write to open this?

I'm then going to put a "when opened" command on the new box so that current information is put into it, then they can edit it and pass the information back out, to the original field. Does anyone have any suggestions?

Many thanks.
Re: Opening a canvas/windows [message #141557 is a reply to message #141458] Mon, 10 October 2005 21:51 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Put a When-Mouse-Doubleclick on the main field. If you intend using this 'new' window for handling more than one field you need to store the current mouse item. Copy the existing data to the new field and do a go_item to the new item on the new canvas/window. Let the user insert/update their data and then press an 'OK' button which copies the new data to the old field and then does a go_item to that field. The code would look like this:
--When-Mouse-Doubleclick
:ctrl.edit_field := :tbl.item3;
go_item('ctrl.edit');

--When-Button-Pressed for Okay button
:tbl.item3 := :ctrl.edit_field;
go_item('tbl.item3');

--When-Button-Pressed for Cancel button
go_item('tbl.item3');

David
icon14.gif  Re: Opening a canvas/windows [message #141569 is a reply to message #141458] Tue, 11 October 2005 00:34 Go to previous messageGo to next message
ashishmate
Messages: 90
Registered: February 2005
Location: Mumbai
Member

if you just want to insert or update the field then you can use edit text item this will give you a notepad where user can insert or update text in your text item.

you just need to add one line in your when-mouse-doubleclik trigger i.e


edit_textitem;



correct me if i am wrong
ASHish...




Re: Opening a canvas/windows [message #141609 is a reply to message #141557] Tue, 11 October 2005 04:22 Go to previous messageGo to next message
orahugo
Messages: 32
Registered: October 2005
Location: England
Member
I ended up doing something similar to djmartin where I passed information out of canvas.field into another canvas.field, and then opened the new editing window. You edit the information in the window, then hit the close button and the information gets passed back, which is all fine.

When I then close down the form the prompt comes up to save before exiting. I do, but then it seems to open my editing window back up and I can't get out without closing it down without saving.

Any ideas?
Re: Opening a canvas/windows [message #141731 is a reply to message #141609] Tue, 11 October 2005 19:28 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please verify that the second 'canvas.field' (the one on the pop-up window) is defined as NOT being a database field.

David
Re: Opening a canvas/windows [message #141800 is a reply to message #141731] Wed, 12 October 2005 03:56 Go to previous message
orahugo
Messages: 32
Registered: October 2005
Location: England
Member
I just changed it and it worked fine. Thank you ever so much.
Previous Topic: alert messages
Next Topic: oracle froms 6i replecing menus
Goto Forum:
  


Current Time: Fri Sep 20 01:55:29 CDT 2024