Index...
Centrallix Documentation
|
widget/repeat
repeat :: Repeat a subtree of widgets
Metadata:
type: | widget/repeat |
visual: | no |
container: | yes |
form element: | no |
Overview:
The 'repeat' nonvisual widget is used to repeat its entire subtree of widgets for each record in an sql query.
Usage:
This widget has no content of its own, so it is only useful if it has widgets inside it. For positioning of visual widgets inside a widget/repeat, an hbox or vbox (outside the widget/repeat) can be used, or the x and y can be set mathematically based on results from the SQL query.
The widget/repeat can be useful in creating data-driven user interfaces, as well as in facilitating a plug-in architecture in your application. For instance, the SQL query could retrieve a list of matching components to be included in an interface, and the repeat widget could create components, tabs, windows, table columns, buttons, etc., for each returned SQL query record.
Properties:
Property | Type | Description |
sql |
string |
The sql query that will be run on the server |
Sample Code:
$Version=2$
// This is a repeat widget inside a vbox
vbox "widget/vbox"
{
x=10; y=10; cellsize=20; spacing=0;
rpt "widget/repeat"
{
sql="SELECT :name FROM /samples WHERE substring(:name,1,1)='t'";
button "widget/button"
{
type="text";
width=100; height=20;
text=runserver(:rpt:name);
}
}
}
Comments...
(none yet)
Add a Comment...
|