[Openroad-users] Accessing dynamically created fields

Chris Wallace chrisw at miswa.com.au
Mon Sep 3 10:28:28 EST 2007


James,

 

Attached is an example of how you can vary an Optionfield's options in a
tablefield, this could be modified to just as easily (base on a hidden
column value) display a different field type (ie. Checkbox, RadioButton)
etc. rather than an optionfield.

 

Regards

Chris Wallace
Management Information Systems (WA) Pty Ltd
Level 9, MIS House
231 Adelaide Terrace, PERTH  WA  6000
Ph: (08) 9221-9221  Fax: (08) 9221-9224
Email: chrisw at miswa.com.au
Web: http://www.miswa.com.au

Disclaimer <http://www.miswa.com.audisclaimer/> :  Management
Information Systems (MIS)
This e-mail is private and confidential. If you are not the intended
recipient, please advise us by return e-mail immediately, and delete the
e-mail and any attachments without using or disclosing the contents in
any way. The views expressed in this e-mail are those of the author, and
do not represent those of MIS unless this is clearly indicated.  You
should scan this e-mail and any attachments for viruses.  MIS accepts no
liability for any direct or indirect damage or loss resulting from the
use of any attachments to this e-mail.

________________________________

From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of James Higson
Sent: Monday, 3 September 2007 07:48
To: 'International OpenROAD Users'
Subject: Re: [Openroad-users] Accessing dynamically created fields

 

Hi Chris,

 

I need to display different fields in each row of the "tablefield".  The
table is a set of questions where each question can have a ReadioField
answer, or an OptionField answer, or an EntryField answer.  If I use a
TableField, making two of these fields invisible affects all the rows;
not to mention the need to show a different set of items in each
OptionField.

 

________________________________

From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Chris
Wallace
Sent: Monday, 3 September 2007 09:34
To: James.Higson at gui-tek.com.au; International OpenROAD Users
Subject: Re: [Openroad-users] Accessing dynamically created fields

James,

 

Can we take a step back.  Why are you mimicking a Tablefield?  The
problem you currently have with the work-around you are trying, but
what's the problem with Tablefields that has caused you to try this
work-around?

 

Regards

Chris Wallace
Management Information Systems (WA) Pty Ltd
Level 9, MIS House
231 Adelaide Terrace, PERTH  WA  6000
Ph: (08) 9221-9221  Fax: (08) 9221-9224
Email: chrisw at miswa.com.au
Web: http://www.miswa.com.au

Disclaimer <http://www.miswa.com.audisclaimer/> :  Management
Information Systems (MIS)
This e-mail is private and confidential. If you are not the intended
recipient, please advise us by return e-mail immediately, and delete the
e-mail and any attachments without using or disclosing the contents in
any way. The views expressed in this e-mail are those of the author, and
do not represent those of MIS unless this is clearly indicated.  You
should scan this e-mail and any attachments for viruses.  MIS accepts no
liability for any direct or indirect damage or loss resulting from the
use of any attachments to this e-mail.

________________________________

From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of James Higson
Sent: Monday, 3 September 2007 06:52
To: 'International OpenROAD Users'
Subject: [Openroad-users] Accessing dynamically created fields

 

Hi all,

 

I am using OR4.1SP3.

 

I have a StackField object which has a datatype of a userclass.  I have
then created several instances of this StackField and grouped them into
a second StackField then grouped this into a ViewPort.  In effect, I
have mimmicked a TableField.  I am then dynamically appending instances
of the first StackField to the second StackField by duplicating the
first instance at runtime.  I hope you are following me so far.  The
instances are then named r001, r002, ... r00n.

 

I can reference the instances by using either:

    FieldPtr =
CurFrame.TopForm.FieldByFullName(FullName='r'+RIGHT('000'+VARCHAR(i),3))
), or;

    ExprPtr =
CurFrame.Scope.CreateDynExpr(String='r'+RIGHT('000'+VARCHAR(i),3))).

 

The problem I have, is that CreateDynExpr only works for the instances
of the StackField that were statically created on the form.  The
dynamically created instances return a NULL reference.  FieldByFullName
works for the dynamically created instances.  I want to set the
instances to a row in an array by using:

    ExprPtr =
CurFrame.Scope.CreateDynExpr(String='r'+RIGHT('000'+VARCHAR(i),3)));

    ExprPtr.SetValue(Value = a[i]);

 

I would have thought that CreateDynExpr should work for dynamically
created instances as well.  Can anyone see another way to do this?

 

Thanks,

James

Melbourne, Australia

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20070903/e969f6f4/attachment.html 
-------------- next part --------------
An embedded message was scrubbed...
From: "Chris Wallace" <chrisw at miswa.com.au>
Subject: FW: [Openroad-users] problem with optionfields in a tablefield
Date: Wed, 22 Aug 2007 09:45:05 +0800
Size: 30823
Url: http://www.peerlessit.com/pipermail/openroad-users/attachments/20070903/e969f6f4/attachment.mht 


More information about the Openroad-users mailing list