Jade Collections & Table Data
Posted: Fri Aug 07, 2009 11:57 am
by ConvertFromOldNGs
by Philip >> Thu, 28 Sep 2000 8:17:10 GMT
Hi,
Does JADE have built in collections like in Visual Basic where you can access a collection of forms, command buttons or text boxes etc. If so, how do i access them.
Also I want to get an Integer value of the number of Instances a Class has, how can I use that in .... lotTable.rows := [number of instances in class lots];
Also I want to populate the table with data, eg.
Lots has a property 'name'
I want to put the property 'name' in all the rows in column 3, but for each row it has to be for a different instance and the rest of the data on the row has to be from the same instance.
Can and how can this be done?
thanks,
Philip Q
Re: Jade Collections & Table Data
Posted: Fri Aug 07, 2009 11:57 am
by ConvertFromOldNGs
by Robert Barr >> Thu, 28 Sep 2000 21:34:00 GMT
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<font face="Arial,Helvetica"><font color="#993300"><font size=-1>Philip,</font></font></font><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>JADE does have these built in collections under the covers, some of which are</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>exposed to the developer.</font></font></font><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Form::controls() allows access to form controls</font></font></font>
<br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>If iterating through these, then you can test for TextBoxes or Buttons - the</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>online help for this method gives a code snippet that does what you want.</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>(Have a look sometime at the online help for the following system classes -</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>they have many 'under the covers' collections and attributes that can be very</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>useful - Schema, Form, Window, Process, Class, Object, ...)</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Instances count - use the Collection::size() method, which returns an integer.</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>You can use the JADE instances collection (which contains all instances of a</font></font></font>
<br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>given class), or your own application specific (sorted or filtered) collection</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>e.g.</font></font></font> <br><font face="Courier New,Courier"><font color="#993300"><font size=-1> Lot.instances.size</font></font></font>
<br><font face="Courier New,Courier"><font color="#993300"><font size=-1> global.allLotsByName.size</font></font></font><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Populating a table - iterate through your collection, calling table.addItem for</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>each row. AddItem() accepts a string, which is the text displayed in the table.</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Separate each column using a Tab character - the lot name will go into column 3</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>in the code below. It can also be useful when adding rows to associate the</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>object (lot) with the row (* below)</font></font></font>
<br><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font color="#993300"><font size=-1><font face="Arial,Helvetica">f</font><font face="Courier New,Courier">oreach lot in allLotsByName do</font></font></font>
<br><font face="Courier New,Courier"><font color="#993300"><font size=-1> table.addItem("" &Tab& "" &Tab& lot.name &Tab& ..... remaining columns</font></font></font>
<br><font face="Courier New,Courier"><font color="#993300"><font size=-1> table.accessRow(table.row).itemObject = lot; (*)</font></font></font> <br><font face="Courier New,Courier"><font color="#993300"><font size=-1>endforeach</font></font></font><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Note the above is indicative only. There's also lots of other options (and</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>gotchas) for a variety of situations, so read the online help for these and</font></font></font> <br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>associated calls.</font></font></font><font face="Arial,Helvetica"><font color="#993300"><font size=-1></font></font></font> <p><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Hope this helps,</font></font></font>
<br><font face="Arial,Helvetica"><font color="#993300"><font size=-1>Rob</font></font></font> <br><font color="#993300"></font>
<br>
<p>Philip wrote:
<blockquote TYPE=CITE>Hi,
<br>Does JADE have built in collections like in Visual Basic where you can
<br>access a collection of forms, command buttons or text boxes etc. If so, how
<br>do i access them.
<br>Also I want to get an Integer value of the number of Instances a Class has,
<br>how can I use that in .... lotTable.rows := [number of instances in class
<br>lots];
<br>Also I want to populate the table with data, eg.
<br>Lots has a property 'name'
<br>I want to put the property 'name' in all the rows in column 3, but for each
<br>row it has to be for a different instance and the rest of the data
on the
<br>row has to be from the same instance.
<br>Can and how can this be done?
<p>thanks,
<br>Philip Q</blockquote>
</html>
Re: Jade Collections & Table Data
Posted: Fri Aug 07, 2009 11:57 am
by ConvertFromOldNGs
by JADE Kid - Ray Hidayat >> Sun, 1 Oct 2000 5:02:48 GMT
Re: Jade Collections & Table Data
Posted: Fri Aug 07, 2009 11:57 am
by ConvertFromOldNGs
by Robert Barr >> Sun, 1 Oct 2000 22:30:25 GMT
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body bgcolor="#E1F4FF">
<blockquote TYPE=CITE> <font face="Arial"><font color="#000080"><font size=-1>Also, the jade news server accepts html. I'm suprised.</font></font></font></blockquote> <font face="Comic Sans MS"><font color="#FF6666">The news server is happy with html, but I'm not sure about users' news readers. This was deliberately experimental - I wouldn't have tried this a year ago, but maybe today, most readers can handle html? No complaints so far!</font></font> <br>
</body>
</html>
Re: Jade Collections & Table Data
Posted: Fri Aug 07, 2009 11:57 am
by ConvertFromOldNGs
by Robert Barr >> Thu, 5 Oct 2000 21:30:11 GMT
I received a message from a user who's newsreader does not support html (and does not want to upgrade), so I suggest submissions are sent in plain text.