[Openroad-users] FW: problem with optionfields in a tablefield

Bodo Bergmann Bodo.Bergmann at ingres.com
Wed Aug 22 19:11:09 EST 2007


Below is an example that does not require nested tablefields.
I just replaced the optionfield field2 by a landable entryfield (with the same name)
and created an additional optionfield field2opt on the form, which is used as a floating optionfield,
which is filled with the correct valuelist and placed over the according entryfield when it gets the input focus.
 
Hope this helps,
Bodo.
 
// BEGIN OF CODE
initialize()=
declare
    opt = OptionField DEFAULT NULL;
    cha = ARRAY OF ChoiceItem DEFAULT NULL;
    i = INTEGER NOT NULL;
    opt2 = OptionField DEFAULT NULL;
    cha2 = ARRAY OF ChoiceItem DEFAULT NULL;
    row = INTEGER NOT NULL;
    sf = StackField DEFAULT NULL;
    ef = EntryField DEFAULT NULL;
    x = INTEGER NOT NULL;
    y = INTEGER NOT NULL;
    h = INTEGER NOT NULL;
enddeclare
{
    
    sf = StackField(FIELD(field3[*].column1).ProtoField);
    opt = OptionField(sf.FieldByName(name='field1'));
    ef = EntryField(sf.FieldByName(name='field2'));
 
    // field2opt is the name of the floating optionfield
    opt2 = FIELD(field2opt);
 
    opt.ExactWidth = 3000;
    ef.ExactWidth = 2500;
    opt2.ExactWidth = 2500;
    opt.FocusBehavior = FT_TABTO;
    opt2.FocusBehavior = FT_TABTO;
 
    opt2.AllBias = FB_INVISIBLE;
    // Make sure optionfield floats over entryfield
    opt2.LayerSequence = ef.LayerSequence + 1;
 
    CurFrame.Flush();
 
    x = ef.AbsXLeft;
    y = ef.AbsYTop;
    h = ef.OuterHeight;
 
    // Load ValueList for field1
    cha = opt.ValueList.ChoiceItems;
    cha.Clear();
    cha[1].EnumText = '';
    i=2;
    SELECT trim(table_name) + ' ('+ trim(table_owner) +')' AS :cha[i].EnumText
    FROM iitables
    WHERE table_type = 'T'
    ORDER BY 1
    {
        i=i+1;
    };
    COMMIT;
    opt.UpdChoiceList();
 
    cha2 = opt2.ValueList.ChoiceItems;
}
 
ON SETVALUE field3[*].column1.field1 =
{
    field3[].column1.field2 = '';
}
 

ON ENTRY field3[*].column1.field2 =
DECLARE
ENDDECLARE
{
    row = FIELD(field3).WhichRow(cellfield = CurFrame.TriggerField);
 
    IF field3[row].column1.field1 = ''
    THEN
        field3[row].column1.field2 = '';
        RESUME;
    ENDIF;
 
    // Load Values for floating optionfield
    cha2.Clear();
 
    i=1;
    SELECT column_name AS :cha2[i].EnumText
    FROM iicolumns
    WHERE trim(table_name) + ' ('+ trim(table_owner) +')' = :field3[row].column1.field1
    ORDER BY 1
    {
        i=i+1;
    };
    COMMIT;
    opt2.UpdChoiceList();
 
    // Make sure to set the current value into floating optionfield
    IF cha2.Find(attributename='enumtext',
        value=field3[row].column1.field2,
        rownumber=BYREF(i))=ER_OK
    THEN
        field2opt = field3[row].column1.field2;
    ELSE
        // Take the first value from the choicelist
        field3[row].column1.field2 = cha2[1].EnumText;
    ENDIF;
    opt2.CurBias = FB_CHANGEABLE;
    opt2.AbsYTop = y+(row-FIELD(field3).TopRow)*h;
    opt2.AbsXLeft = x;
    CurFrame.InputFocusField = opt2;
}
 
