Menu

COMBO runtime error

Help
2011-12-12
2013-03-18
  • nenad cikic

    nenad cikic - 2011-12-12

    I have this window with template generated combo from a file.

    Queue:FileDropCombo  QUEUE                            !Queue declaration for browse/combo box using ?lBlagajna
    blag:opis              LIKE(blag:opis)                !List box control field - type derived from field
    blag:sifra             LIKE(blag:sifra)               !Primary key field - type derived from field
    Mark                   BYTE                           !Entry's marked status
    ViewPosition           STRING(1024)                   !Entry's view position
                         END
    FDCB2::View:FileDropCombo VIEW(blagajnicko_mjesto)
                           PROJECT(blag:opis)
                           PROJECT(blag:sifra)
                         END
    Window               WINDOW('Prijava'),AT(,,165,101),FONT('Tahoma',,,,CHARSET:EASTEUROPE),CENTER,IMM,SYSTEM,GRAY,DOUBLE
                           PROMPT('korisnik:'),AT(7,13,59,10),USE(?korisnik:Prompt)
                           ENTRY(@s20),AT(70,12,89,12),USE(korisnik),LEFT(2),MSG('korisnik'),TIP('korisnik')
                           PROMPT('zaporka:'),AT(7,34,59,10),USE(?zaporka:Prompt)
                           ENTRY(@s20),AT(70,33,89,12),USE(zaporka),LEFT(2),MSG('zaporka'),TIP('zaporka'),PASSWORD
                           STRING('blagajna:'),AT(7,51,101,10),USE(?String1)
                           COMBO(@s100),AT(7,67,154,14),USE(lBlagajna),IMM,FORMAT('400L(2)|M~opis~@s100@'),DROP(5),FROM(Queue:FileDropCombo)
                           BUTTON('&Prihvati'),AT(17,84,70,14),USE(?OkButton),LEFT,ICON('tick.png'),DEFAULT
                           BUTTON('&Odustani'),AT(91,84,70,14),USE(?CancelButton),LEFT,ICON('cross.png'),STD(STD:Close)
                         END

    The combo behaves strangely:
    -if i click on the combo arrow i see records, but when i choose the combo blinks and then resets to empty string
    -if i enter manually the string with keyboard and then choose with the arrow i get crash indicating NullpointerException CWin line 532
    c.setProperty(Prop.SELSTART,start);

    I have tried different workarounds but withou luck.

    Do you use COMBO?
    Nenad

     
  • Andrew Barnham

    Andrew Barnham - 2011-12-12

    Hi, yes my app uses combos.  I do not use ABC templates to populate them although, I typically hand roll them.  Combos should work in c2j, but their implementation is not as comprehensive as other window controls.  Many things that work in LIST are not implemented in c2j for COMBO.

    In code snippet above I cannot see the variable definition for lBlagajna.  I assume it looks something like this:
    lBlagajna string(100)

    c2j is sensitive to use variables not being implemented; so based on code I can see above I think this may be the a possible cause of problems.

     
  • nenad cikic

    nenad cikic - 2011-12-12

    I have noticed that when i uncheck "Automatic Entry Field Completion", then the runtime error vanishes. It's still not working good as now i can not select the value: i select a row and the use var returns to blank.

     
  • nenad cikic

    nenad cikic - 2011-12-12

    I have managed to find a workaround. I have used temporary variable to sotre the selection value and then after parent.takenewselection i return the value

    ThisWindow.TakeNewSelection PROCEDURE

    ReturnValue          BYTE,AUTO

    Looped BYTE
      CODE
      LOOP                                                     ! This method receives all NewSelection events
        IF Looped
          RETURN Level:Notify
        ELSE
          Looped = 1
        END
        CASE FIELD()
        OF ?lBlagajna
          get(Queue:FileDropCombo,choice(?lBlagajna))
          lBlagajna=Queue:FileDropCombo.blag:opis
          lBlagajna2=lBlagajna
        END
      ReturnValue = PARENT.TakeNewSelection()
        CASE FIELD()
        OF ?lBlagajna
          lBlagajna=lBlagajna2

     
  • nenad cikic

    nenad cikic - 2011-12-12

    What you mean by "variables not being implemented"?

     

Log in to post a comment.

Auth0 Logo