Contact Information
+27 11 674 1174

Web Design

We specialize in Joomla! web design, custom templates and Joomla! hosting.  Toxzen also develop custom data driven PHP web applications.

Web Hosting

Affordable Web Hosting services, domain registration and email.  Our business Web Hosting packages are perfect for your growing business.

Creating Pre-Filter pages with Ironspeed

Rate this item
(1 Vote)

Ironspeed has proved to be an application worth owning when designing intranets and websites.  This tutorial will help designers to create a data driven pre-filter page in minutes using ironspeed.

Why would I want to create a pre-filter page?

If you've designed in Ironspeed and are familiar with what it does, then you will know that perhaps you don't want users / clients to see results before they's even started using your application.  There is option to hide results until filtered, but only in the enterprise version.  Creating a page in .NET that populates drop downs and radios with data before being redirected to another results page presents some challenges.  It's actually quite simple if you follow the instructions below...

Creating the filter page.

Ironspeed designer new pageMake sure that the application explorer is open (CTRL+SHIFT+E).  Right click on the folder where the show page is and select New Page.  Follow the instructions of the wizard that appears with the exception of these...  On the Selection Tab choose from Data Entry.  Choose from "Add - Record Label on side" or on top.  Yes we're creating an add record page.  On the Location Tab set the folder where you want the new page saved to.  Set your Options too and go to Finish.  On the Finish Tab make sure that "Launch the panel wizard ..." is ticked.

You should already be familiar with the wizard that opens.  Setup your new Add Record page as per normal, however, select the table or query that contains the data you want to use for pre filtering.  It would probably be the same as the table used for the Show page.  Click Finish.

Editing the Add Page.

Obviously we don't want to save new records but creating this page assists in getting the data we need for filtering.  You can delete the cancel button since it will be of no use.  My "Save" button I double-clicked on and changed the properties to a "Btn:SearchGoButtonText" on the Display Tab.  Click on the Bindings Tab and select Redirect for the "Button Command".  Under "Action After Command" select "Go to sepcific URL:" and set it to go to your Show page.  This will stop it from saving a new record and rather will redirect to the Show page when a user clicks on it.  This doesn't however pass the information being filtered to the next page.  For that we need to customize the .NET code.  Click on the ASPX tab at the top of ironspeed to edit the code.

Ironspeed Designer add page

Look for a section called...

#Region "Section 1: Place your customizations here."

It's in this section that we need to add code that overides the saving action of the button.  The code below relates to the information that I am filtering but is a good example of what you need to do...

Public Sub SaveButton_Click(ByVal sender As Object, ByVal args As EventArgs)

' Click handler for SaveButton. ' Customize by adding code before the call or
' replace the call to the Base function
' with your own code.

HttpContext.Current.Session("sErf") = Me.sErfNumber.Text
HttpContext.Current.Session("sTown") = GetValueSelectedPageRequest(Me.Township)

SaveButton_Click_Base(sender, args)
' NOTE: If the Base function redirects to another page, any code here will
' not be executed.


End Sub

Information selected from the "Township" drop down is stored in a session variable which is more secure than passing it via URL.  This information is retrieved when the user clicks Go / Search and is redirected to the show page.  Overiding the Save action is also a code customization - See the help file or Ironspeed web site for more info.

Altering the Show Page.

The show page needs to read the saved session infomation and then apply this filter to itself.  This again is a code customization (Override the CreateWhereClause) can be found and applied using the code customization wizard.  This code customization is however not found in the ASPX page but rather the Controls.

Ironspeed Designer show page

Find the code that says:

#Region "Section 1: Place your customizations here."

Public Class Qry_AllPropertiesTableControl
Inherits BaseQry_AllPropertiesTableControl

Note: You want to customize the Table control and NOT the Row Control AND this is my code example - yours will be the name of the table you're using!  The following code should be added within this section:

Public Overrides Function CreateWhereClause() As WhereClause
Dim wc As WhereClause

' Call the MyBase.CreateWhereClause() which will include all
' the filter and search criteria selected by user.       
wc = MyBase.CreateWhereClause()

' If MyBase.CreateWhereClause returns nothing
' create a new instance of WhereClause.
If (IsNothing(wc)) Then
wc = New WhereClause
End If           
wc.iAND(Qry_AllPropertiesView.Township, _
BaseClasses.Data.BaseFilter.ComparisonOperator.EqualsTo, _
HttpContext.Current.Session("sTown").ToString())

if HttpContext.Current.Session("sErf").ToString() <> "" then
wc.iAND(Qry_AllPropertiesView.sErfNumber, _
BaseClasses.Data.BaseFilter.ComparisonOperator.EqualsTo, _
HttpContext.Current.Session("sErf").ToString())
end if
Return wc
End Function

In this example the "Township" is required and will never be blank.  I can therefore be sure that there will always be data to filter on.  However the sErf data may be left out and that's why I have used an "If" statement to handle empty data.  The result of not doing this will be that when the user leaves data out your filter page may not return results.  This code retrieves the information saved in the session variables from the previous filter page.  It then filters the results of the current Show page.

You should now be able to Build / Compile your application and test by going to the Add page you created earlier.

Additional Info

  • Software: Ironspeed 5.2.1
  • NOTE: This tutorial requires that you be familiar with Ironspeed 5.2.1 and have a web application ready and tested. There should be at least one "show" page with which we will redirect to. It's also best if you can read or understand VB.NET.
0 subscriber

Comment subscription

Receive email notification when a new comment is added to this item.

Leave a comment

Make sure you enter the (*) required information where indicated.
Basic HTML code is allowed.