Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Help with passing tokens in template page?


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

Recommended Posts

Posted

Wondering if someone can help... I'm trying to pass a token through a few steps using the site assistant's built pages. I can pass it through the first time fine. What is the syntax to pass the value of the token once it has a value?

Example: The first pass through the template:

browserecord.xsl?

-lay=WebProjectSingle&

-recid=

&-token.0=

&-find=-find

This works fine.

Now the second pass:

editevntlist.xsl?

-lay=WebEvntlist&

-recid=

&-token.0=

&-find=-find

Obviously my syntax in the bottom example is wrong. I just haven't really grokked the syntax here yet.

My first real XSL project and any help would be appreciated. (I am getting the XSLT Bible but it hasn't arrived yet.)

Thanks,

Mike

Posted

Well, thanks to some more detailed searching through this forum, I found the answer in one of Martin's plentiful and helpful posts.

Thanks Martin!

:)

Posted

OK, maybe I spoke too soon. It works all the way up to the submit I'm doing, but then the value gets lost and isn't coming through that last step.

Should I use a cookie instead?

Any ideas? Thanks for any help.

BTW, the URL Encode/Decode helped a bunch to get me this far. I just can't seem to carry the token through the submit...

Mike

Posted

Yes, thanks.

Here it is. Note: I got all of this from using the site assistant that comes with fmp8 server advanced. It also includes the utilities.xsl code. I'm not exactly sure what code actually is responsible for the submit, but below here is the code for the field and the submit button.

Another note: the table this submit happens in is different from the table the token originates from, but the XSL files are all in the same directory. Everything works except I want it to return the user to the record they were in when they first clicked on the record in the "portal" that they are now editing and then submitting.

EventAgentLink::Agent Name:


EventAgentLink::Agent Name()

Save Record

Thanks for any and all help Martin. How long have you been doing this XSL stuff anyhow?

Take care,

Mike

Posted

Thanks for the good wishes. It's still not clear to me what you want to do, but let's try ...

Let's assume you have stored your token in a variable:

then you can add another input line to your form:




[b]EventAgentLink::Agent Name: [/b]














EventAgentLink::Agent Name()













Save Record





This way, you can pass your token on.



If you want to return to your previous record after the submit there are different techniques:



- in your page that loads after the submit, i.e. the page defined in the form action attribute, get the original record data by a document() call: 









and later you access the data by reading out the variable $myoriginalrecord

Beware that if you add the fmxml privilege set, you should always use an account/password in connection with it, otherwise the database can be easily read out.

- in the page that loads after the submit, relay to another page by using the HTTP header functions: fmxslt:set_header(). I have attached the multiple records example (posted previously somewhere in this forum) where you can find the relay technique in test_multiplerecords3.xsl. Of course then you can use a similar query as above.

Regarding your second question:

CDML since 1999. XML/XSLT since 2004. The first project was conversion of about 15'000-20'000 FM6 records to a strange ASCII format (USMARC, to be exact). The next beginning 2005 was migration of our CDML based web sites to FM7, which was partially a conversion, and mostly a rewrite from scratch (about 150 XSLT files). A recent project is an AJAX-based webstore, which, unfortunately, due to various reasons, I can not release to the public up to now.

test_multiplerecords.zip

Posted

Martin, I can't thank you enough. Although I've been doing FMP since 1987, I am obviously an XSL novice. Can you recommend any sites with FMP based examples for me to check out? (other than the obvious ones at www.filemaker.com)

It would be great if I could just ask someone with your experience every time I had a question, but I'm sure you have a real life in addition to all of the time you spend answering peoples questions for free...

Alternatively, would it be possible to hire you for a few Q/A sessions either in a chat or a phone type session? I'm in the NYC/USA area and would be happy to reimburse you for your time. We can talk more off list if you'd like.

Not sure what the rules are regarding this kind of thing here, but I think you can get my email from my profile?

Thanks again for your time, I wont be able to look at what you've sent me in detail until Monday, but look forward to attempting to put it to use!

Take care,

Mike

Posted

Martin, thanks for your help. I'm obviously missing something still, so I uploaded the XSL folder that we've created. Please take a look at it if you can, but if not, just let me know. The problem is in the Projects sub-folder. We go to the recordlist.xsl file and it's great. we click on a project ID to go to the browserecord.xsl layout. fine. we click on a portal record (from the evntlist table in the FMP file) and it takes us there. fine. We edit the record. fine. we submit. fine. How do we get back to the project record we were in before? (the browserecord.xsl file).

I know I'm missing something fundamental here and I just can't seem to get it. I wish I had a good bookstore nearby where I could just get a good XSL book...

Thanks again for all of your help so far. I'm sooooo close!

Take care,

Mike

BPIETS.zip

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