Jump to content

Expanding multiple Notes


LaRetta

This topic is 3857 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Data-entry fields don't expand for easy reading of large text blocks. Another thread has spurred this concept http://fmforums.com/forum/topic/89853-dynamic-field-size/

 

I would like to brain-storm the best solutions using native FM in the following scenario:

 

Situation: 

Parent table with child table of Notes (or comments or chapters – large segments of text).

 

Need: 

I want to scroll pages of text easily from parent, reading from one note to the next. I do not want to have to expand the field to read - only scroll a single field.  This may contain notes, chapters in a book, dissertation etc. When I see something I want, I want to click on it and open a window where I can make changes to that segment then close the window and continue reading where I left off.

 

This needs to be in browse mode, be fast over WAN and iPad, be easy to implement even for beginners, not require AppleScript, VBS, plugin, or JavaScript and must run comfortably on versions 11 and 12 both as cross-platform.

 

My solution (which is not good enough):

 

I would not want to create a calculation in the parent table which lists all the child notes. I always place note and comment fields in a related table to Parent even if 1:1 and to turn around and create an unstirred unstored (darned auto-spell, LOL) calc grouping all related notes back in the parent just seems wrong.  Sure, I want the calc shaken but unstirred.

 

I had to fudge … how can we get a list of notes using List() when Notes probably contains carriage returns and still maintain the separation between notes to identify later in the calc? So I added a tilde to the end of the actual notes in the child table so I know where to split them.  It moves on its own and shouldn't be a problem.

 

In all, this is okay I suppose but I would like to find the other thread where a similar technique is mentioned by Comment, for comparison.  And I would love to hear other approaches.  Would love it.  

ExpandedNotes.fp7.zip

Edited by LaRetta
Link to comment
Share on other sites

I would like to find the other thread where a similar technique is mentioned by Comment, for comparison.

 

LOL, I thought you would recognize it immediately:

http://fmforums.com/forum/topic/89778-center-within-repetitions/

 

Unfortunately, that won't work here as is, because (drat!) scrolling a field activates the OnEnter script trigger. And there is no OnClick script trigger.

 

