Latest web development tutorials

AppML Caso Prototype

Questo caso studio dimostra come costruire un completo applicazioni Internet <> AppML, con informazioni elencate per una serie di tabelle del database, modificare e di ricerca funzioni.


prototipo

In questo capitolo, costruiremo un modello prototipo per ogni tabella del database.

Prototype è a partire da un molto facile da usare lo sviluppo di applicazioni.


prototipo Modello

In primo luogo, creare una cartella per il prototipo. La cartella è denominata Prototipi.

Quindi, creare un prototipo per ogni tabella nel database.

Utilizzare SELECT * da ogni tabella, e salvare il modello come file XML:

Modello: Proto_Customers.xml

<appml>
<datasource>
<database>
<connection>Demo</connection>
<sql>SELECT * FROM Customers</sql>
</database>
</datasource>
</appml>

Modello: Proto_Suppliers.xml

<appml>
<datasource>
<database>
<connection>Demo</connection>
<sql>SELECT * FROM Suppliers</sql>
</database>
</datasource>
</appml>

Modello: Proto_Products.xml

<appml>
<datasource>
<database>
<connection>Demo</connection>
<sql>SELECT * FROM Products</sql>
</database>
</datasource>
</appml>



vista Prototype

Creare una vista del prototipo, salvarlo come Demo_Prototype.html, e provarlo:

Visualizzazioni: Demo_Prototype.htm

<h1>Customers</h1>
<div id="List01"></div>

<script src="appml.js"></script>
<script>
customers=new AppML("appml.php","Prototypes/Customers");
customers.run("List01");
</script>

Prova »


Ora tutto fuse insieme

Infine, una piccola quantità di codice JavaScript, creare un semplice prototipo prototipo di modello per tutte le pagine:

Demo_Prototype_Views.htm

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="appml.css" />
</head>

<body>
<h1>Demo Applications</h1>

<button onclick='myOpen("Customers")'>Customers</button>
<button onclick='myOpen("Products")'>Products</button>
<button onclick='myOpen("Suppliers")'>Suppliers</button>
<button onclick='myOpen("Shippers")'>Shippers</button>
<button onclick='myOpen("Categories")'>Categories</button>
<button onclick='myOpen("Employees")'>Employees</button>
<button onclick='myOpen("Orders")'>Orders</button>
<button onclick='myOpen("OrderDetails")'>OrderDetails</button>
<br><br>

<div id="Place01"></div>

<script src="appml.js"></script>
<script>
function myOpen(pname)
{
var app_obj
app_obj=new AppML("appml.php","Prototypes/" + pname);
app_obj.run("Place01");
}
</script>

</body>
</html>

Risultati »