Link to home
Start Free TrialLog in
Avatar of pcorreya
pcorreya

asked on

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
Avatar of CRAK
CRAK
Flag of Netherlands image

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.
Avatar of pcorreya
pcorreya

ASKER

Hi Crak,

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

Pat
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?
Check in your formula if the field has already got a value.
Hi sjef,

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

Pat
> 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?
Hi Crak,

It is just the first field on the form.

Pat
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
When you submit, redirect the page with the subform name in the URL and assign it to the computed value of hte subform

Partha
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.
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
ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I know, thanks, it was just a cut'n'paste job, some old formula from somewhere.

Scusi...

PS Please re-read your "improved" version ;-))
I have found a work around for this problem, not bothered anymore with using subforms.
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!