ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

how to control single choice field through program

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

  • how to control single choice field through program

    Hi

    I have created a display file with single and multiple choice fields(SNGCHCFLD)

    but i am not able to control that with my Program.How can i control that???

    Regards
    Naveen

  • #2
    Re: how to control single choice field through program

    Please find the Display file DDS.

    Try to work on this by using the Test Display file option in STRSDA

    PHP Code:
    A          R MULCH                                                  
    A                                  3  3
    'SINGLE SELECTION FIELD. :'  
    A            F1             2Y 0B  3 35SNGCHCFLD                    
    A  01                                  CHOICE
    ('>UNDO     ')       
    A                                      CHOICE('ABC O     ')       
    A                                      CHOICE('DEF       ')       
                                                                        
    A                                 13  3'MULTIPLE SELECTION FIELD. :'
    A            F2             2Y 0B 13 35MLTCHCFLD                    
    A  01                                  CHOICE
    ('>XYZ      ')       
    A                                      CHOICE('DEFX      ')       
    A                                      CHOICE('GHI       ')       
    A                                      CHCCTL(&CHCTL1)            
    A                                      CHCCTL(&CHCTL2)            
    A                                      CHCCTL(&CHCTL3)            
    A            CHCTL1         1Y 0H                                   
    A            CHCTL2         1Y 0H                                   
    A            CHCTL3         1Y 0H 
    CHCCTL is the keyword to know the status of the choice mentioned.

    For Single choice
    F1 indicates the option selected

    For Multiple choice
    Choice control indicates the choices selected
    CHCTL1 - 0 - 1st choice not selected
    CHCTL2 - 1 - 2nd choice selected
    CHCTL3 - 1 - 3rd choice selected

    Comment


    • #3
      Re: how to control single choice field through program

      Hi Surya ,

      Its so simple & Nice ! Thanks !
      I am not getting the purpose of 01 Indicator . When we put this , its not showing first option & choice . When i removed it Shows all 3 options & choices.
      What 01 Indiactor do ?

      Deepa

      Originally posted by Surya View Post
      Please find the Display file DDS.

      Try to work on this by using the Test Display file option in STRSDA

      PHP Code:
      A          R MULCH                                                  
      A                                  3  3
      'SINGLE SELECTION FIELD. :'  
      A            F1             2Y 0B  3 35SNGCHCFLD                    
      A
      [COLOR="Blue"]  01                                  CHOICE('>UNDO     ')[/COLOR]       
      A                                      CHOICE('ABC O     ')       
      A                                      CHOICE('DEF       ')       
                                                                          
      A                                 13  3'MULTIPLE SELECTION FIELD. :'
      A            F2             2Y 0B 13 35MLTCHCFLD                    
      A  
      [COLOR="blue"]01                                  CHOICE('>XYZ      ')     [/COLOR]  
      A                                      CHOICE('DEFX      ')       
      A                                      CHOICE('GHI       ')       
      A                                      CHCCTL(&CHCTL1)            
      A                                      CHCCTL(&CHCTL2)            
      A                                      CHCCTL(&CHCTL3)            
      A            CHCTL1         1Y 0H                                   
      A            CHCTL2         1Y 0H                                   
      A            CHCTL3         1Y 0H 
      CHCCTL is the keyword to know the status of the choice mentioned.

      For Single choice
      F1 indicates the option selected

      For Multiple choice
      Choice control indicates the choices selected
      CHCTL1 - 0 - 1st choice not selected
      CHCTL2 - 1 - 2nd choice selected
      CHCTL3 - 1 - 3rd choice selected

      Comment


      • #4
        Re: how to control single choice field through program

        When 01 indicator is set to ON, you can see all the three choices.
        When 01 indicator is set to OFF, you can see only two choices.

        The purpose of this is we can dynamically control the options defined from the program.

        Comment


        • #5
          Re: how to control single choice field through program

          Thanks........

          Comment


          • #6
            Re: how to control single choice field through program

            $HIDE 2Y 0B 7 3SNGCHCFLD(*AUTOENT)
            CHOICE(1 '>hide CLOSED events')

            I put SNGCHCFLD in a display file with the *AUTOENT parameter. When I choose / turn "on" the radio button it does automatically move forward to the next step. When I un-choose / turn "off" the radio button, the event "words" (hide CLOSED events) are in reverse image and I have to hit the ENTER key before it moves on to the next step. Am I missing something?

            Comment

            Working...
            X