Jump to content

  •  

UPGRADE DEADLINE - SEPTEMBER 26, 2014!
FileMaker Inc. has a deadline for users of version 10,11, 12 as Individual box or volume licenses (with expired maintenance).
If you don't renew your maintenance and upgrade to FMP 13 you will no longer be eligible to upgrade, at the discount pricing.

Volume Licensing upgrade pricing for FileMaker Pro 13, FileMaker Pro 13 Advanced and FileMaker Server 13 will be discontinued.
Individual upgrade pricing for FileMaker Pro 13 and FileMaker Pro 13 Advanced will increase after September 26, 2014.
As of 27-September-2014, FileMaker 10 products will no longer be available for purchase or support.

http://help.filemaker.com/app/answers/detail/a_id/13865


Photo

Maintaining selected text when switching tabs?


  • Please log in to reply
5 replies to this topic

#1 emosensei  

emosensei
  • Members
  • 94 posts
  • LocationSouthern CA
  • FM Application:13 Advance
  • Platform:Mac OS X Mavericks
  • Skill Level:Intermediate
  • Membership:TechNet
  • Time Online: 1d 6h 23m 44s

Posted 17 September 2013 - 11:28 AM

Hello, all--

 

When switching tabs, any text that had been selected in the original tab is no longer selected in the second tab.

 

original tab:

tab1.png

subsequent tab:

tab2.png

An OnTabSwitch trigger, calling this simple script, didn't solve the problem; it seems like the conclusion of the script causes a jump back to tab1:

script.png

 

Any suggestions appreciated. Thanks very much!

 

 


  • 0

#2 Fitch  Imaginary friend

Fitch
  • Moderators
  • 4,025 posts
  • LocationPortland, Oregon
  • FM Application:13 Advance
  • FMGo:iPhone / iPod Touch, iPad
  • Platform:Cross Platform
  • Skill Level:Expert
  • Certification:7, 8, 9, 10, 12
  • Membership:TechNet
  • Time Online: 16d 9h 42m 43s

Posted 17 September 2013 - 12:37 PM

This happens whenever you have multiple instances of a field on a layout and you put the focus on the field, e.g. with Go to Field. In this case, setting the selection puts the focus on the field. I believe it is the object stacking order that determines which instance "wins."

 

To control this, give each instance of the field an object name, and after the tab switch, have it go to the object on that tab. Then, when you set the selection, leave the target field option blank, i.e. don't specify a field.

Set Variable( $selectedStart ; Get ( ActiveSelectionStart ) )
Set Variable( $selectedSize ; Get ( ActiveSelectionSize ) )
Go to Object( "tabField2" )
Set Selection( Start: $selectedStart ; End: $selectedStart + $selectedSize - 1 )

  • 0
Tom Fitch :: Portland, Oregon :: Fitch & Fitch: FileMaker consulting

#3 mr_vodka  Candy is Dandy... But Liquor is Quicker

mr_vodka
  • Moderators
  • 5,917 posts
  • LocationOld Bridge, NJ
  • FM Application:12 Advance
  • FMGo:iPad
  • Platform:Windows XP
  • Skill Level:Expert
  • Certification:8, 9, 10, 11
  • Membership:TechNet, FileMaker Business Alliance
  • Time Online: 9d 7h 4m 12s

Posted 17 September 2013 - 12:43 PM

Try naming the field object itself. Something like:

 

Go to Object [field2]

Set Selection [Start Position: 1; End Position: 21 ]

 

 

Dont set a field as a target

 

 

Edit: Looks like tom got you in the right direction... :-)  The selection start and size may have to be stored in a couple of global variables with an onObjectExit on the field though.


  • 0
- John Ahn
Life3D Studios
FMfunctions.com, Co-founder

#4 emosensei  

emosensei
  • Members
  • 94 posts
  • LocationSouthern CA
  • FM Application:13 Advance
  • Platform:Mac OS X Mavericks
  • Skill Level:Intermediate
  • Membership:TechNet
  • Time Online: 1d 6h 23m 44s

Posted 17 September 2013 - 01:16 PM

Ah you're right, not specifying the field did the trick.  But now here's something weird that I wasn't expecting...

 

If you click the 'go to tab 2' button in my attached sample file, the text is selected as desired but it's EDITABLE!  The field in tab 2 is actually defined to disallow data entry in browse mode, but I am still able to add or delete text until I commit the record.  Does this have something to do with the object stacking order or some other layout behavior?  Is there any way around this, because I can't allow my users to edit text in the 2nd tab.

 

Thanks very much for your time!

Attached Files


  • 0

#5 mr_vodka  Candy is Dandy... But Liquor is Quicker

mr_vodka
  • Moderators
  • 5,917 posts
  • LocationOld Bridge, NJ
  • FM Application:12 Advance
  • FMGo:iPad
  • Platform:Windows XP
  • Skill Level:Expert
  • Certification:8, 9, 10, 11
  • Membership:TechNet, FileMaker Business Alliance
  • Time Online: 9d 7h 4m 12s

Posted 17 September 2013 - 01:49 PM

Well if you have the text selected then it is editable. You can always go the old fashioned method and use a calculation field for your second tab. Then they cant edit it at all.


  • 0
- John Ahn
Life3D Studios
FMfunctions.com, Co-founder

#6 emosensei  

emosensei
  • Members
  • 94 posts
  • LocationSouthern CA
  • FM Application:13 Advance
  • Platform:Mac OS X Mavericks
  • Skill Level:Intermediate
  • Membership:TechNet
  • Time Online: 1d 6h 23m 44s

Posted 17 September 2013 - 03:10 PM

Well if you have the text selected then it is editable. You can always go the old fashioned method and use a calculation field for your second tab. Then they cant edit it at all.

Yes that's another good idea, a calc field would be un-editable no matter what.  Many thanks to you both.


  • 0




FMForum Advertisers