Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I have a website in which my members will be adding different amounts of funding that they have received. They are filling in number fields.

I would like for the web page to total the amount as they add numbers. They will then click on the "Next" button and go on to fill in more text information on the next web page.

I have a calculated field that is totaling the amounts in the db. It works just fine there. Is there a way that the calculated field will "refresh" itself? I thought perhaps the Inline Action command might do this......I have never used it before.

Any help would be appreciated. Thanks!

Posted

You can do META refresh of page and you'll get new value from your database.

The URL generated the page must be NOT from POST operation (from Form).

Posted

No, inline actions will not serve you here. I've just recently figured them out (by reading between the pixels of the CDML Reference database), and they're reeeally lovely and useful, but they're part of your server-side code, and don't do anything once the page has loaded.

Refreshing totals as the user moves from one input field to the next is a client-side behaviour, and that means you need JavaScript. Unfortunately, I can't help you there. Right now I'm only on chapter 7 (of the O'Reilly definitive guide -- and it's my first real go at object oriented programming, so I'm going to have to read it twice.)

It helps (helps me) to remember that all CDML tags are server-side code, meaning that the server, Web Companion, reads them, interprets them, and turns them into HTML which it then sends to the user (that is, the user's browser -- known as the "user agent"). The UA sees none of the CDML you've written into your source file, only the HTML that WC spits out. On the other hand, if your source file contains JavaScript code, WC doesn't interpret it (obviously), it just sends it along with the rest of the HTML. The UA does see the JavaScript and can follow it's instructions. Hence, "client-side". (Apologies, if I'm describing in too much detail here. I just love explaining things once I fully understand them myself.)

_____________________________

On the other hand, I was so thrilled to discover Inline Actions (to finally discern what the heck the reference db was trying to tell me), that I'm happy to share the wealth.

What inline actions do is allow you to display pages to the user that are the result of multiple CGI commands. It works like this:

WC receives a CGI command, specifying a database, a layout, a format file and whatever else. Taking the database and layout as its "home base," it grabs the format file and starts assembling the HTML, replacing CDML tags as it goes. Of course, any table-specific tags -- such as [fmp-field] or [fmp-portal] must refer to objects present on the "home" layout.

BUT when it encounters the fmp-InlineAction tag, it reads it as whole new CGI command, which can reference a different layout, a different database, or whatever you like (except a different format file).

This changes the "home base." WC continues to read and replace CDML tags, but now interprets them with respect to the new database and layout.

Finally, it encounters the end-tag -- [/fmp-InlineAction] -- after which it goes back to interpreting tags according to the original CGI command.

_____________________________

This means you can embed one action inside another. The main advantage (as I see it) is that you can arbitrarily combine data from multiple tables; or present an input form along with a whole whack of background data.

Without it, you can only combine data from related tables, by means of portals. With it, you can "insert" data that's completely unrelated. I recently used it to generate the contents of a pop-up list in a form, but I know I'm just cracking the surface.

_____________________________

I hope this helps you explore new technique. There's lots I don't fully understand (haven't explored yet), like how tokens work and so forth. I also don't know if you can nest Inline Actions within other Inline Actions. I hope not -- I mean, how much fun can they let us have?

Posted

Anatoli,

My knowledge of html isn't all that deep, but your meta-tag suggestion... doesn't that mean you'd be submitting data that the user is in the process of entering? dschaal may want to provide a live total in order to help the user figure out what numbers they want to submit (making life easier -- a nice bit of user-friendliness).

Besides, as far as I know about meta tags, they can only refresh on a timed cycle, which means the user could be in the middle of something when the page suddenly reloads (ignoring the user -- a nice bit of user-UN-friendliness).

Come to think of it, reloading is the only thing a meta-tag refresh can do, so the user's data wouldn't get submitted at all. In fact, if there were any changes in the data, they'd be someone else's. It's a bit like sneaking up from behind and hitting the Reset button (pissing the user off -- hmm...)

Posted

Thank you for your explanation of Inline Action. I, too, have been reading the ever-challenging CDML Reference Manual. As a non-programmer, the going has been slow.

I tried the meta-refresh tag first and I agree with you, John, that this is unfriendly to the user......

I have come up with a "solution" -- it works but it's not as pretty as it could be. The user inputs all of their figures, clicks on a button marked "calculate" which takes them to a new window which just views the fields and the added total fields. Then I tell them if they need to make a correction to click on the "Back" button and it lets them edit again. The total will update because technically you are asking the db to get the data again.

My learning curve was steep (due to the inadequate explanations provided by FM). I really only have the basics down pat. I would love to get inline actions, cookies or tokens to work. I even bought a downloadable manual from FMWebSchool to see if that would explain it, but it's just as cryptic as the CDML Reference Manual.

Since there doesn't seem to be an end in sight and this is an annual report that the membership is submitting, I will keep plugging along. I have had some minor successes that keeps it bearable -- my first version of this (last fiscal year) did work. My second version does have some improvements to it, so at least it looks like it's getting better.

Thanks for your help! Donna

Posted

I probably didn't get the idea what should be achieved.

The META will ONLY refresh the page and I understand (probably wrongly) that the refresh of calculated field (something like sum field) is required.

RE: server-side vs. client-side.

FM WC is quirky sometimes with this.

If I will set condition in JavaScript IF to go to page A or page B in Head section of HTML page, I was thinking, that browser will do the redirection.

It didn't worked at all!

Then I've discovered, that without HTML comments tag (<!-- JS code -->) it works.

So the WC interprets some of the HTML/JS code and discharges the "JS If" functionality.

On the other hand -- other code with <!-- JS code --> is going through WC as with any other HTML/HTTP server.

That shows me, that some client-side code is being processed in WC.

Posted

In the last 48 hours I read a fairly recent message that described this problem exactly. It was in the CDML section, but I don't have time to track it down for you right now.

The point was, the person seeking help was trying to embed CDML within JS, in order to dynamically compose some of the content of the script, but it was failing. They were advised to remove the html-comment delimiters from around the JS code, and that solved the problem.

Just a caution: I don't think it's accurate to say that WC is "interpreting" the JS code or discharging any of its functionality. I think it's only doing what it does with HTML: looking for embedded replacement tags and replacing them with the appropriate content.

In other words, we can use CDML for server-side assembling of JavaScript code -- just as we do with HTML -- but all the interpretation of JS -- and HTML -- takes place client-side.

Posted

John -- I do not have the problem, I've sorted out that 1-2 years ago smile.gif

I know the WC doesn't process the JS code, but in a way it evaluates it and fill the details or it doesn't do that depending on comment tags.

In another words

This topic is 8281 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.