ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SNGCHCFLD with subfiles?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SNGCHCFLD with subfiles?

    Hello guys i have a subfile and i want the user to only be able to select one row. I was going to use a SNGCHCFLD but since i need the CHOICE's to be dynamic i don't know what to do.

    If there isn't a better way i would just use a flag of some sort to check if the user has already selected an option. But UI-wise it would be better to use SNGCHCFLD.

  • #2
    Re: SNGCHCFLD with subfiles?

    seems that there is a SFLSNGCHC. I will test.

    Comment


    • #3
      Re: SNGCHCFLD with subfiles?

      you could use automatic record advance (ER)
      this acts like an enter key pressed.

      PHP Code:
      A            SLST      R        B  8 17REFFLD(STST)    
      A  29                                  DSPATR(RI)      
      A  29                                  DSPATR(PC)      
      A                                      CHECK(ER
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: SNGCHCFLD with subfiles?

        great jamief thanks. Although in our case we like that the enter key doesn't actually advance to a next screen, it is rather used as a verification key, to let the user change his/her mind rather than go back and forward.

        I will try with sflsngchg first, although i have read that it is a little bit limited (only one output field) which i guess it makes sense.

        Comment


        • #5
          Re: SNGCHCFLD with subfiles?

          I'm having a problem with sflsngchg. I am writing to the subfile from a loop, and after choosing the value i continue with the loop, clear the subfile and write it again with other values. When i do EXFMT for the second iteration, the first row looks white, as if it were selected, but doing a readc shows that it indeed the row isn't selected.

          What should i do to fix this? Delete the subfile rather than clearing it?

          Comment


          • #6
            Re: SNGCHCFLD with subfiles?

            turn off the indicator you are using to highlight the field b4 you reload
            subfile.... This is only a guess.

            jamie
            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment


            • #7
              Re: SNGCHCFLD with subfiles?

              before clearing the subfile, i had the selection field set to 0 and then updated the subfile and now it works.

              Comment


              • #8
                Re: SNGCHCFLD with subfiles?

                i'm not using indicators to highlight anything, this is the behavior of the sflsngchg. when i press f7 i do a chain to the subfile to make sure the hidden fields i set are updated, so the first record somehow gets highlighted. anyway, just setting the selection field to 0 and updating the subfile before clearing it and starting again fixes this.

                Comment

                Working...
                X