1 2 Previous Next 16 Replies Latest reply on Aug 27, 2012 8:58 AM by philmodjunk

    Sending keystroke to radio button has no affect ?

    synergy46

      Title

      Sending keystroke to radio button has no affect ?

      Post

      I have a main members layout; attached below.

      On the left is a portal that has a working relationship with Members.  (The portal is based on Members)

      When displaying the member names, the portal works as desired.  For example, when I click the Member radio button and then click Active radio button , all the Active Members show in the portal. Same with Candidates.

      But, if there are no Inactive Candidates, for example, clicking that combination shows an empty form on the right.

      I have trapped the error (when no records are found) and even sent P& "Member"&P and P&"Active"&P to the respective radio buttons but the portal listing is unaffected.  If I manually click on "Member" and "Active" for example, they work as expected. 

      Question:  "What can I do to simulate the pressing of the "Active" and "Member" buttons, for example?

      Thanks

      comp.jpg

        • 1. Re: Sending keystroke to radio button has no affect ?
          schamblee

          To set the value of a radio button you would use "Set Field" .  I assume your field related to Active / Inactive Button is gShowActive.  If not, just change  the field in the code listed to the field related to your radio buttons.  If you wanted to set the button to inactive you would sub "Inactive" for "Active".  

           

           Set Field[Members::gShowActive;"Active"] .  

          • 2. Re: Sending keystroke to radio button has no affect ?
            synergy46

            Right.  The radio button for Member/Candidate is Members::GMem_Can and the radio button for Active/Inactive is Members::GShowActive.

            In my code I AM using SET FIELD gMem_Can to set "Member" and SET FIELD gShowActive to set "Active".  Do you see something different?

            I think I am confused as to what you are saying I should try vs what I have coded.

            • 3. Re: Sending keystroke to radio button has no affect ?
              Sorbsbuster

              S Chamblee suggested you set the field value to "Members".  You are including a return on either end of the text.

              • 4. Re: Sending keystroke to radio button has no affect ?
                synergy46

                The problem is that the button "Member" receives the text but does not act the same as if I had mouse clicked "Member".

                 

                • 5. Re: Sending keystroke to radio button has no affect ?
                  Sorbsbuster

                  I think it would be helpful if you posted the whole script.  There are several steps in the part we can see that are redundant (although they shouldn't do any harm).  For example the Refresh Window and the two last Go To Field steps.  You are saying that if, after a script that returns an empty found set, you click on the field 'Member' and it shows you a found set, but if the script finds no records and sets the field to 'Member' it returns nothing?  Even after a Commit Records?

                  • 6. Re: Sending keystroke to radio button has no affect ?
                    schamblee

                    When you click on a Radio button it set a value into a field related to that radio button.  If you set the value manually by set field the Radio button will update to the same value (display).  If you are running a Script Trigger on the radio button then I would copy that code and add it to the other script you are running to automate the click.

                    • 7. Re: Sending keystroke to radio button has no affect ?
                      synergy46

                      Thanks for the reply.  Here is the latest.

                      First, FM was storing my radio button selections as " Active" (Additional Space) and " Member" (Additional space).  Everything looked ok in Inspector so I added some trim() just to take care of it.

                      To simplify things, I added a "GO" button which runs the script.    This  is the error producing sequence:

                      Member / Active  GO -> 1 of 55 correct.

                      Leaving Member chedkced but  clicking Inactive GO -> 1 of 2  correct.

                      Clicking Candidate (Not clicking Inactive) GO -> 1 of 1 correct

                      Leaving Candidate selected but clicking Active GO -> INCORRECT 1 of 7

                      Leaving Active checked but clicking Candidate GO -> 1 of 6  correct.

                      Leaving Candidate selected but clicking Inactive GO -> 1 of 7 INCORRECT

                      This seems really tough to grind by just looking at my screen captures.  Would you like me to send you a DL link for the whole file?

                      • 8. Re: Sending keystroke to radio button has no affect ?
                        Sorbsbuster

                        I think you are trying to achieve that if a find returns no records, a further find is performed.  I'm getting rather confused; there seem to be a lot of steps to the script that I can't appreciate the value of.  Go to Field, then immediately another Go to Field step.  One will simply over-write the other's action.  The 'Trim calculation at the start suggests to me that the data in the field itself should be purged - perhaps once, with the same Trim function.  The Relookup step - what is the value that the script will exploit that is the result of a Lookup?  You refer to sub-scripts that we can't de-bug.  The Go To Related Records I can't follow, either.  Sorry; I'm sure it's my limited intelligence.

                        Can you confirm that the script 'Show All Members and Candidates' works the way you want?

                        I donlt really understand this:

                        "Member / Active  GO -> 1 of 55 correct."  Do you mean that you have 55 records in total, and it correctly returns that 1 is an Active Member?

                        "Leaving Member checked but clicking Inactive GO -> 1 of 2  correct."  Why is it one of two?  Is it not 1 of 55?  But if 1 of the 55 members is Active, does that not mean the other 54 are Inactive?  Or is there a 3rd category of Active Status?

                        • 9. Re: Sending keystroke to radio button has no affect ?
                          synergy46

                          I can appreciate your confusison.  I too get confused with this code!

                          Seriously, here is a youtube video that might explain somewhat how the code works:

                          http://youtu.be/0rcPFO4N5Mc


                          Attached is a .jpg of the script that only 'sometimes' works...

                          Thanks for your thoughts and help.

                          • 10. Re: Sending keystroke to radio button has no affect ?
                            synergy46

                            I've narrowed the current problem down to the fact that my script: RadioBtnObjectMod (2) If statement DOES NOT RECOGNIZE the variables evident in the debug variables window.  ??// How can that be?

                             

                            • 11. Re: Sending keystroke to radio button has no affect ?
                              synergy46

                              I should point out that the script SKIPS the IF for Active Candidate (even though Debug Watch clearly shows the variables present.

                               

                              However, IF I MANUALLY CLICK ON CANDIDATE AND ACTIVE THEN RUN THE SCRIPT, EVERYTHING WORKS AS EXPECTED. 

                               

                              So the question is, "What is wrong with my code that I can set a radio button but it won't get 'pushed' in code?  Surely this isn't a new problem.

                               

                              Thanks again

                              • 12. Re: Sending keystroke to radio button has no affect ?
                                Sorbsbuster

                                You keep adding return characters to either end of the variable, then you check in the If Statement for the exact text, without any return characters, so the If Statemment will evaluate to be false, and then look as if it is 'ignoring' it.

                                • 13. Re: Sending keystroke to radio button has no affect ?
                                  synergy46

                                  Great idea.  But, I changed the IF statement to reflect the presence of the return character and it still won't work... ???

                                  • 14. Re: Sending keystroke to radio button has no affect ?
                                    philmodjunk

                                    Don't use the  ¶ here at all. There's no need for it and it complicates your expression needlessly.

                                    That may not solve the whole problem given your last post here, so you may need to check the field data types of your two fields to make sure that they are text and not number. If they are of type number, they'll display data correctly, but your = expressions here will not evaluate as expected.

                                    1 2 Previous Next