Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XSL:Call Template

Featured Replies

Does anyone know of a way to call a XSL template from clicking a form button?

Also, is there a way to determine if a form checkbox is checked using XSL:If Test?

What I'm trying to do is to have a template with a loop in it that will run for each record in the found set. It will also add a record to the DB if a certain box in a form is checked on the page using something like:

I need the $hawkid variable to be based off a text field in the form as well.

Anyone know how to do this?

In theory this should all work fine, the problem is just being able to incorporate the form elements into this.

I've also attached the XSL file I'm working with so you can get a better idea of what I'm trying to do here if you like.

Thanks!

Andrew Rinner

Academic Technologies

University of Iowa

formsubmit.zip

I try to understand your code.

Is my assumption correct?

- first a query is sent to some database (I can't see its name) to get the titles of training courses and their associated sessions (which are in a portal)

- on the XSLT page you attached, the form is populated with this information

- the user can select from various sessions by clicking on a checkmark, and then submits this information to another database called sungod. There, the selected session numbers shall not be in a related table, but in a main table (or a table that is related to the user).

Can you confirm this? Then a solution should be possible.

And already a quick answer: No, you can't call a xsl:template from a form. In FMS7A CWP, XSLT is only output-oriented, you can't transform queries with it, they go directly to the database.

  • Author

Martin, what you’ve listed is pretty much what I want to do.

The only thing is that I want to be able to create more than 1 record, depending on which sessions the user clicks on.

(A new record should be created with the user_id and session_id in a sepereate table for each session that the user checks on.)

Any ideas on the best way to do this?

Look at my multiple records example. This might already give a hint ;-)

In the meantime, I try to find a solution.

Sorry, in your case my multiple records example is misleading. Only one related record can be created per request. We have to rethink your solution.

It's the cherry picking case about which I am thinking since two weeks now. It can be rather easily solved with a GET request (however, the length of a GET query is limited), it's however difficult with a POST.

I guess it could work along the following line:

- Submit a token for each session

- on the next XSLT page, evaluate the tokens and add for each token that matches a new record with XSLT document().

See attached file. Not tested, probably not free of typos.

This should work if there are not too many sessions.

In my cherry-picking case I can have >>100 records, and I have to work differently (probably with some JavaScript and separation operators).

submitmultiple.zip

Edited by Guest

  • Author

I was able to get this working actually.

What I did was to load a page that lists all of the possible sessions a person can sign up for in a related set through a portal. It also loads a checkbox that has the name of the checkbox the same as the field name, and the value equal to the session_id.

This page then performs a fine and goes to another page. This page loops once for each record in the found set, and performs an XML request to add each record. There's also a token that's used to hold the user_id to add each record.

Seems to work great!

Oh yes, that's an elegant solution. Did you do the find with -lop=or? What happens if the same session id was assigned to various courses? Is this possible?

I wanted to avoid any find or edit, that's why my proposed solution used tokens to pass the info.

  • Author

Yes I used a -lop=or for this as well in the find query. The way this database is setup is to have a unique session_id for each session, so I haven't run into the 2nd issue you mentioned yet, but it could possibly be an issue when sessions had the same id.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.