The reason for creating a seperate class is because of the different
usage for the objects (read: object responsability). So now I have a
myNewClass that can be run by itself, or it can be started through a
dialog (that builds an instance of the class). I think it is best
practise to keep the implementation in line with the genral OO spirit.
I have looked over the tutorial form but it can't provide me the
knowledge I need...
I also know that the args can be used to pas 1 variable, or a couple
of variables (when passed from a 'normal' form) or when given a class
object. (what is the idee behind this sollution???)

But that's not the question.

What I meant to ask is: [answer yes or no] Is it according best
practise to alter the main method so that it takes a different
parameter: instead of the default Args, it could be some xString and
a xDate variable.


Another thing that comes to mind is the (no) way axapta allows the
programmer to reassign methods, or override them at runtime. The idee
is to invoke the "dialogSelectCtrl"-method only when a specic
formcontrol is selected.
For example:
- Create a dialog at runtime
- add a combobox field
- add a radiobuttonfield

Now there is a method 'enter' which applies to both the radiobutton
as well as the combobox. But I can't get a handle of this method.
Try this:
//declare
FormBuildRadioControl r;
//use it
r = radiobuttonfield.fieldControl();
//now try and determine if this control has got the focus
//if r.gotfocus -> does not work
//if r.enter -> is not reachable

Thanks for you input so far, I hope you can help me a bit more;-)

/b









--- In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote:
> Hi Byteway,


> Why do you want to use a separate class to display a dialog?
Perhaps you should consider to inherite your class from RunBase or
RunBaseBatch and use the dialog method instead. Have a look at the
nice called tutorial Tutorial_RunbaseBatch.

> You can parse an object with args like this:

> Args args = new Args();
> MyClass class = new Class();
> MyNewClass newClass;

> args.parmObject(class);
> newClass = MyNewClass::main(args);

> Args also enables you to parse e.g. strings and enums, like this:

>     args = new args();
>     args.parmEnumType(enumnum(NoYes));
>     args.parmEnum(NoYes::Yes);
>     args.parm("Test");
>
> //Lars



>
>  -----Original Message-----
> From: byteway_so [mailto:[EMAIL PROTECTED]
> Sent: 26. juli 2004 13:44
> To: [EMAIL PROTECTED]
> Subject: [development-axapta] Re: Passing Args
>
>
>
> But what do you do when you want to solve it using the Axapta best
> practise? In this case I have a dialog that runs a NewMyClass().
>
> In the main-method of the dialog I would have something like:
> //...
> Args myArgs;
> MyNewClass myNewClass;
> ;
>
>   if(dlg.prompt())
>   {
>     dlg.run();
>
>     //I need something to pass the values
>     myArgs = new Args("aFileName", "date", "amount");//->does not
> compile
>
>     //Then I would like to create an instance of MyNewClass using
>     myNewClass = MyNewClass::main(myArgs);
>
> }
>
> So the initial question asked before is still valid.
> How to solve this (design) problem?
> That is: how to pass variables from a dialog to a (new) class
object?
>
> * Should I create a newMyClass with a main method that contains a
> container instead of the Args object? Or is there a better (best
> practise) way?
>
> like:
>
> static void main(container _container)
> {
>   //...
> }
>
>
>
>
>
> Yahoo! Groups Sponsor     
>
> ADVERTISEMENT

<http://us.ard.yahoo.com/SIG=129uqajp5/M=295196.4901138.6071305.300117
6/D=groups/S=1705006764:HM/EXP=1090931858/A=2128215/R=0/SIG=10se96mf6/
*http://companion.yahoo.com> click here     
>   <http://us.adserver.yahoo.com/l?
M=295196.4901138.6071305.3001176/D=groups/S=:HM/A=2128215/rand=2705234
72>      
>
>
>   _____ 
>
> Yahoo! Groups Links
>
>
> *      To visit your group on the web, go to:
> http://groups.yahoo.com/group/development-axapta/
<http://groups.yahoo.com/group/development-axapta/>
>  
>
> *      To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED] <mailto:development-
[EMAIL PROTECTED]>
>  
>
> *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
>
>
>
>
> [Non-text portions of this message have been removed]


Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to