William Posted December 22, 2011 Posted December 22, 2011 The saga continues.... I am having intermittent, and more recently constant, problems with 'reload'ing an SCContainer. I have copied and pasted one's that worked (for a while), deleted and added new ones, simply done everything I can think of. I download an SC and allow the user to modify with a graphic app. Then delete the original and re "Set" the container with the modified version. That all works fine, the modified SC is being created properly. However, doing a Viewer Reload right after or with a little pause does not refresh the container. I know everything is set properly because: if I go to layout mode and back to browse, it refreshes!! The viewer is properly named and referenced. The layout has focus. This is an app breaker. I cannot put this new version of my product out with this kind of inconsistency. Back-tracking to a different paradigm will put me behind by a week or two which would be disastrous now. I assume I'm doing something wrong since there is such a large number of users and developers that report glowingly on how well SC works. I'm working on Lion with FMP Adv 11.04. The app will in the end be deployed on Windows 99.99% of the time. I haven't tried it yet on Windows but will now (just thought of this) but I don't see any reason why this should be a problem. Again, I know my code is working right (it's basic), the intended result is achieved, it's the viewer that is not reloading. Perhaps something in the viewer code, but it's basically the same as in the SC demo file. Any tips, tricks, pitfalls with web viewers? I hope someone out there has experience with this and/or knows how to fix this. Any suggestions at this point are greatly appreciated. Desperate. And Thank You. William O'Keefe Frenel Solutions
ooparah Posted December 22, 2011 Posted December 22, 2011 Hey William, It seems like you're still doing all the necessary steps. I just tried the "Replace and Reload" locally and it worked just fine. Here's how my scripts were set up: If you're grabbing the file from the SuperContainer server, you would use SCGetContainer: Set Variable [ $result; Value:SCGetContainer( Document:folderPath )] // Error Handling If[ $result = "ERROR"] Show Custom Dialog [ "Error with grabbing file: " & SCLastError ] Else Set Field [Document::container ; $result] End If After the user downloads the file from Container (or they could just click on your web viewer if it contains the file) and edit the file. They should import that file back into the container field, which you would use to "Reload" your Web Viewer: To Reload and Refresh your Web Viewer w/ Container Data: Set Variable[ $delete; Value:SCDelete( Document::folderPath ) ] // Error handling If [$delete = "ERROR"] Show Custom Dialog ["Unable to delete: " & SCLastError] End If Set Variable [$copyover; Value: SCSetContainer( Document::folderPath ; Document::container )] // More error handling If [$copyover = "ERROR"] Show Custom Dialog ["Unable to copy over: " & SCLastError] End If Set Web Viewer [Object Name: "webview" ; Action: Reload] ** where "webview" is the name of the Web Viewer object on the layout and "Document::folderPath is the folder path on the server to the document (i.e., "/MyDatabase/MyDocument/DOC_" & Document::documentID ) ** You will definitely want better error handling in your code, but this is just for illustration purposes. Hopefully it helps. If you have additional questions or need clarification on this, please let me know. Since the web viewer reloads when you move to a new layout, record, etc. and return... then your deletion and setting of the files in SuperContainer are spot on... your problem is with the web viewer. Triple-check that your object name is typed exactly as it shown in the Inspector. You could call in to the office number below and we can try to handle this issue over a screen sharing session. Good luck,
William Posted December 22, 2011 Author Posted December 22, 2011 Thanks again. I have reinstalled FileMaker and checked with 11.01, 11.03, 11.04, all same results. Then I checked the SC version and it was 2_381 so I upgraded that to 2_85. So far it seems like things are acting better SC wise (noticed that a "java" folder was NOT in the other version folder, if that means anything). BUT, no matter what I do, or how I reference it, FileMaker WILL NOT refresh the web viewer, again, I know SC is working 'cause if I go to layout and back, it refreshes properly. I'm simply calling the native FMP web viewer "Set" command with the exact object name I gave it and with the "reload" option. It is the only viewer on the layout. It is set with the standard SC code. It is set to the "interact" option. The debugger shows that when the Set-Reload is called the layout has focus. I have tried the same scenario on Windows XP SP2 & 3 and the result is the same. Is FileMaker screwing with me??!! Why does everyone else's system refresh but mine? Very frustrating. I can't think of anymore options to get FileMaker to behave as it should. Due to time constraints I may have to retool and use a FMP container based image file and just load images from that and not use the SC paradigm, which would be sad 'cause it makes everything else so easy. I would like to do a screen sharing with you as you suggested but can't until Friday AM (tomorrow). It would need to be before noon my time (PST). Is that possible? Thanks for all the help and patience. William O'Keefe Frenel Solutions
ooparah Posted December 22, 2011 Posted December 22, 2011 William, Unfortunately our office is closed for the holidays starting tomorrow morning and we will not be back in the office until Tuesday, December 27th -- that morning at 10am ET would be the earliest I would be able to connect with you via a screen sharing session. I also can not think of any other reason why your solution will not properly refresh your Web Viewer. Hopefully you are able to figure a work around (or whatever is causing the problem) before Tuesday though. Random suggestion, but the FileMaker website offered the following Error Checking for setting the web viewer / object: Examples The following example resets the web viewer named “Web Viewer 1” to its originally specified web address: Set Web Viewer [Object Name: "Web Viewer 1"; Action: Reset] The following example displays the FileMaker, Inc. homepage in the active web viewer, or displays an error message if the active object is not a web viewer: If [GetLayoutObjectAttribute( Get (ActiveLayoutObjectName); "objectType") = "web viewer"] Set Web Viewer [Object Name: Get (ActiveLayoutObjectName); URL: "http://www.filemaker.com"] Else Show Custom Dialog ["This object is not a web viewer."] End If Maybe if this script returns a Custom Dialog box, you can determine whether everything was being set up correctly. Good luck,
William Posted December 22, 2011 Author Posted December 22, 2011 Thank you. Upon examining my timeline: I am switching to work on another module while I sort this out, so I will plan on a session Tuesday AM and will contact you earlier in that morning for details. After checking and re-checking and re-installing, etc., etc., I've come to the conclusion that there is something way too obvious wrong here. It usually works that way, while trying to find some complicated solution, the simple and obvious are overlooked. I will let you know one way or the other. Have a great Holidays! William O'Keefe Frenel Solutions William, Unfortunately our office is closed for the holidays starting tomorrow morning and we will not be back in the office until Tuesday, December 27th -- that morning at 10am ET would be the earliest I would be able to connect with you via a screen sharing session. I also can not think of any other reason why your solution will not properly refresh your Web Viewer. Hopefully you are able to figure a work around (or whatever is causing the problem) before Tuesday though. Random suggestion, but the FileMaker website offered the following Error Checking for setting the web viewer / object: Maybe if this script returns a Custom Dialog box, you can determine whether everything was being set up correctly. Good luck,
William Posted December 22, 2011 Author Posted December 22, 2011 Hopefully I can catch you before 'y'all head out for the Holidays: just for my clarification: I'm having the user modify a graphic in the app of their choice; requires the file extension to be set to the application (OS function). Does SC natively open the app associated with the file? I ask 'cause it's only opening the browser. Do I need to script it, use raw data, etc. Does SCGetContainer only push to a container field or can I make it push to a file (or whatever) so I can launch the file with it's app. What would be nice is if I could have the user click on the SC, it would open the native file app, modify it, save it (which saves the SC file) and then just reload. Is that a viable scenario? Thanks again. William O'Keefe Frenel Solutions William, Unfortunately our office is closed for the holidays starting tomorrow morning and we will not be back in the office until Tuesday, December 27th -- that morning at 10am ET would be the earliest I would be able to connect with you via a screen sharing session. I also can not think of any other reason why your solution will not properly refresh your Web Viewer. Hopefully you are able to figure a work around (or whatever is causing the problem) before Tuesday though. Random suggestion, but the FileMaker website offered the following Error Checking for setting the web viewer / object: Maybe if this script returns a Custom Dialog box, you can determine whether everything was being set up correctly. Good luck,
Recommended Posts
This topic is 4718 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 accountSign in
Already have an account? Sign in here.
Sign In Now