05.03.2013 Views

User Guide - NetObjects Fusion

User Guide - NetObjects Fusion

User Guide - NetObjects Fusion

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sorting Data<br />

798<br />

Adding Conditional Statements<br />

You can further narrow your query results or define how and which records are<br />

displayed using the Conditions object. The Where clause filters records at the<br />

database level; the conditional statement queries your Recordset results at the page<br />

level as the page is presented to the user. For example, lets assume that you have a<br />

Students table in your database. You have constructed a Recordset for your<br />

Students table and returned 200 records of students whose major is Psychology.<br />

Now, you would like to display these records on your website; however, you want<br />

to display students at the senior level with a red font to set them apart. In this case,<br />

you can build a conditional expression by searching the Classification field for<br />

Senior. In <strong>NetObjects</strong> <strong>Fusion</strong>, it is possible to create a Conditions object that would<br />

represent the following functionality:<br />

If Classification = “Senior”<br />

Else<br />

EndIf<br />

font = red<br />

font = black<br />

You can add multiple conditions to one expression by including an ElseIf object. If<br />

you wanted to display records of freshman students in a blue font, the resulting<br />

expression would be:<br />

If Classification = “Senior”<br />

font = red<br />

ElseIf Classification= “Freshman”<br />

Else<br />

EndIf<br />

font = blue<br />

font = black<br />

Notice that, like recordset iterators, each expression has a beginning object (If) and<br />

a closing object (EndIf).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!