Button on form opening other form with inherited values?

View: New views
2 Messages — Rating Filter:   Alert me  

Button on form opening other form with inherited values?

by magnusl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I am very new to Rekall so this might be a dumb question or missing
something obvious. I am working on a database for managing soical
science research material, and have a design issue that I am very
uncertain about, and would like just to check if it is possible at all.
My issue:

I have one form, operating on a table for sound files, where I record
details about sound files (date, setting, context etc). From this form,
I would like to have a button opening another form, for Memos, where the
Id for the current file (that is, the primary key from the files table)
is inherited, so I can create a memo connected to the file I was
curently working with. I would like the value ID_file to be stored in
the column  "file" in the memo table. So I would like three things to
happen when clicking the button:

1. New form opened (memo form, operating on memo table)
2. New entry/line inserted
3. Value of column "file" inherited from the files-form.

Is there a way to do this?


Magnus Larsson
_______________________________________________
Rekall mailing list
Rekall@...
http://www.mailman.a-i-s.co.uk/cgi-bin/mailman/listinfo/rekall

Re: Button on form opening other form with inherited values?

by Julian-27 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 12 Dec 2007, Magnus Larsson wrote:
> Hi!
>
> I am very new to Rekall so this might be a dumb question or missing
> something obvious. I am working on a database for managing soical
> science research material, and have a design issue that I am very
> uncertain about, and would like just to check if it is possible at all.
> My issue:

Hi,
Don't worry you can create very sophisticated applications.

> I have one form, operating on a table for sound files, where I record
> details about sound files (date, setting, context etc). From this form,
> I would like to have a button opening another form, for Memos, where the
> Id for the current file (that is, the primary key from the files table)
> is inherited, so I can create a memo connected to the file I was
> curently working with. I would like the value ID_file to be stored in
> the column  "file" in the memo table. So I would like three things to
> happen when clicking the button:
>
> 1. New form opened (memo form, operating on memo table)
> 2. New entry/line inserted
> 3. Value of column "file" inherited from the files-form.
>
> Is there a way to do this?

Theres more than one way to do anything with rekall.
Usually we attach a form.openForm("formname",{},link) to a button onclick
event.
Have a look at the /Paste Components/Execute/OpenLinkedForm.
The Function for this is

def eventFunc (button) :
    block = button.getBlock()
    link  = button.getNamedCtrl('../link_value').getValue(block.getQueryRow())
    button.getForm().openForm(button.getConfig('form_name'), {}, link)

With the parent/child linking, rekall knows about this relationship, and
inserts the parent value automatically for you, so if you cancel the form
nothing gets inserted.
This is a good place to get started for what you want to do.
I recommend that you also have a good read of the rekallManual, its fairly
extensive.
Regards,
Jules.
> Magnus Larsson
> _______________________________________________
> Rekall mailing list
> Rekall@...
> http://www.mailman.a-i-s.co.uk/cgi-bin/mailman/listinfo/rekall

_______________________________________________
Rekall mailing list
Rekall@...
http://www.mailman.a-i-s.co.uk/cgi-bin/mailman/listinfo/rekall
LightInTheBox - Buy quality products at wholesale price