7 Replies Latest reply on Mar 13, 2012 2:48 PM by ChrisBishop

    Find Mode in IWP

    jluca

      Title

      Find Mode in IWP

      Post

      Hello All,

       

        Newatthis!

       

      IamcreatingafindbuttonanditworkingitfilemakerbutnotIWP.

       

       

      WhenIentercriteriainfilemakertheresultscomeupperfect!

       

       

      WhenIenterthesameinfoinIWPIstayinfindmodeandnoresultscomeup

       

       

      PleaseAdvice

       

       

        • 1. Re: Find Mode in IWP
          craig5005
            

          This is an easy fix, I ran into the same problem awhile ago.

           

          It is best to have a specific layout for searching that is only used by IWP users (it can be identical, but just have one extra button on it).

           

          You can set this up using

          If Get(applicationversion)="Filemaker Web Publishing" 

              Go to layout ["find IWP"]

              Enter find mode 

          else

               go to layout ["find normal"]

               enter find mode 

          end if

           

          Then on the find IWP layout, have a button they push to perform the find.  The button is scripted to

          Perform Find []

          #then whatever you want it to do with the find.

           

          Hope this helps.


          Craig 

           

           

          • 2. Re: Find Mode in IWP
            craig5005
              

            Sorry, that if statement should read

             

            If [LeftWords (Get(applicationversion);3)="Filemaker Web Publishing"]

             

            Since it will return a version etc after those 3 words.  The Leftwords command will only read the "Filemaker Web Publishing"  parts and forget about the version number.

             

            Craig 

            • 3. Re: Find Mode in IWP
              jluca
                

              Thanks for the post Craig!  (I give that a try)

               

              Another question??

               

              In layout IWP is there a way the user can just hit enter and do the search?

               

              Example: I have a field call P.O number and the user want to find a specific # like p.o 111.

               

              When the user type 111 in P.O field and press enter user should see all the results. 

               

               

              I know this works in filemaker pro but not in iwp.

              • 4. Re: Find Mode in IWP
                craig5005
                  

                Not that I know of... however, someone else on this forum may have an answer.

                 

                Craig 

                • 5. Re: Find Mode in IWP
                  TSGal

                  jluca:

                   

                  Thank you for your post.

                   

                  Yes, in FileMaker Pro, you can press return to initiate the Find.  With Instant Web Publishing, you are access the data through the browser.  There is no default button in Instant Web Publishing to accept a return.  Therefore, when you enter 111 followed by a return, the return is placed in the field you are editing.

                   

                  I would encourage you to enter this as a suggestion into our Feature Suggestion web form at:

                   

                  http://www.filemaker.com/company/feature_request.html

                   

                  Although I could copy your post and paste it into the web form, there are additional questions asked that only you can answer.

                   

                  TSGal

                  FileMaker, Inc. 

                  • 6. Re: Find Mode in IWP
                    jluca
                       Ok great thank for all your help
                    • 7. Re: Find Mode in IWP
                      ChrisBishop

                      Actually, you can, but it requires editing the iwp.js file.







                      1. Create an invisible button that executes a script.  The script should perform the find (or whatever else you need it to do).
                      2. Place this button at the top left of all desired layouts and send it to the back (behind all other elements on the layout).
                      3. Add this to the top of iwp.js:

                      window.addEventListener('keypress', function (e)
                      {
                          var mode = top.iwp.bodyFrame.iwpinfo.mode;

                          if (mode == 'find') {  // Can be 'find', 'browse' for different desires
                              if (e.which == 13) {  // Keycode 13 = Return
                                  top.iwp.executebuttonscript(2,1,1);  // Executes top leftmost button on layout
                              }
                          }
                      }
                      ) ;