open new sub-stack with different record from database

mfstuart mfstuart at cox.net
Sat Jun 7 13:27:26 EDT 2008


Hi Jan,
Thanx Jan. I'll play around with that this weekend.

BTW:
1) I guess RunRev doesn't "natively" support MDI?
2) And in YOUR script after the 'set the name of it...', I should insert: go
to stack "EditAccount"?

Thanx,
Mark Stuart



Jan Schenkel wrote:
> 
> --- mfstuart <mfstuart at cox.net> wrote:
>> 
>> Hi all,
>> 
>> WINXP
>> Rev 2.9
>> MSSQL
>> 
>> How do I build an MDI interface where from a list of
>> records the user can
>> open multiple instances of a sub-stack with a
>> different record on each
>> sub-stack?
>> 
>> Current setup:
>> Main Stack - table list of records from a SQL
>> database.
>> Sub-stack - reads and displays the selected record.
>> 
>> [snip]
>> 
>> Problem:
>> If the user double clicks again on a different
>> record on the table list, the
>> currently opened sub-stack becomes focused with the
>> first opened record
>> displayed, not the second selected record.
>> I can't open more than one sub-stack at a time?
>> 
>> TIA,
>> Mark Stuart
>> 
> 
> Hi Mark,
> 
> You should look at the 'clone' command - keep a
> pristine template stack around, and clone that stack
> every time the user double-clicks the field - though
> you should probably move it into a utility handler so
> you don't have to copy the logic when you want to edit
> customer records from elsewhere in your application.
> 
> Also consider setting the 'destroyStack' property of
> the cloned stack - that way, when the stack is closed
> by script or by clicking the close button, the memory
> it takes up will be freed. And you may also want to
> set the label and name of the cloned stack at the same
> time.
> 
> So you would end up with something like this:
> ##
> global gAccountNumber
> 
> on mouseDoubleUp
>   set the itemDel to tab
>   put item 1 of the selectedText into gAccountNumber
>   if gAccountNumber <> "" then
>     clone stack "EditAccountTemplate"
>     set the destroyStack of it to true
>     set the label of it to "Edit Account" &&
> gAccountNumber
>     set the name of it to "EditAccount" &
> gAccountNumber
>   end if
> end mouseDoubleUp
> ##
> 
> Hope this helped,
> 
> Jan Schenkel.
> 
> Quartam Reports & PDF Library for Revolution
> <http://www.quartam.com>
> 
> =====
> "As we grow older, we grow both wiser and more foolish at the same time." 
> (La Rochefoucauld)
> 
> 
>       
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 

-- 
View this message in context: http://www.nabble.com/open-new-sub-stack-with-different-record-from-database-tp17703392p17711140.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list