> On Thu, Dec 27, 2012 at 3:50 PM, Art Heimsoth
> <artst...@artheimsoth.com> wrote:
>
>> I am trying to use a Data Class to pass data between a mother and
>> child dialog, where the ::attribute contains a stem variable. I
>> have not found how to do this, but if I put a non-stem
>> variable in the statements, it seems to work - so I think I have
>> the dialogs, methods, class and attribute statements correct.
>>
>
> It will work, although if you are having problems using a stem
> variable, I would consider using some other type of object than a
> stem.  Use a Directory object in place of a stem.
>
> But, if you are determined to use a stem you probably need to do
> something like this:
>
> ::class Parent class
>
> ::method dataPassingMethod
>
> data.value1 = 14
> data.value2 = 'Tom'
>
> obj = .MyClass~new(...)
> obj~data = data.
>
> ::class MyClass
>
> ::attribute data
>
> ::method someMethod
>
The below statements cleared it up for me.  I had the statements
setup incorrectly.

> stm. = self~data
> say 'Name is:' stm.value2
> say 'Number is:' stm.value1
>
Thanks much, that is now working for me.

>
>> A second part of this is, can I somehow use methods that are
>> located in the mother dialog, from the child dialog?
>>
>
> If they are public methods you can.
>
>> I would
>> like to keep from replicating several of the common methods that
>> are already in use in the mother dialog, from having to duplicate
>> the code in the children dialogs.
>>
>
> Using a variation of my above code:
>
> ::class Parent class
>
> ::method printSecret
> expose secret
>
> say secret
>
> ::method dataPassingMethod
>
> data. = <set up your data in the stem>
>
> obj = .MyClass~new(...)
> obj~data = data.
> obj~parent = self
>
> ::class MyClass
>
> ::attribute data
> ::attribute  parent
>
> ::method someMethod
>
> stm. = self~data
> self~parent~printSecret
>

Okay, this also appears to be working except for when I attempt to
execute a method from the OK method in the child.  I am using
SQL in the child InitCode method okay, and a log method in the
setup of the data, where the log method is in the mother and the
execution of it is in the child method (someMethod) in your example.
Those both work okay.  When I attempt to execute the same log
method from the OK in the child, the dialog seems to not respond
anymore until I "X" out of the child dialog.  Using Say statements
I have verified the log method is NOT entered, but everything up
to the execution of the self~parent~log("message") is working.
Is there something special about the OK method in this case?

>> If so, are the
>> exposed variables in the mother dialogs then from the mother
>> variable pool or from the child's pool?  Does this make sense?
>>
>
> What you want to do makes sense.  If you have a reference to any
> object, you can invoke methods in that object as long as they are
> public.  If you make a reference to the parent dialog available to
> the child dialog, then the child can invoke any public method in
> the parent.
>
> The variable pool part of the question probably indicates a little
> confusion on your part.  The exposed variables in the parent dialog
> are only available in the parent, and the same thing in the child.
> But when you invoke a method in the parent, that method will be
> running in the context of the parent, so the method has access to
> its exposed variables.  It doesn't have access to any exposed
> methods in the child.
>
Thanks, yes, I did have a misunderstanding of how it was handled.
This clears it up for me.

> --
> Mark Miesfeld
>
> --------------------------------------------------------------------
> ---------- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web
> API and much more. Get web development skills now with LearnDevNow -
> 350+ hours of step-by-step video tutorials by Microsoft MVPs and
> experts. SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122812
> _______________________________________________ Oorexx-users
> mailing list Oorexx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-users


--
  Art Heimsoth - artst...@artheimsoth.com

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to