In any case, the proper user interface to employ here, IMHO, is to have an [EDIT] button following each note (same as you have here on the forums). Clicking anywhere in the text itself should select the text, e.g. for copying. Now, the only way to implement this AFAIK is inside a web viewer. The snag, however, is that you need to activate the web viewer first, before you can interact with it - which IMHO is not quite good enough* (though it's not that bad either).

 

Another reasonable compromise could be to place an [EDIT] button outside the text field, then ... ah, never mind: I see that's what you did in your file.

 

 

---

(*) It also won't work in v.11 without a plugin.

 

 

 

 

I would not want to create a calculation in the parent table which lists all the child notes. I always place note and comment fields in a related table to Parent even if 1:1 and to turn around and create an unstirred calc grouping all related notes back in the parent just seems wrong.

 

Can you explain the "wrong" part here?

Link to comment
Share on other sites

Oh so funny - I didn't consider the technique in the link because, with needing scroll, it wouldn't work but I found many things during my hunt which were exciting, fun, side-tracking and things I want to explore anyway so it was a great search!!

 

I wanted to use Web Viewer and I tried it using  "data:text/html," & GetAsCSS ( Notes::note ) but I couldn't figure how to make it find the location of the cursor.  I hadn't had a chance yet to pick apart Matt's file to get clues.  What changed between 11 and 12 so it wouldn't work in 11 without plugin?  All I can think of is interactive containers but I don't see how.  Super Container?

 

Can you explain the "wrong" part here?

 

Well, it is not like I need to tell YOU of all people, Michael, but here is my reasoning on this approach and as always, I welcome deeper understanding and corrections.

 

Less Field Clutter & modular use in a solution

I chose global calculation with global trigger because they are my dynamic pair (context-free). I create them in a Globals (one-record) table and then any table can use them for interaction (such as navigation or User-selection), copying (but prohibiting data change) based upon whatever I choose from the current script-executed perspective. There are few limits.

 

In this example, if several tables share a Notes table (which is an efficient setup) then this pair of globals can handle them all (in this case of displaying notes) ... just set the global variable, trigger it, and display the single global calc. So in standard solution with 6-7 tables related to notes, that is 6-7 unstored calcs not needed.

 

Refreshing

Since globals are, by their very nature stored, they will not keep re-evaluating at every re-draw and scroll such as the unstored calc. So as the User works in the field, the global calc will only change once the Edit window is closed (not included in my file, my apology, I was tired), whereas an unstored calculation in Parent may re-evaluate several times during that single record-User interaction.

 

It still gets Served up

Although an unstored calculation will only re-evaluate when needed, it still is a field in the table which must be down-loaded from Server (*all fields for a record get downloaded) so the unstored calc still has a cost.

 

Caching

It is my understanding that FM caches data even if not seen (fetched) in anticipation that it will be needed next (25). So if there is a Notes field on the layout (whether unstored parent calc referencing Notes or Notes field itself), FM will probably/might cache other parent notes from that found set as well.

 

I believe that, if there is no Notes field present and no reference to the Notes table then cache is much less burdened because the only call to Server will be when I request via script for only that current parent record's notes.

 

---

 

Ideally, I wouldn't trigger OnRecordLoad but rather only by button click.  Most times Users won't want to see notes so why load anything until they need it, even a global?  

 

* exception in v12 is that containers no longer are downloaded (please correct me if wrong, people, but it was something from DevCon this year, I think, change in 12.0v3).


Oh, also - I DID use the same selection technique so it was very close actually.

Link to comment
Share on other sites

 What changed between 11 and 12 so it wouldn't work in 11 without plugin?

 

In v.12, you can run a script in a shared database using a URL. Interestingly enough, this does not appear on the "New features in FileMaker Pro 12" page and I had to dig for it:

http://www.filemaker.com/12help/html/sharing_data.16.7.html

 

 

 

I see what you're saying re the global vs. unstored. Maybe I am not thinking this through but other than the redraw issue, I think all the other things would apply to a portal as well as to the unstored calc, wouldn't they?

Link to comment
Share on other sites

 I think all the other things would apply to a portal as well as to the unstored calc, wouldn't they?

 

Well, there would be a relationship but no portal.  Without a field or portal from Notes on the Parent layout (or another calc which references Notes), Notes cache would be 0.  Notes will only load for the current record (via script) when requested and there will be no 'behind the scenes' caching of additional record from either Parent or other parent Notes.   A global calc referencing a global variable is evaluated on the client side so is sweet and instant and the calc request from Server only fetches related Notes to the current record.

 

And one global calc sure beats (I think) individual calculations in all the main entity tables (in numbers alone) if you choose to use this type of functionality.  Although unstored calculations are outside the table of dependencies, they still have a cost greater than a single global calc.  They both would have to fetch the related Notes but it is behind-the-scenes fetching as preparation that I think makes the difference.

 

Also, that unstored calc in the Parent would be tempting to use for searching (YIKES) or for placing on layouts (even lists, bringing them to dawg-speed) and its purpose should be only for developer use - if used at all.  Unless there is a problem with using the global calc, it just seems to make more sense.  I also recall a DevCon session where it was mentioned that unstored calculations DO bring some unexpected cost with them and no I don't remember where.  It was possibly something by HOnza; sorry I can't remember. <--- I will try to find it!!

 

Now ... these are my suppositions only.  I am no FM engineer and you know far more than I do so if you say I'm all wet, I'll go dry off and ... I am listening also ... not only to you but to the input and questions of others here.  I am not getting same thing as you on evoking the script ...  in my demo file, I place my cursor in the field, right-click, and I see only: copy, sort and export.  Can you explain more?

 

I appreciate you responding very much, Michael.

Edited by LaRetta
Link to comment
Share on other sites

Oh, no - you have far more experience running a served solution than I'll ever have (and frankly, I'm not too keen on getting such experience  :sweat:  ). I am just a bit wary of over-optimizing - sometimes it reminds me of the hospital that runs best when there are no patients... The point about multiple parent tables makes much more sense to me.

Anyway, it's rather off the topic of how to actually work with the field. I believe that whatever is good for the unstored goose, will also work for the global gander.
 

Link to comment
Share on other sites

Oh wow, guys.  I just have really bad bad flu.  That is all.  What a nice bunch of things to say now I am embarrassed because I just FEEL like I am dying but not.  And I dropped the ball on my last few posts including this one and felt bad about it and still do not feel able if someone might check them please.

 

You all make me smile. <mush>  <yuk> !!  I will catch up soon.  

 

ps - actually meaning it felt very good

Link to comment
Share on other sites

Don't sound so disappointed.

 

A few times I WAS disappointed, LOL.

 

I am not sure how much further I can take the 'native FM' approach on this, Michael.  It is nice to scroll a continuous portal of notes if needing to read them all easily without opening the note field to finish reading then opening the second and so on but this concept could be very slow record-switching if a record's notes are quite large and I am not sure its bang is worth the buck.

 

It just seems that every time we have a new tool, we must re-evaluate all functionalities.  In all, I would use 'reduce enclosing part' and generate a report view for the notes instead where they can be read continuously, popping it up in a new window.  Of course this won't work in GO which is where Matt's technique really shines.

 

Thank you all again for the kind words and expressions of concern.  The wonderful thing about feeling terrible is how appreciative of life one is when feeling better.   :yep:

Link to comment
Share on other sites

... and of course preview mode would not allow a click-and-edit functionality either.  I am giving up up on it all too soon probably because my energy is a bit low and I'll just need to circle back around to it.  But it will mean exploring new concept so I know it will be fun.  :laugh2:

Link to comment
Share on other sites

This topic is 3857 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.