ON EXIT field2opt, ON SCROLL field3 =
{
    IF opt2.CurBias = FB_CHANGEABLE
    THEN
        field3[row].column1.field2 = field2opt;
        opt2.CurBias = FB_INVISIBLE;
    ENDIF;
}
// END OF CODE
 
 
Bodo Bergmann
Senior Software Engineer
OpenROAD Worldwide Development
Ingres Corp.
 

________________________________

From: openroad-users-bounces at peerlessit.com [mailto:openroad-users-bounces at peerlessit.com] On Behalf Of hans.weisenberger at mmm.com
Sent: Wednesday, August 22, 2007 8:30 AM
To: International OpenROAD Users
Subject: Re: [Openroad-users] FW: problem with optionfields in a tablefield


3M Deutschland GmbH
Sitz: 41453 Neuss * Handelsregister: B 1878 Amtsgericht Neuss 
Geschäftsführer: Jürgen Jaworski * Josef Mrozek * Theo Nöcker * Kurt-Henning Wiethoff * Managing Director: Kurt-Henning Wiethoff * Vorsitzender des Aufsichtsrates: Reinhold Hiersemann 

________________________________


Chris,

as Bodo mentionend the problem is, that all optionfield in a row has the same list. So I think your example does the trick!

Thanks for your help. I will implememt that what you did in the example.

Thanks to all for the hints.

Greetings Hans



"Chris Wallace" <chrisw at miswa.com.au> 
Sent by: openroad-users-bounces at peerlessit.com 

22.08.2007 03:39 
Please respond to
International OpenROAD Users <openroad-users at peerlessit.com>


To
"International OpenROAD Users" <openroad-users at peerlessit.com> 
cc
Subject
[Openroad-users] FW:  problem with optionfields in a tablefield

	




Hans,
 
I was unable to find the examples I'd mentioned, but knocked up the attached example of the second option, which I believe is the only on that would work effectively given that you wish to vary the content of OptionField 2 depending on the selection of OptionField 1.
 
Attached is an OpenROAD 2006 frame export.
 
P.S. Thanks Phil - I never thought to check the size.
 
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 <mailto: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 hans.weisenberger at mmm.com
Sent: Tuesday, 21 August 2007 17:49
To: International OpenROAD Users
Subject: [Openroad-users] problem with optionfields in a tablefield
  

3M Deutschland GmbH
Sitz: 41453 Neuss * Handelsregister: B 1878 Amtsgericht Neuss 
Geschäftsführer: Jürgen Jaworski * Josef Mrozek * Theo Nöcker * Kurt-Henning Wiethoff * Managing Director: Kurt-Henning Wiethoff * Vorsitzender des Aufsichtsrates: Reinhold Hiersemann 

________________________________



Hi all,

I have the following problem in OR 4.1 on windows:

I have an tablefield (field3). In that tablefield there is one column (column1) with two optionfields (field1 and field2).

So when I click in the frameeditor I get: Optionfield 'field3[*].column1.field1' or Optionfield 'field3[*].column1.field1'

What I want is, depending on changing one optionfield, I want to change the other. 
But all tries to adress one of the optionfield leads to compilationerrors.

Does anyone have an idea how to solve that?

Thanks and greetings

Hans Weisenberger=[attachment "optionfield_test.zip" deleted by Consulting Weisenberger/GE-Europe/3M/US] ________________________________________________________________
OpenROAD-Users mailing list

You can maintain your subscription here:
http://www.peerlessit.com/mailman/listinfo/openroad-users

To unsubscribe click on this link
mailto:openroad-users-unsubscribe at peerlessit.com&subject=unsubscribe

To subscribe click on this link
mailto:openroad-users-subscribe at peerlessit.com&subject=subscribe 
=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20070822/048acf28/attachment.html 


More information about the Openroad-users mailing list