Rick,
I am doing something similar.. i.e. if the selection
is one record, then just display the record, otherwise
display a list of records.
You need to be creative, but I've found I've been able
to hack A4D in various ways, and havent run into any
problems.
Performance, is relative.. which is why I embed this
code in the performance intensive pages
$tStart:=milliseconds
.
.
.
some code
.
.
.
` footer section of page
$tStop:=milliseconds
$tElapsed:=(($tStop-$tStart)/1000)
write("Time taken: "+string($tElapsed)+"s.")
[pardon any obvious typos]
it's pretty impressive, when people are used to
waiting 1-2 minutes, in some cases 30 minutes for a
printed 4D report. Now.. most as sub-second pages,
some upto 5 seconds.
--- Rick Hazey <[EMAIL PROTECTED]> wrote:
>
> Perhaps I should have explained what brought me to
> ask the question about include's behavior. Keep in
> mind that I'm still getting the hang of A4D.
>
> Using the demo as my guide, I built forms (form.a4d)
> that had form actions of the same name but the
> extension .a4p. (form.a4p) So when the form is
> posted, the a4p file processed it and then I
> performed a redirect command. Usually back to the
> same page.
>
> But I found that a redirect meant I had to perform
> queries again or keep track of various flags to make
> things happen once the redirect was completed.
>
> It occurred to me that I could simply things by
> making the a4p file look like this:
>
> <%
> query([person];[person]userid = _form{user_id})
> $numRecs := records in selection([person])
> case of
> :($numRecs=0)
> include("create_record.a4d")
>
> :($numRecs=1)
> include("edit_record.a4d")
>
> else
> include("serious_error.html")
>
> end case
> %>
>
> This way I can use the selection created by the
> query and no redirect is needed. Since I might
> include a purely html file, I wanted to be sure
> includes would work like this. I was also concerned
> that performance might be an issue.
>
> Is what I'm suggesting above, a standard practice
> with a4d? Or is there a better way?
>
> Warmest regards,
>
> Rick Hazey
> bitworx, inc.
> ---------------------------
> [EMAIL PROTECTED]
> http://www.bitworx.com
> ---------------------------
> 11924 Sunray Ave. Suite B
> Baton Rouge, LA 70816
> (225) 293-1333 Voice
> (225) 293-1330 FAX
> _______________________________________________
> Active4D-dev mailing list
> [email protected]
>
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
> Archives:
>
http://mailman.aparajitaworld.com/archive/active4d-dev/
>
sincerely,
m|a
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/