NOTE: I was planning to document doing this on here separately as a tutorial on how to use a JS plugin like that (as I had to work it out the hard way and wished someone had done something similar) - if I ever get this sorted. Now, it is possible that I am “breaking” something as I have been experimenting with using an alternative to the SC file uploader (using a JS plugin) - and it’s when that uploader (called as the aforementioned modal app) closes that I want the calling app to refresh with a field showing the name of the uploaded file (as well as update the DB with that name). Next time I call that app the updated values are all correct - as does hitting a Refresh button I’ve added that uses sc_exit(sel) and works fine that way (so what I want is to be able to cause that to happen in code, but running sc-exit etc does not seem to work for this) It hasn’t frozen at all though as everything works as you would expect - it’s just not up to date. It’s almost like the calling app has frozen at the point it refreshes the screen with those values. However, those updated values do NOT appear changed on the screen. What I have done is, via xdebug, prove that control DOES pass back to the calling app (when I force a reload, in various ways) and it does execute statements that update its own fields. Over last few weeks I’ve been pulling my hair out (and I don’t have much to begin with) trying to get to the bottom of this before coming back here. None of those things work though I’m afraid. Sorry for the delay on getting back on this - and thanks so far to jsb and albert for your thoughts. I wonder if that is somehow confusing things in terms of what is open and what has control? I use sc_redir from the modal app to “close” the app, and then in the main calling app (I just sc_redir()'d to) I use the above code to remove the modal window. The only other thing that might have a bearing is that the app that “returns” to the calling app is a modal form that I have to manually remove when closing - using: echo "_remove() " Likewise, if I go to a different app via the menu and return, then all the fields are updated. When I use sc_exit in my form’s event code it does nothing - nor does using sc_redir as you suggest - my field and time test field remain unchanged. If I click my “refresh” button which uses sc_exit(sel) the time increments every time. Trying that (sc_redir) also seems to do nothing (I have a test form field with a value of time() to make updates easier to see ). Yes a manual refresh and the change is seen.Īre you suggesting using sc_redir to itself (albeit with a parameter)? So any thoughts / help gratefully received please. Probably a simple “can’t see the wood for the trees” problem, but it’s been driving me nuts for the last 2 days. So how do I achieve the functionality of that button automatically when returning to the calling form? I have tried sc_exit(sel) and sc_exit(ref) in onScriptInit to force a refresh - but that doesn’t seem to do anything.įor a test I created a PHP button with just sc_exit(sel) and clicking the button refreshes the form and shows the new value. But the form does not reflect the change!?! I have a form that has a label field (not DB-linked) called = to get the new value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |