> 2- using the demo database, I was able to decipher that all happens with the  
> A4D_On WebConnection.

Good! But not important, you never really have to interact with that.


> So my first question- to have a similar series of pages that are displayed on 
> the demo, do I need to learn Fusebox?

You don't have to learn Fusebox. You can serve pages directly based on their 
path. But if you learn Fusebox then it is easier to structure a web application.


> But no idea how the data gets from the actual database. For example-In 
> Lightning I was use to a callback method that would allow me to create a 
> series of actions.

In Active4D you put the 4D code directly in the web page. This is the standard 
embedded scripting model used by php, jsp, asp, etc. Look at the files in the 
demo, anything within <% %> tags is Active4D code.

The basic control flow in the demo is pictured here:

http://www.aparajitaworld.com/files/Active4D/Fusebox-flow-of-control.pdf

In words, what /vendors/list does:

- Request from browser: /vendors/list
- On Web Connection
- A4D_OnWebConnection
- A4D Execute request
- On Request handler (in Active4D/Active4D.a4l)
  /vendors/list -> index.a4d?action=vendors.list
- index.a4d executes fusebox.core
- fusebox.core method splits vendors.list into circuit.action
- look up circuit "vendors" in fbx_circuits.a4d, it maps to 
/root/demo/app/vendors. root is the web root.
- descend into the circuit directory
- execute /root/demo/app/vendors/fbx_switch.a4d
- fbx_switch matches the action "list" and includes ../fbx_switch.a4d 
(/root/demo/app/fbx_switch.a4d), which is a common handler for several circuits.
- The case statement matches the "list" action and includes 
$circuitDir/models/qry_selectMany.a4d. Look at 
vendors/models/qry_selectMany.a4d, you will see it is all code. That is where 
the query is performed.
-  $circuitDir/views/dsp_list.a4d is included. You will see that is html mixed 
with code. The html is passed through untouched, and anything inside <% %> is 
replaced with the output of the code.

Regards,

   Aparajita
   www.aparajitaworld.com

   "If you dare to fail, you are bound to succeed."
   - Sri Chinmoy   |   www.srichinmoy.org

_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

Reply via email to