Subforms not loading for web application

Hello,

I am writing an application where i have to load computed subforms based on values that i pass in through the url. It appears that when you submit the main form, the subforms get re-computed and loses context. You then get the following error  
HTTP Web Server: Item Not Found Exception - fldEvent [/EventReg.nsf/frmRegister?OpenForm&Seq=1]. I tried several things like using a web queryopen agent to populate a field on the form and then use that in the subform computaion but it did not work either.

Any help in regard to this problem will be greatly appreciated.

Pat
LVL 1
pcorreyaAsked:
Who is Participating?
 
Sjef BosmanConnect With a Mentor Groupware ConsultantCommented:
C'mon, the least you could have given us is the formula we need to get the subform-names from the Query_String. Oh, well, maybe if I can find some spare moment...

Anyway, did you try my suggestion to store the subform-names in one or more hidden fields?

Sjef

.
.
So I created a form, added a Query_String field (Text, Computed for Display, value Query_String), added two fields SF1 and SF2 (also Text, CfD) with values like
    @ReplaceSubstring(@Subset(@Trim(@Right(@Explode(Query_String; "&"); "sf1=")); 1); "%20";" ")
added a field Field1 (Text, Editable) on the form, then added two computed subforms with value SF1 and SF2 (to be taken from the earlier mentioned fields SF1 and SF2). In the two subforms, I added just one text-field. LBNL, I added the Submit-button.
.
Fee Fie Foe Fum... And it works :)

I suppose there is some tiny essential detail you failed to describe...
0
 
CRAKCommented:
Refreshing will make you lose the URL parameter.
Have you tried storing it in a field? Something like:

@If(<fieldname>=""; <retrieve parameter>; <keep current value>)

The field's value can be used to get hold of the right subform.
0
 
pcorreyaAuthor Commented:
Hi Crak,

This part works fine, but when you submit the form it breaks because it tries to recacluate the field again.

Pat
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Sjef BosmanGroupware ConsultantCommented:
Hi Pat,

No, indeed, using LotusScript to compute a field value to be used for the name of a computed subform is impossible. I have the same problem and I'm afraid there's no real solution. Fortunately, you're not using the Notes client but a browser, and then there are possibilities. I forgot the question we discussed this in, but the solution was to use some sort of two-stage approach: the first stage finds out the name(s) of the subform(s), then redirects to a new url that loads the real page.

As far as I know, subform computation using ONLY Formula language will work. So if you disassemble the Query_String in Formula, and use the outcome in subform computation, you get the subforms you want. Now I suppose, in your case, you lose the computed subform names, for you try to recompute them each time. I'd suggest one or more additional fields on the form, text, editable, which you give an additional HTML option: TYPE=HIDDEN. Fill the field when computing the subforms the first time, then the field's value will then be sent to the browser (not to be modified by the user) and sent back to the server to be stored when re-computation is necessary.

Might this help?
0
 
Sjef BosmanGroupware ConsultantCommented:
Check in your formula if the field has already got a value.
0
 
pcorreyaAuthor Commented:
Hi sjef,

The problem that i am having is not when the subforms are being loaded, but when they are submitted things break.

Pat
0
 
CRAKCommented:
> HTTP Web Server: Item Not Found Exception - fldEvent [/EventReg.nsf/frmRegister?OpenForm&Seq=1]

What code does fldEvent contain? Or is there a reference to fldEvent?
0
 
pcorreyaAuthor Commented:
Hi Crak,

It is just the first field on the form.

Pat
0
 
Sjef BosmanGroupware ConsultantCommented:
pcorreya,

> The problem that i am having is not when the subforms are being loaded,
> but when they are submitted things break.

Don't think so. You also have
    ...&Seq=1
Which makes me assume that the form is opened for the second time, and that it fails then, so it doesn't fail when something gets submitted. The Domino server has to be able to evaluate which subforms to load when building the webform, or when storing the received values in a document. It's too hard to give simple directives to get this solved. I wouldn't mind if you'd send me a (working) example-db with the form in it, to try when I have the time. You'd have to do the same for CRAK, or anybody else asking.

Sjef
0
 
p_parthaCommented:
When you submit, redirect the page with the subform name in the URL and assign it to the computed value of hte subform

Partha
0
 
CRAKCommented:
The EE rulebook says to upload it to a (free?) host so everybody can get it. Equal changes for all experts and a higher value (reusability) of this question as PAQ are the reasons.

So fldEvent is the first field on the form. The error message points to it.... there must be a reason. It must be related to the loss of parameters in the URL in a refresh, but numerous fields using those parameters could be cause those parameters. fldEvent or perhaps a formula poining to it would be a good point to start looking!

Like Sjef, I'd like to see what's behind it.... It would certainly cut a lot of chit-chatting short.
0
 
pcorreyaAuthor Commented:
Hello,

This is very easy to simulate. Just create a main form and two subforms with a single field on it. Insert the subform as computed and compute the value from a query string parameter. Then put a button on the main form to save and close. They try loading each subform using the query string parameter and submit. You will get the same error that i am talking about.

Pat
0
 
CRAKConnect With a Mentor Commented:
Sjef,

My tip of the day (freebie!) for you:

if you use Query_String_Decoded instead of Query_String, you won't have to write a parser: %20 is delivered as " " without additional effort. ;-)

With it, the formula
@ReplaceSubstring(@Subset(@Trim(@Right(@Explode(Query_String; "&"); "sf1=")); 1); "%20";" ")
would read:
@Subset(@Trim(@Right(@Explode(Query_String; "&"); "sf1=")); 1)

It'll save you even more work if you need to pass all kinds of exotic characters in peoples names....
0
 
Sjef BosmanGroupware ConsultantCommented:
I know, thanks, it was just a cut'n'paste job, some old formula from somewhere.

Scusi...

PS Please re-read your "improved" version ;-))
0
 
pcorreyaAuthor Commented:
I have found a work around for this problem, not bothered anymore with using subforms.
0
 
CRAKCommented:
Ok Sjef, you got me there!

For anyone reading this in future, I meant of course:
@Subset(@Trim(@Right(@Explode(Query_String_Decoded; "&"); "sf1=")); 1)

Thanks for the points pcorreya. Good luck on your workaround. If it doesn't work out, bear in mind that the solution to the original issue is now available on EE!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.