Documente Academic
Documente Profesional
Documente Cultură
The ability to adapt quickly is everything in this connected age, yet the tools and technologies used to develop sophisticated web-based applications are showing more and more weaknesses as the size of applications grow. A process that has never been either quick or easy is only becoming harder. But, by thinking outside the box, Morfik is redefining?from the ground up?how web applications are built. Morfik is introducing into them technology from other areas of IT specialization such as traditional application development, graphics design, computer-aided design and productivity applications. Morfik is combining elements of all of these areas into the development of web applications in order to make the whole process more productive.
Introduction
Introduction
Introduction
Unprecedented productivity
Many developers have already discovered that Morfik allows them to reach unprecedented levels of productivity in creating sophisticated web applications. In fact, some companies are using Morfik to win contract bids even when the final work is required to be done on a different platform. Thanks to the combination of Morfik's framework, compilers and visual workspace, developers can quickly and easily create great-looking Ajax applications that provide site mock-ups or even fully-functional prototypes for the work they are bidding for. They have a decided advantage over their competitors, who are unable to put together a comparable prototype in the same space of time. Morfik has placed even further emphasis on productivity in version 2.0 onwards. New design features such as Themes and Styles allow developers to quickly perform tasks that substantially which alter the appearance of an application or website without requiring extensive coding changes. Project management and navigation have become much more visual through the use thumbnails instead of plain text lists. Internal tests showed that it is quicker to locate a document by scanning for its likeness than by reading a list. Thumbnails, combined with the ability to filtering the project view, save time and enhance productivity.
A great tool for design 4
Introduction
Related Topics
What's New Your orientation and background Web application development - a general overview Morfik's unique approach to web development High performance web applications
See Also
What you need before getting started Installing Morfik Back to top
Whats_New
Morfik 3 has a number of major and minor new features as well as bug fixes and small improvements. In this topic you will have a brief overview of the major new features with links to topics that go into greater detail about them.
Morfik 3 adds a new type of high level object: Pages. Pages are a visual representation of the concept of the Virtual Page that was introduced in Morfik 2. Using pages it is much more simple to structure a Morfik application and implement most of its navigational organization without writing a single line of code.
Read more...
iPad ready Web applications - With version 3 of Morfik the user can create pages especially tailored to the iPad's screen resolution and input method and have it automatically presented to the enduser whenever he access the website or application from the iPad, while presenting another interface when he access it from a desktop computer, another when access is from an iPhone and still another when it is from a BlackBerry device. Mobile Preview - The Morfik built-in debug browser now offers support for previewing iPhone and iPad applications in their respective pixel resolutions and orientations. Both the iPhone and iPad applications can be seen as if they were in the respective device. The user can alternate which device is being used to browse the application and which orientation from a drop down menu that is available under the device button in the toolbar of the debug browser.
Read more...
Whats_New
The new design time behavior infrastructure for widgets includes support for accessing external libraries in the form of Dynamic Link Libraries.
Read more...
In version 3 Morfik has re-implemented the database access portions of the Morfik Framework in a way that allows for direct connection to databases other than Firebird and ODBC. This means that it is now possible to
New API for Design time behavior of Packages 2
Whats_New
implement direct native access to other databases. Morfik 3 supports native access to the following additional databases:
MySQ L Post gr es O racle MS SQ L Read more
Read more...
pages can also invoke graphical transitions sliding pages in from left to right, right to left, top to bottom or bottom to top. Other Morfik controls, including Container Sets and Subforms, may be placed on any of the pages.
Whats_New
Read more...
Menus
Morfik 3.x introduces a very powerful menu control that can be used to to create menu bars that match just about any page layout you design. Morfik menus allow the user to place individual controls within dropdown menus thus allowing complete freedom to create as sophisticated a menu systems as the user wishes. Among other things it is possible to create menus that pop up the left or right of a menu item, instead of underneath it. It is also possible to define the alignment of the popup menu in relation to the text of the selected option. This allows the user to set for example that the dropdown menu of a menu option that is aligned to the right of the page will also be aligned to the left.
Read more...
Whats_New various languages! Supporting multiple languages on your website consists of two parts: 1. Internationalization ? the process of designing your website in such a way as to make localization possible, and 2. Localization ? the actual process of adapting your site to a specific region or language.
Read more...
Morfik includes built-in support for browser-side image animation and transition effects through the SystemAnimations module. Included in the module are support for Fade, Move, Resize, Resize to Vertical Center, and Resize to Horizontal Center transitions. All these transitions can be combined to create a large variety of transition effects and animations.
Read more...
Project Templates
Whats_New
With Morfik 3, the base template that is used to create a new project is replaced by a functionality that allows you to choose from a set of several pre-built templates. These new templates will help the user to go from a totally new project to a published website much more quickly than previously possible.
Read more...
The improved TextEdit control has a number of new properties to support edit masks for input. Using input masks the developer can control which characters are allowed in different positions when entering text and numbers and also provide display formatting characters. Additionally the TextEdit control can convert the case of initial values to upper or lower case and display special text for empty fields.
Read more...
Whats_New
Whats_New Errors panel has been improved to always show you the full list of compiler errors in your project and to maintain the order of errors reported when the list is changing. This makes code refactoring to be a much nicer experience. If you program against IBO database directly, you might need to add SystemConnectorsIBO unit to the uses section of your module. Morfik BX and Morfik CX: if you use AsString(), AsInteger() and other functions of that sort, you might need to change the code to read AsString, AsInteger (remove the braces) Indy is now obsolete and is provided for backward compatibility only. If you project depends on it, you can download the free package from this page. For new projects please consider using Synapse package instead. FlashUploader, RSS Button, Wysiwyg and Google Maps Morfik 2 custom controls have been removed. Wysiwyg has been superseded with tinyMCE package. We are going to provide packages to replace other controls too. Run-time behavior of continuous editable forms has been altered - changes are submitted to the server when the user navigates to another page or submits them explicitly. Dropdown control can now be resized at run-time. If you have a fixed-size dropdown, you can set its Can Grow property to No for better performance.
Morfik Wiki 3
Whats_New
This entire wiki is in the process of being updated to reflect changes and new features added to Morfik 3 and you will be able to find many topics which have already been updated to reflect conceptual changes. Some topics, specially those that go into extensive details related to how to complete an activity haven't yet been updated due to the need to have all interface changes finalized before revising such topics.
Related Topics
Building your first application with Morfik Identifying and creating your application pages Building navigation menus and linking your application pages Creating Interfaces for the Mobile Web An overview of support for external data sources in Morfik Abstract Data Sources Built-in support for JSON in Web Methods Support for UTF-8 Unicode in Reports
Back to top
Morfik Wiki 3
Your_orientation_and_background
Different individuals with different backgrounds will inevitably have different perspectives on any given topic. Despite the obvious fact that no group is totally homogeneous, people with similar backgrounds and interests are more likely to share views. With this premise in mind, let's consider what certain groups or someone with a specific background should expect from Morfik.
Contents
1 Web designers 2 Web developers 3 Ajax developers 4 Desktop developers 5 Client/server developers 6 Other, more specific groups 7 Delphi developers 8 Visual Basic developers 9 Microsoft Access developers 10 A single tool for all web development needs 11 Related Topics
Web designers
This group includes professional web designers whose work is more focused on the visual aspects of a website than on its mechanicswho do artwork and overall visual design but leave the coding to a programmer.
To the visual designer, Morfik offers a canvas on which to paint a website. A quick look at the BookCollector sample that comes with the product will show that almost no code went into creating that application. Anyone with the skill set necessary to create the overall design for a website should approach Morfik as a design tool to build a website in only a short time.
Web developers
These people work on websites in the development/programming side of things. They sometimes do their own artwork and create sites using scripting languages such as Perl, PHP and Python. Some of them are passionate about their language of choice, while others just use the one that will get the job done. Long-term web developers that are used to a mainstream web development model may question the radically different approach Morfik brings to the table. We ask that you read on with an open mind. Just like any tool, familiarity brings productivity. Although Morfik presents a different way of developing applications, you will find that once you get used to it you will wonder how you ever got by without it.
Contents
Your_orientation_and_background
Ajax developers
Generally speaking, Ajax developers are specialized web developers who know how to use the technique known as Ajax. They already have good knowledge of how to create web applications and may be quite set in their ways.
If you are part of this group, you will like this bit: Morfik still allows you to use Ajax, but presents a different way to do things that will allow you to do more with Ajax, with a lot less effort. Again, familiarity and productivity are closely linked. We are confident that if you take the time to learn Morfik, you will be able to create better-looking, more interactive websites and applications in a lot less time that you can with your existing development tools.
Desktop developers
This group is composed of those who either professionally or as hobbyists develop applications for desktop platforms such as Windows, Linux or OS X. If you fall into this group, especially if you are a professional developer, you should feel right at home with Morfik. In introducing Rapid Application Development (RAD) aspects into web development, Morfik has developed a tool that works in a similar fashion to visual development tools such as Visual Studio, Delphi and NetBeans. In fact, Morfik has expanded on this base without making the resulting environment any harder to use.
Client/server developers
Client/server systems share traits with desktop applications as far as interface development goes, but add more complexity when processing is shifted from the client to the server. These systems were among the first in line for replacement by web-based applications, but in many cases they are still the heart of a company. Developers familiar with these systems should feel comfortable working with Morfik as they will appreciate the similarity to traditional desktop development environments and should have no trouble adjusting to how Morfik uses Web Methods to invoke server-side processing. Morfik could even be described as a tool for developing client/server systems, where both the client and the server use only web standards technology.
Delphi developers
Ajax developers
Your_orientation_and_background
Experienced Delphi developers often shield away from writing web applications for centralized models because of lack of familiarity with web development tools. If this sounds like you, it is time you took a look at Morfik FX.
Traditional web development utilizes text editors with HTML syntax highlighting and maybe some help with tags. There is little in the way of concepts or usage that helps a developer become more productive. Let's be honestafter working with Delphi for years these web development tools can be downright disappointing. Morfik, however, allows the use of Object Pascal to program not only the server side of a web application, but its browser side as well. Morfik 2.x has an advanced Form Designer and a large number of design-related features added to its visual editors. Programming a Morfik application is, in many ways, very similar to programming a Delphi application. The Morfik Framework uses many concepts that will be immediately familiar to any Delphi developer, from high-level objects such as forms to the smaller helper classes such as string lists. To get a better sense of just how familiar Morfik should feel to a Delphi developer, take a look at the source code for one of the Forms in the Morfik FX BookCollector sample application. A careful examination will reveal that although there are some differences to the source code of a unit that contains a Delphi Form, there are obviously many more similarities. Morfik compiles a web application into JavaScript for the browser side and into a binary executable (or plug-in module) on the server side. A Delphi developer who wants to create a web application with Morfik can choose to use almost any licensed version of Delphi as the back-end compiler for Morfik. There is no need to make changes to an application's source code to switch back and forth between back-end compilers, so the user can freely choose whichever one is most suitable at the time. This makes it easy to use, for example, Delphi to compile an application for Windows and FreePascal to compile the same application for Linux. Delphi developers can quickly become productive in creating sophisticated web applications, web services and even browser-only applications. In fact, Morfik is the easiest, most powerful path a Delphi developer can choose to create Ajax web applications while retaining familiarity with language constructs, framework and environment.
If you are a Visual Basic developer who is yet to create web-based applications, it may be because you find the available tools to be unsatisfactory. Again, let?s be honest. After working with visual design for years, text editors with HTML syntax highlighting and help with tags are a poor excuse for a development environment. Experienced Visual Basic developers should have very little trouble becoming productive with Morfik BX. This version of Morfik allows you to write not only the server side of your application in Basic, but the code that will
Delphi developers 3
Your_orientation_and_background
run within the browser as well. This simple thingthe ability to write all the code in a single, familiar language and work with everyday concepts such as forms, code modules and reportsshould enable you to quickly start building sophisticated web-based applications.
The Morfik development environment, many of its database-related concepts and the Morfik Framework have been closely modeled on similar features in Access. The multi-band Forms and the stored queries with their visual designer are two such examples. Morfik's choice of built-in database engine was also, in someways, influenced by Access. This is because Firebird provides the same ease of movement, having the entire database contained in a single file, as you get from an Access MDB file. For more advanced Access users who access a database through SQL commands, you will will be pleased to know that despite being a lightweight database server, Morfik's built-in database is a fully-fledged relational database with extensive SQL support.
Related Topics
Introduction to Morfik What's New Web application development - a general overview Morfik's unique approach to web development High performance web applications Back to top Visual Basic developers 4
Web_Application_Development_-_A_General_Overview
When the World Wide Web burst into public attention, creating websites and web pages was a novelty. It wasn't particularly difficult; it was just something a bit different. Web pages were created using HTML (Hypertext Markup Language), a format especially created for academic uses where documents often contained references to other documents. HTML files were no more than text files that included special character sequences, called tags, used to indicate how specific portions of the documents content should be displayed. In fact, in 1994 Windows Notepad was one of most widely used applications for editing HTML content. This extreme simplicity was key to the Web's rapid growth.
Contents
1 First Generation web applications 2 Ajax enters the scene 2.1 Not a new technology 2.2 Ajax gets noticed 2.2.1 Google Maps 2.2.2 GMail 3 The evolution of web applications 3.1 The server side evolves 3.2 Front-end alternatives 3.2.1 Adobe Flex and Flash 3.2.2 Microsoft Silverlight 3.2.3 Ajax and web standards 3.3 Rich Internet Applications 3.3.1 Independence of runtime 3.3.2 Tightly controlled environments 3.3.3 iPhone 3.4 Making a choice 4 The coding of Ajax applications 4.1 JavaScript Synthesis Technology 5 The Web as an operating system 6 The future 7 Related Topics
have to enter everything again. Not all applications even checked for errors, so often incorrect information would
Web_Application_Development_-_A_General_Overview
be stored and later processed. Things improved when it became possible to handle small processing chores within the browser. To protect against malicious code, any execution was done within a very controlled and restricted environment with no access to the computer's private data. Any code embedded within a page was limited to accessing information only within that page. The small executable scripts were in the form of a language called JavaScript. This quickly grew in popularity due to the overall improvement in the user experience, and soon became an almost de facto requirement for good websites.
Google Maps
The impressive Google Maps was a stunning first example of what was truly possible within a browser environment. All previous attempts at bringing high quality satellite imagery to the Web had been burdened by the need to load huge images every time the user wanted to look at a different location. Google Maps broke with that by fragmenting the images into small pieces that were dynamically requested and received by the page within the browser. These fragments loaded much faster than a large picture and also allowed the user to move around the map and zoom in and out. The experience was amazing, compared to what was previously considered possible, even though the underlying technology had been available in the major browsers for quite some time.
Web_Application_Development_-_A_General_Overview GMail
Google's GMail, a free email service, had simplicity of use, and an impressive responsiveness made possible by Ajax. GMail was implemented as a single web page that transforms to meet the user's request. Emails appeared in a list, and if one was clicked the page transformed to show the full text of that message. The message body appeared within the space previously occupied by the message list. The page transformations required smaller amounts of data to flow through the Internet connection; this was much faster than a full page reload. Not only that, but it also avoided the 'blinking' sensation that occurred when an entire new page replaced one that displayed much of the same content. While GMail did not replace other established players such as Hotmail and Yahoo Mail, its improved online experience set a new standard to which all such services would be measured. Most importantly, Google demonstrated that Ajax-powered pages could provide the end user with a better browsing experience.
Front-end alternatives
The number of Internet users continued to grow, and soon there were several different approaches to providing the richer, more interactive experience that users wanted. Of these, three have distinguished themselves through wide adoption, the size of the effort put into them and by the size of their respective vendors.
GMail 3
The fact that users wanted more responsive applications didn't go unnoticed. Adobe, who already had in its portfolio the Flash plug-in for browsers, decided that it could increase responsiveness by replacing the browser's rendering engine with its own, reducing the role of browser to simply a launcher of applications. For years, the Flash plug-in had been widely used for creating animations and charts. It could now also be used for creating small games that could be played over the web without needing to install anything on a local machine. Adobe promoted Flash as a better platform for creating interactive and responsive Internet applications. Not only that, but it created a whole set of extensions to Flash and eventually revamped the whole engine behind the plug-in, introducing Flexessentially a layer that sits on top of the Flash engine and is geared towards the creation of applications. Flash and Flex allow the creation of very attractive applications, but they can be perceived as 'foreign' to the web experience unless they fulfill a particular role within a normal HTML page. The videos on YouTube, for example, are presented with Flash, but the page itself is still created using basic web standards such as HTML and CSS. If the entire YouTube page was created with Flash it might look better, but would in subtle ways seem 'different' to the end user. Also, movie titles, author, comments and other information displayed on the page would not be accessible by search engines. Flash plug-ins are also automatically blocked by firewalls in many businesses and schools because of the abundance of Flash online games that are now available. This practice restricts developers who want to use small touches of Flash to enhance the overall experience of a website. Plug-ins are also a problem for sites that are likely to be accessed through mobile devices. The Apple iPhone for example, which is currently one of the most used web-enabled phones, does not support plug-ins. More recently Adobe has pushed forward with an additional technology set called Air, a runtime that supports the execution of Flash and Flex-based applications outside of the web browser. Despite these advances, there seems to be no widespread movement to adopt Flash-based technology outside of its traditional role of providing graphics and animation within the context of a web page. In fact the increasing number of users with mobile devices running Apple's iPhone OS such as the iPod Touch, the iPad and the iPhone itself has been increasingly discouraging companies from adopting or even maintaining that technology.
Microsoft Silverlight
As Flash moved from being tightly focused on graphics and animation to becoming a platform for applications, Microsoft reacted to counter what it perceived as a threat to its overall dominance in this area. Its response came in the form of Silverlight, which creates interactive content like Flash and Flex, but allows such applications to run outside the web browser like Air. Silverlight has so far shown no signs of becoming the standard interface for the Internet applications of the future that Microsoft had hoped. It is used on several websites for video streaming, but this usage is similar to that of Adobe's technologies; it is used to complement the features in the browser rather than fully replacing them. Not surprisingly, as a plug-in it suffers from the same inconveniences as Flash and Flex, but it does have a much smaller installed base than its direct competitor.
Web_Application_Development_-_A_General_Overview Ajax and web standards Ajax and the technologies that represent the web standards are taking a comfortable lead as the technologies of choice for building more interactive and responsive websites. These technologies are implemented directly by the browser and do not require the installation of a plug-in. This makes a huge difference to the accessibility of a website. Anyone with web access can interact with a web application built using Ajax techniques, but the competing technologies all require the end user to install supporting runtime.
Independence of runtime The major weakness of plug-in based technologies is a dependency on a specific runtime, and there is no guarantee that this will be present in the end user's computer. Many enterprises impose very tight controls on the installation of plug-ins and other runtime environments out of concern that they may be used to run code designed to bypass security measures. Educational organizations such as schools and universities often block access to plug-in based applications, so the best option is to develop for only the default capabilities of the browser. This will ensure that your application will be accessible from the organization's network.
Tightly controlled environments There are a small number of organizations that are so concerned about protecting their intellectual property that they even disable JavaScript within pages. This will prevent Ajax applications from working, but as Ajax is now so widespread the number of organizations that go to this level of restriction is very small.
iPhone
Web_Application_Development_-_A_General_Overview In the two years since its introduction the iPhone has become a web access platform to be reckoned with; most polls indicate a slice of over 50% of all mobile web access. iPhone sales continue to grow and show little sign of slacking off, so it would seem foolish to create online applications or websites that could not be accessed from such devices. Mobile browsing is likely to become even more important in the future, and while Adobe and Microsoft are trying to get their RIA platforms supported in these devices, they are unlikely to become standard.
Making a choice
Morfik has always aimed to provide the best way to create sophisticated applications that can be accessed through the browser. After careful analysis and consideration of existing technologies, Morfik developers have concluded that it would be beneficial to embrace a broader, less restrictive idea of standards. Both Adobe's and Microsoft's RIA solutions rely on plug-ins, which can be blocked and whose content cannot be indexed by search engines. As such, they are a poor choice for projects that aim for information visibility and accessibility. Plug-ins however, can still play an important role; they can be imbedded and used within standards compliant content to help address specific problems where the standards are inadequate. Ajax, while a good alternative, still has its problems in mainstream usage as the content it generates is not considered search engine friendly. Morfik has recognized this and has developed a tool set to work around this issue.
Web_Application_Development_-_A_General_Overview Script#. The entry of these industry giants into the game seems to ratify the approach already taken by Morfik and confirm that higher-level languages will undoubtedly play a significant role in the future development of browser executable code. GWT and Script# follow similar lines for compiling higher-level languages into executable script, but Morfik's aim is much greater in scope and it has been developing in this area for a lot longer. Morfik offers a much broader tool set capable of much more than just language translation. Language is just one issue to consider when empowering developers to become more productive. Morfik believes that by raising the abstraction layerboth in regards to JavaScript and to many other underlying web protocols and formatsdevelopers are freed from having to worry about the nuts and bolts of a web application much in the same way that they seldom need to worry about how the Windows GDI or the ODBC APIs work. The Morfik compiler not only generates the JavaScript code, but it also produces supporting HTML, CSS and even images during the compilation process. A high-level language developer using Morfik does not need to worry about how the HTML and CSS work; similarly the visual design aspects of the tool allow developers to create visually impressive applications without the need for a graphic designer.
Web_Application_Development_-_A_General_Overview
Morfik calls this the WebOS, and Morfik was created to enable applications to be construction as easily for this platform as they can be for Windows. The visual tools featured in Morfik are actually reminiscent of those used for creating Windows applications. Sophisticated applications can now be developed for the feature-rich WebOS platform, regardless of the underlying operating system, bringing a whole new paradigm shift in the development of web applications. A few tweaks to a configuration parameter and the same applications can be deployed to a server as a centralized application for a department or small business; or to a server farm to handle huge amounts of traffic and concurrent usage for a high traffic website or corporate intranet environment, and Morfik even allows web applications to become desktop applications with virtually no additional work.
The future
Current work in defining new and more powerful standards for the browser hint that in the future, more powerful and sophisticated applications will be delivered by the Web. Recently, Google showed the first screenshots and released details of of its ChromeOS. This only runs on specifically designed hardware, providing the necessary services for the Chrome browser, inside which all applications will be run. While this is not the first attempt at this type of system, it is relevant that it is pushed by one of the largest companies in the Web landscape. It is still too soon to tell how things will play out for this initiative and others which will undoubtedly follow. Will the future will be one in which we continue to use local applications alongside web-based one? Will all data reside in the cloud and all applications work in the browser? As we travel towards this undiscovered territory, one thing seams clear: Ajax-based applications are here to stay.
Related Topics
Introduction to Morfik What's New Your orientation and background Morfik's unique approach to web development High performance web applications Back to top
Morfiks_Unique_Approach_to_Web_Development
Morfik brings a unique approach to web development as it continuously questions the traditional approaches, and challenges established paradigms. To understand Morfik, its differences, advantages and the way it works, it helps to have a clear image of how and where Morfik uses different technologies to build your application.
A choice of programming languages Morfik believes that developers should have freedom to choose to work with a programming language syntax with which they are already familiar. Morfik strives to provide the closest implementation possible of several commonly used programming languages, within the bounds required by the underlying Morfik Framework. The languages currently supported are: C#, Object Pascal and Basic. Integrated design and developmentOther companies work to separate design and development, with a focus on corporations with stratified teams. Morfik focuses on the small and medium size teams advocated by modern agile development techniques, and brings design and development together in a unique approach to application development. The design-oriented features take away the need to write a lot of code for basic user interface design.
Morfiks_Unique_Approach_to_Web_Development
A page and form-based interface design metaphorInstead of using the traditional simplistic 'page' metaphor which is poorly suited to component-based, modular design, Morfik adopts a combined page and form-based metaphor. In Morfik, a Form can represent large sections or just a small portion of a page and it will be used to compose a larger page object. Page objects aggregate several different forms to compose the whole 'page' the end user will see in his browser. True WYSIWYG designMorfik's advanced visual Page and Form Designers offer what is by a large margin the most authentic What You See Is What You Get design environment in the industry. Dependency awarenessThe Morfik development environment is highly aware of the dependencies between different documents and objects within a project. This awareness allows Morfik to update references to reflect user-made changes and present warnings on when removing a document/module from the project might result in broken references. A single tool for all web development needsMorfik combines into the Form Designer just about all graphic effects that might be required to create a specific design. Morfik leaves to specialized tools such as Photoshop or Gimp only what might be described as artistic work. Images necessary for shadows, glows, borders, corners and gradients are done automatically when a project is compiled. Morfik also provides, out-of-the-box, a fully functional, freely deployable, relational database and the visual database design tools for creating tables and queries. High performance server-side codeWhile providing visual development features and working to make the developer's job as easy as possible, Morfik also works to provide a high performance and scalable server architecture. Morfik produces native binary applications for its target platforms and the Morfik Framework and development environment promote the creation of totally stateless applications that can easily be deployed to a server farm for load balancing.
Morfiks_Unique_Approach_to_Web_Development
Browser side
The browser side of your application is the client portion of your system. It will be responsible for the application's interface and will communicate with the server side of the application to request processing and handle results that are sent back. This portion of the application resides entirely inside a page being rendered in a web browser. It is therefore limited in functionality to what is allowable within the confines of script execution within the browser. Although the restrictions are many, due to security concerns, a lot can still be accomplished within a modern browser. Developers from other backgrounds should be aware that everything happens asynchronously inside the browser. The code you write, or which is generated by Morfik, on the browser side of your applicationbe it in Pascal, C# or Basicwill get compiled to JavaScript so it can run inside the browser. The compiler will also generate a combination of HTML, CSS and images for the browser side of the application. These are all part of the established W3C standards for web content and work with all browsers.
Note: You still need to be aware that some browsers do a worse job than others when rendering pages and that some of these aspects are beyond even Morfik's control. For example: Internet Explorer (all versions) does a remarkably bad job of rendering semi-transparent HTML elements. In some cases, you just have to refrain from using this kind of feature if you want your application to look good in Microsoft's browser.
Server side
The server side of your application is always a native binary for the platform of your choice. Morfik's decision to use native code in the server side of the application ensures that you will have a low footprint, high performance application. In order to achieve compatibility with multiple platforms and still provide the best performance, Morfik makes use of the FreePascal compiler for the final phase of its compilation. First the code, in any of the three supported languages, is processed and a detailed map of its content is built. Morfik then generates what is called intermediate code in Object Pascal. This code is then compiled directly to the appropriate binaries for Windows or Linux. The binaries can be either a stand-alone executable, which will work as a web server, or as a binary extension module for Microsoft's Internet Information Server or the Apache server. Due to the fact that the final binaries are produced by a slightly modified version of the FreePascal compiler, it is possible to link external code that is compatible with that compiler into the server-side portion of a Morfik application. This could include code created specifically for FreePascal or libraries that were created for use with Delphi, but are also compatible with FreePascal. Morfik applications are, by default, 100% stateless on the server side. What this means is that from the moment you create your application you are ready to deploy it in just about any situationfrom your personal notebook to a server farm. You can take it with you on the go, or have it up and ready to service a large number of users.
Note: All Morfik code is stateless on the server side and the code that is created by the Morfik development environment directs or induces you to write any additional code in a way that
Browser side 3
Morfiks_Unique_Approach_to_Web_Development
retains that condition. It is possible for you, however, to write code that will deviate from this by creating code that is dependent on a server-side global variable. You should avoid declaring global or module level variables on the server side of the application to ensure that the application remains stateless with the scalability advantages that architecture offers.
Database
Morfik has at its core the idea that most useful web applications will make extensive use of databases. Database access and the display of database-stored information is very easy with Morfik and is part of its visual design philosophy. Through an industry standard ODBC connection, a Morfik application can connect to several different databases. Morfik also provides, 'out of the box', a fully functional relational database server. This server is an open source database called Firebird which can be freely distributed with your own applications.
Built-in database
In line with its view of the importance of databases, Morfik will, by default, create an empty database for any new project. The Morfik .MXD file is compatible with the database format of the supplied Firebird database server. This will be the project's main database and from within the Morfik development environment you will be able to create new tables and queries that access those tables. Morfik provides a Table Designer and a Query Designer that can be used to create these objects. If you are fluent in SQL you can opt to create what is called a pass-through query by writing its SQL code directly. If you are creating a project that does not need to have its own database, you can specify this in the options dialog. In this case, the application will not attempt to connect to the Firebird database and you do not need to deploy it along with your binaries.
External databases
If you need to access a database which is not the default project database, then it is an external database. In Morfik parlance, any database which is not the default database is called an external database, even if it is another Firebird database. External databases can be of two kinds: Firebird or ODBC. Through an ODBC connection you will able to access almost any kind of database including Microsoft's SQL Server or MySQL.
Note: In accessing a non-Firebird external application, your experience may vary according to the implementation of the ODBC driver you are using.
The following diagram is a simple reminder of which technologies are used in each section of a Morfik application.
Server side
Morfiks_Unique_Approach_to_Web_Development
Visual design
At the heart of a RAD approach to developmentbe it desktop, client/server or Weblies a visual designer. This is where your interface takes shape and where you decide what happens when the user interacts with different elements.
External databases 5
Morfiks_Unique_Approach_to_Web_Development If you choose to create a new web application project from the system menu (round button with a 'power' icon), you will get a skeleton application composed of a couple of pages and forms. This is the basic template Morfik has provided to get you started.
Form Designer
One you have created a new project, double-click on the Index Form thumbnail in the Project View of the Morfik development environment and you will see what is essentially the startup page for your new project. You can view and select from a gallery of themes by clicking on the Design Tab at the top of the main window.
Visual design
Morfiks_Unique_Approach_to_Web_Development
You will notice that the entire look of your application changes as you hover the mouse over different themes. Changing a theme allows you to change pretty much all aspects of your application's visual appearance almost instantaneously.
Note: You are not limited to the themes that are provided; you can also create a totally new theme or
alter an existing one. Themes you create can be exported and imported into other installations of the Morfik development environment, in other computers. Once you have selected a theme, click on the Run button (round green button with a 'play' symbol on it) to compile and run your application. Status information will be displayed in the Output Panel that appears on the bottom of the main window. Once the application has finished compiling it will be run inside the Morfik Debug Browser. The Morfik Debug Browser is built on Mozilla Firefox technology and is tied into the Morfik development environment so as to allow you to more easily test and, if necessary, debug your application.
Visual design
Morfiks_Unique_Approach_to_Web_Development
As can be seen in the screenshot, you can get a totally new application, customize its appearance in a couple of minutes and in a couple more have it up and running, without ever writing a line of code. Development doesn't get much more visual or more rapid than this.
Morfiks_Unique_Approach_to_Web_Development When you first create a blank Form you see something similar to that shown in the following figure. At the top there is a Header Band and at the bottom there is a Footer Band, while in between them you have the Detail Band.
A new Morfik Form Elements that are used on a Form to create the interface of a page or application are always Controls or Widgets. Controls are the basic elements; the building blocks for everything in Morfik. Widgets, on the other hand are normally built from several Controls. Controls such as TextLabels, Containers, Rectangles and TextEdits can be placed on any of the Bands of a Form and arranged and configured so that your pages or the interface for your web-based application will look as you want. The following screenshot shows the Index Form from the BookCollector sample application, which is provided with Morfik, at design time. The highlighted area indicates where a SubForm control is placed.
Morfiks_Unique_Approach_to_Web_Development
Using SubForms in Morfik You can also see in this figure how Controls are arranged on each of the three Bands of the Form. In this case they follow what is a very common pattern in websites which is to have the navigation options at the top in the Header Band. At the bottom you have the general kind of messages you normally see at the end of a page, as well as some design elements that complete the general design. These elements are in the Footer Band of the Form.
10
Morfiks_Unique_Approach_to_Web_Development
Header, Details and Footer Bands in Morfik Forms You can connect Forms to data sources, which can be tables or queries, so that you can create your design without actually having to place content into the design. This allows for the decoupling of data from design and, as you can compose a page with multiple different Forms, it becomes easy to have pages that show data from multiple distinct data sources.
11
Morfiks_Unique_Approach_to_Web_Development
The Main Form in Mapping-Device sample project, in Design View In doing so, Morfik created a development environment powerful enough to allow a professional designer to create almost any design, but is also simple enough that people without design experience can master its use and create great-looking websites and interfaces for web-based applications.
Rapid prototyping
Due to the speed at which Morfik allows the creation of sophisticated interfaces for web-based applications, it can be used very effectively as a powerful prototyping tool. It is not uncommon for a developer to create, in a couple of days, a mockup of a much larger application. This can be used as a valuable tool to validate a design with the end users before the actual work of creating the application begins. By the same token, Morfik can be a valuable tool for conducting Joint Application Design (JAD) sessions with end users. These sessions, advocated by some agile software development methodologies, can happen with live feedback on how certain design ideas will play out when applied to the real application. Whether you are designing a website, a complex web-based application or simply prototyping a proposed application, Morfik makes visual design and graphic design foremost within the developer's user experience. As you master its use, Morfik will enable you create great looking, powerful applications in shorter time than you would think was possible.
Related Topics
Introduction to Morfik What's New
Rapid prototyping
12
Morfiks_Unique_Approach_to_Web_Development Your orientation and background Web application development - a general overview High performance web applications Back to top
Related Topics
13
High_performance_Web_applications
Why does performance matter? As it turns out, depending on what you are doing, it doesn?t. On the other hand, again depending on what you are doingit can be critical. Business success, particularly for websites that work within a media-rich environment or process millions of requests per day, can depend on performance.
Contents
1 Interpreted vs. native code 2 High performance server code 3 Low memory utilization 4 Related Topics
High_performance_Web_applications
Most of today?s effective implementations of a cloud computing environment rely on hypervisor-based virtual machines and thus effectively sandbox applications of one user from those of other users. In this scenario, running an additional level of virtualization and sandboxing is at most times irrelevant from a reliability point of view while still affecting performance.
Related Topics
Introduction to Morfik What's New Your orientation and background Web application development - a general overview Morfik's unique approach to web development
What_You_Need_Before_Getting_Started The Morfik development environment has been developed primarily to fast-track the process of building user-friendly, interactive web applications. Developers can code with familiar high-level languages such as C#, Pascal and Basic, and the Morfik compilers will generate all the JavaScript code, HTML and even many of the visual elements required to implement the application. Ready-made functions in the form of widgets and packages can be plugged in to easily add function to your application, and the use of themes makes it easy to update and customize its appearance. In fact, the slowest part of developing with Morfik?as with all new tools?is working out how to use it. Once you?re past that stage, you?ll wonder how you ever managed without it. So, what is the best way to get productive as quickly as possible?
Install Morfik
Check that your existing system meets the requirements for installing Morfik and then download and install either the evaluation or full version of Morfik. Installing Morfik ...
Note: Information is arranged logically into sections about important areas such as the user
interface, databases and deployment. These sections generally start with a very useful overview of the topic.
Install Morfik
What_You_Need_Before_Getting_Started
Note: Morfik takes quite an innovative look at many of the 'old-school' approaches to web application development and some of the terminology and abstractions used can take a bit of getting used to. At any time when using Morfik, pressing F1 will take you to the relevant Morfik wiki page. For example, you might want to know more about a menu that appears when you hover over the Ribbon, or about an object that you have selected. This context-sensitive help is only available in version 2.4.
Stay informed
The Morfik Developer Assist program responsible for these add-ons also produces a regular newsletter with the latest Morfik news and links to the latest add-ons. If you have not already done so, register here to access the add-ons and receive regular updates from Morfik Development Assist. Morfik developers and management also share release news and company developments through Morfik Blogs. Users also have a chance to comment and ask questions through this forum.
So there you have it. Make the effort to get started with Morfik, and you will find that you can product interactive web applications faster than ever before. Enjoy.
Related Topics
Installing Morfik Customizing the environment Getting to know Morfik application workspace Building your first application with Morfik
Installing_Morfik
Morfik is only available as a download, and the installation steps are identical for both purchased and trial versions.
To install Morfik:
1. Open the downloaded Zip file with a tool such as WinZip? or other compatible program. 2. Double-click the .EXE file. 3. Follow the instructions and prompts in the Setup Wizard to complete the installation.
Note: Morfik installs into C:\Program Files\Morfik folder on 32-bit Windows systems, and in the C:\Program Files (86)\Morfik folder on 64-bit Windows systems. Morfik is itself a Win32 application. To start Morfik:
Either double-click the desktop icon (if created by the installer) or single-click the taskbar speed button (if created by the installer).
If you purchased Morfik and are starting it for the first time, you will be prompted for your Serial Number when the program starts. You will find your Serial Number in one of the emails you would have received from Morfik after completing your purchase.
Related Topics
What you need before getting started Customizing the environment Getting to know Morfik application workspace Related Topics 1
Related Topics
Customizing_the_Morfik_Environment
The Morfik workspace can be configured to better suit your needs and the way you work. There are many configuration options covering everything from the appearance of the interface to how the compilers behave. For detailed information about customization, please refer to Morfik Options and Preferences. One of the first things you might want to customize is the color scheme used by the Morfik workspace, as this could have some influence on the design of your project. You can change the color scheme directly from the Welcome screen.
Figure 1: Color scheme selector in the Home tab of the Ribbon when no project has been opened.
Customizing_the_Morfik_Environment
Related Topics
What you need before getting started Installing Morfik Getting to know Morfik application workspace Building your first application with Morfik
Morfik_Application_Workspace
The Morfik application workspace provides an effective way for you to interact with project documents, properties and code. Morfik uses the Ribbon interface along with document thumbnails in Project View to provide an effective design environment capable of accommodating the needs of visual programming and graphical design. The workspace places most of the commonly executed operations onto its highly visible toolbar so that you can easily make changes to your project and documents. The application's main toolbar provides access to most of the project and document management features as well as document formatting and graphical design.
Workspace layout
The Morfik workspace is divided up into areas as indicated by the numbers in the diagram below.
Clicking on different sections of the Workspace takes you to the relevant topic
Workspace layout
Morfik_Application_Workspace
The Power Menu contains the following options (sub-menu options are denoted by the | symbol): New Project | New Web Application New Project | New Package New Project | New Project Wizard New Page New Item | New Form New Item | New Report New Item | New Table New Item | New Query New Item | New Module New Item | New Web Method New Item | New Widget Open Close Close All Save Save As | Save As
1 - The Power Menu 2
Morfik_Application_Workspace
2 - Run Button
The Run Button appears to the right of the Power Menu. The Run Button is used to start, stop and pause your application.
Morfik Run Button The Run Button is only enabled when a project is open, and toggles between 3 different states:
State 1Press to compile and start the application; State 2Displays when the application is running. Press to halt the application; State 3Displays when the debugger encounters a breakpoint. Press to continue
application execution without stepping into/through any remaining code.
To configure the Quick Access Toolbar, press the Customize Button (as shown above) to display the Customize drop-down menu with the following menu options:
2 - Run Button
Morfik_Application_Workspace
List of Currently Configured Commands More Commands... Show Quick Access Toolbar [Above | Below] the Ribbon Minimize Ribbon
4 - Ribbon
The Ribbon is the main toolbar of the Morfik workspace. Morfik has adopted this taller toolbar to better display graphically rich information about themes, layouts and color selection. The tabs on the Ribbon display the commands that are most relevant for each of the task areas in the applications. Following is a list of tabs in the Morfik Ribbon.
Morfik Ribbon
Home Tab Design Tab Project Tab Debug Tab View Tab External Data Tab Insert Tab
Morfik_Application_Workspace
5 - Project View
The Project View displays the objects that are contained in your project such as Forms, Reports, Tables and WebMethods. It also provides a highly visual reference for managing these objects, including the ability to create new objects and edit existing ones.
Project View
Note: You can activate Project View at any time by using Ctrl+Alt+P keyboard shortcut.
Documents that are visual in nature are by default represented by a thumbnail image. This makes it easy and fast to locate specific Forms and Reports in projects with a moderate number of objects. Figure XX shows the Project View for a small project. For projects with many similar documents it is sometimes best to use the filtering option that is available from the Home Tab of the Ribbon when you are in Project View. In Figure xx you can see the Project View of a project and the filtering mechanism being used. In this example, documents and objects containing 'staff' in their name 5 - Project View 5
Project View with filtering in use To see many objects on screen at the same time, reduce the Zoom Factor for the Project View. This option is available from the Home Tab of the Ribbon. Reducing the zoom level will lead to all thumbnails being replaced by small icons to allow more objects on screen at the same time. Figure 4 shows a project view at its minimum zoom settings.
5 - Project View
Morfik_Application_Workspace
Note: You can also hold down the control key and use the mouse wheel to zoom in and out of Project View.
Designer/Editor
The Designer/Editor enables you to perform graphical design work on your objects (such as Forms and Reports) and work on the code behind those objects using a powerful text editor. The area at the center of the workspace is reserved for the document Designer or Editor. The content in this section changes according to document and selected view. While editing a Form, for example, a visual design and two code views would be available. The view can be changed from the Ribbon.
Morfik_Application_Workspace
Form Designer Report Designer Table Designer Query Designer WebMethod Designer Module Designer Relationship Designer
Morfik_Application_Workspace
An Inspector can be moved from its original location by dragging it to another location on the workspace. In order to facilitate this movement, the Inspector must first be pinned in place. To move the Inspector back to its original pinned location, double-click the Inspector's title bar. An Inspector may also be closed by pressing the Close button. If you accidentally close a panel, you can reopen it by going to the Ribbon bar's 'View | Panels | Panels' drop-down menu and selecting the appropriate panel.
Morfik_Application_Workspace Right Docking Site The panel (by default) hides along the right side of the screen when not in use. Hovering the mouse cursor over the panel causes it to fully expand to the right; moving the mouse cursor off the panel causes it to contract. The panel may be locked in its expanded position by 'pinning' it in place; press the Pin Button to do so. These panels are of use only when debugging an application at the platform compiler level (JavaScript and Object Pascal for the browser and server portions of the application, respectively).
Bottom Docking Site Located, by default, across the bottom of the workspace, the Bottom Docking Site contains a series of Inspectors that can be used when performing management tasks for your project or while debugging. These Inspectors include:
Output Errors Search Log Watches Breakpoints Call Stack XML JSON
8 - Bottom Docking Site
Morfik_Application_Workspace
SQL HTTP
9 - Status Bar
The application Status Bar provides a range of contextual information about objects. It is divided into several sections showing Zoom, Position, Style, Width and Height information.
Status Bar
Zoom Percentage Edit State Control Name and Type Left and Top Positions Width and Height Font Type and Size Style Details
Related Topics
What you need before getting started Installing Morfik Customizing the environment Building your first application with Morfik Back to top
9 - Status Bar
11
First_Application Building your first application with Morfik The best approach to mastering a new software development tool such as Morfik is to 'learn by doing'so here is your chance to do just that. In this chapter, you will create your first web application from start to finish using some of the core features found in Morfik. No prior knowledge of Morfik is necessary.
Introduction
This article focuses on what you can do with Morfik. At this stage you do not need to know how or whyyou will learn about those later.
Introduction
First_Application
Note: The Ribbon bar changes dynamically depending on the context. If you have a project open, the 'New Project' button will not be visible. Either close the project, or access the New Project command or New Project Wizard through the Power Menu Button.
From the available list of templates on the New Project dialog choose a template that suits your project best. We select the 'Rocking Green' template, call the project 'GuestBook' and leave the location in its default state and within a new folder.
Step 1create the project 2
First_Application If the "Create sample pages" checkbox is ticked, the new project will include a number of sample Pages (including pages for hand held devices). These pages can also be added after the project is created using the "New Page" command. Press the OK button and wait a moment as the new project is created. Your new project includes the main page template for the project called Index and a template page for an Apple iPhone (Figure 2). In this article we will focus on the Index page template. In a Morfik project Pages define your application's interface and internal organization as they define the placement of content and navigational structure.
First_Application
First_Application
Figure 4: Defining fields (columns) in the New Table Wizard Press the Add button again to create another new column. Set Name to FullName and Type to Text and then press the OK button to close the Field dialog box. Repeat the above steps to create three more columns:
Once the above fields are added to the table, you should have the list of fields shown in Figure 5.
First_Application
First_Application
First_Application
FullName : Jon Citizen EmailAddress: jon@citizen.com Comment: This is cool and I am very happy to have the first comments in this Guestbook sample project. Keep up the good job. ContactMe: 1
First_Application
10
First_Application
11
First_Application
TextLabel1 : TextLabel
Caption Guestbook
TextLabel2 : TextLabel
Caption Width Welcome to our guestbook, we'd love to hear from you 500px
GuestBook is a simple project with only one Page and no need for navigation so we remove the list of links. We also remove the links in the Footer of the Master Form by deleting "Container6" which includes all the Footer links. Save and Close the frmRoot form. The Index Page header is now updated (Figure 13).
12
First_Application
13
First_Application
frmEmpty
View Mode Data Source Page Size vmContinuousEditable Guests 50
The "vmContinuousEditable" view mode for forms allows viewing multiple records, as well as the ability to add or edit records at run time with grid-like behaviour. Go to the Insert Ribbon and click on TextLabel control in Standard section. Then click on the Details Band of the Form to place a TextLabel on the form. While selected, switch to the Home Ribbon, then click on the "Style" command (in Appearance section) and from the drop-down list select "Heading6". Now we set some properties of the new TextLabel to display the guest full name.
TextLabel1 : TextLabel
Data Field Left Top Width FullName 45px 15px 500px 14
First_Application Place a second TextLabel for the comments and position it under the guest full name TextLabel and while selected, apply the following property changes:
TextLabel2 : TextLabel
Can Grow Data Field Left Top Width Word Wrap Yes Comments 45px 42px 800px Checked
We also draw a Line in between each entry by placing a Rectangle control from the Insert Tab(within the Extended section) under the comments TextLabel and apply the following changes through the Rectangle properties.
Rectangle1 : Rectangle
Border Sides Border Width Color Height Left Width Un-check "bs Bottom", "bs Left", "bs right" 1px None 7px 65px 785px
Click on the Details band of the form and set the following property:
Detail : Band
Height 94px
Following the above changes, your form should look like the screenshot shown in Figure 14:
15
First_Application
16
First_Application
DetailEditable : Band
Height 232px
Select the existing edit control for FullName field (Edit_TextLabel1) and change the following properties:
Edit_TextLabel1 : TextEdit
Left Top Width 161px 18px 600px
Next, select the the edit control for Comments field (Edit_TextLabel2) and change the following properties:
17
First_Application
Edit_TextLabel2 : TextEdit
Left Height Top Width 161px 92px 53px 600px
It is now time to add editing controls for the fields that are not included in the Edit band by adding a new TextEdit control and setting it's Data Field to the EmailAddress field from the Guests table. To save time, we make a copy of the existing TextEdit control. Click on the Edit control for FullName field (Edit_TextLabel1), then right click and select Copy (or use Ctrl+C) to make a copy of the control. Right click on the form and click on Paste (or use Ctrl+V) to add the new TextEdit control to the form. Apply the following property changes to the new TextEdit control:
Edit_TextLabel3 : TextEdit
Data Field Left Top Width EmailAddress 161px 155px 600px
The last control to add for editing is for the "Contact Me" field which is of type Boolean. Click on the Insert Ribbon tab and in the list of controls in the Standard section, click on Checkbox control. Move the cursor down under the EmailAddress edit control and click again. Make sure the new checkbox is selected and apply the following property changes:
Edit_Checkbox1 : CheckBox
Caption Data Field Left Top Contact Me ContactMe 161px 189px
In the final stage of customizing the Edit band we add titles for each editing control. Click on TextLabel control in Insert Ribbon tab and place it next to the edit control for the Fullname field. While selected, go to the Home Ribbon, click on "Style" drop-down and select "Heading6" to apply formatting to the TextLabel and make the following suggest property changes: Step 4Data Entry and project Preview 18
First_Application
TextLabel7 : TextLabel
Caption Left Top Guest Name 45px 19px
Follow the above steps to place titles next to each Edit control and update the Caption and Top properties according to the field they represent. The Edit band customization is now complete and the last thing to do before we preview the project is to add a Navigation bar in the footer of the form. Expand the Footer band by placing the mouse over the border of the Details and the Footer bands and click and hold down the left mouse button when the cursor looks like a double sided arrow and drag the Footer down till the height is around 45px. Click on the empty Footer band and in the list of properties for the Footer, click on "Navigation Bar" ellipces. This opens the Navigation Bar dialog. Tick the "Enabled" and "Large Buttons" Checkboxes (as shown in Figure 16) and click on OK button.
19
First_Application
Following the above Edit band customizations and changes to the form, your form should look like the screenshot shown in Figure 17.
Figure 17: Guest Comments form at design time We have now completed our first application and can have preview by clicking on the Run button. Shortly after clicking on the Run button, you should see your application in the built-in browser (Figure 18).
Note: On systems protected by a Firewall, the 'Windows Security Alert' is displayed at the time of running the project or Previewing a form. You should not get this dialog if you click on "Unblock".
20
First_Application
Note: The built-in Morfik Debug Browser is used to display your application at run time. There are links
to 5 major browsers and mobile devices on the debug browser that lets you view your application in different browsers and mobile devices. In order to use these browsers, you will need to have them installed on your system.
21
First_Application
the data and show a message if no valid information is entered. To do this, in the data entry form, double click in 'On Before Submit' event and add the following code: FX Code
Procedure frmEmpty.WebFormBeforeSubmit(Var Cancel: Boolean); Begin If (Edit_TextLabel1.Text.Trim = ") OR (Edit_TextLabel2.Text.Trim = ") OR (Edit_TextLabel3.Text.Trim = ") Then Begin Cancel := True; ShowMessage('All fields require data!') End; End;
BX Code
Published Message Sub WebFormBeforeSubmit(ByRef Cancel As Boolean) If (Edit_TextLabel1.Text.Trim() = "") Or (Edit_TextLabel2.Text.Trim() = "") Or (Edit_TextLabel3.Text.Trim() = "") Then Cancel = true ShowMessage("All fields require data!") End If End Sub
CX Code
published message void WebFormBeforeSubmit(ref Boolean Cancel) { if ((Edit_TextLabel1.Text.Trim() == "") || (Edit_TextLabel2.Text.Trim() == "") || (Edit_TextLabel3.Text.Trim() == "")) { Cancel = true; ShowMessage("All fields require data!"); } }
Conclusion
Congratulations! You've just completed your first Morfik application! To further empower the notion of 'learning by doing', we suggest you go through the sample projects that are installed with Morfik. Looking at the inner workings of a professionally developed application is another great learning approach.
Related Topics
What you need before getting started Installing Morfik Customizing the environment Getting to know Morfik application workspace
Back to top
Conclusion
22
Building_Graphical_User_Interfaces_-_Introduction_and_Overview
The Graphical User Interface is the single most influential factor affecting the user experience and perhaps the most important part of an application. Often applications are judged by the way they look and feel, and this is even more so when it comes to the Web. The way that an application's functionality and data are organized and presented to the end user is of vital importance. Many of the recent new technologies on the Web have been developed specifically to enable web applications to provide a better user experience. Rich Internet Applications (RIAs) have the most sophisticated user interfaces. Amongst the most notable RIA technologies are Ajax, Flex, Silverlight and JavaFX. Morfik has chosen to use Ajax due to it being native to the browser and not requiring special plug-ins or software to be installed either on the user's machine or within the browser. This choice has proven itself to be a sound one with the growing user base of mobile devices running Apple's iPhone OS which doesn't support any kind of browser plugin, at this time.
Contents
1 Web user interfaces 2 Steps involved in building graphical user interfaces in Morfik 2.1 Building the structure 2.2 Adding content, behavior and interactivity 2.3 Enhancing the appearance 3 Related Topics
Building_Graphical_User_Interfaces_-_Introduction_and_Overview
Figure 1 A typical desktop application (Photoshop) versus a typical web application (Facebook) The content-driven nature of the page layout poses a serious challenge to the conventional desktop tools for building user interfaces on the Web. The failure of the traditional user interface design tools is so great that most web developers have come to the unfortunate conclusion that a text editor is the best tool for designing web user interfaces! One of the main reasons for this is that under the conventional approach, the functionality of user interface and its graphical design have to be built using two different types of tools. Every time there is a change in one domain a tedious manual process must follow to transfer the changes over to the other domain and vice versa. Morfik has recognized this challenge and has built a development tool that makes creating web applications a whole order of magnitude more efficient than what can be achieved by conventional tools. Morfik achieves this through combining graphical design and visual programming into one tool as well as having developed a special technique that allows for WYSIWYG design of user interface with absolute positioning while maintaining the
Web user interfaces 2
While there are some overlapping aspects to these phases, they present distinct parts of the design process and should be treated separately.
Building_Graphical_User_Interfaces_-_Introduction_and_Overview
Related Topics
How is Morfik different? Understanding Morfik's approach to Web application layout Identifying and creating your application pages Building navigation menus and linking your application pages Getting to know Morfik Forms Using Forms to build your application user interface Working with Forms to add behavior and content to your application Using Controls and Widgets to add interactivity and display content Controlling the layout of your application Using Graphical Effects to enhance presentation Maintain consistent presentation through use of Themes and Styles Creating Interfaces for the Mobile Web
Back to top
How_is_Morfik_different
If you are familiar with or have had any experience with building websites using conventional tools, you might find it quite a bit different when working with Morfik. This, however, will not last long. Once you are past the initial stage you will immediately realize the power of the new approach. The following sections will help you to get your bearing right by describing key differences between Morfik and other web development tools.
Contents
1 No HTML or CSS files 2 Designing Pages 3 Pages in Morfik 4 Use of absolute coordinate system 5 For every Form you get two code modules instead of one 6 Graphical Design is merged with Visual Programming 7 Related Topics
Designing Pages
In Morfik you do not write pages, you design them. You also design Formsa metaphor used in all major desktop development tools. Modern, Ajax-enabled web applications have what might be considered few pages, or in some cases only one, but these pages undergo several changes in appearance in order to interact with the user. With Morfik you will design Pages as you will want your application to display them, by designing and aggregating Forms for user interaction in addition to content presentation. Forms can also be self-containing (both at design time and at run time) and therefore extremely modular. HTML pages are NOT! Though you can use server-side scripts to compose a Page from several HTML snippets, you cannot define an HTML Page in terms of other HTML Pages.
Contents
How_is_Morfik_different In Morfik, the layout and, more importantly, the behavior of an arbitrarily complex page can be successively reduced down to simpler and simpler Form constructs.
Pages in Morfik
Unlike other web applications that consist of a series of web pages, a Morfik application uses a single page to run an entire application within the browser. This single page will morph itself into all the pages that compose your application, without ever requiring a full page reload by the browser. This radical move ensures two key benefits for the Morfik developer and the end user: 1- No page refresh is required while a user interacts with a Morfik application. 2- No postbacks are needed for tracking state changes within an application. Avoiding page refreshes makes Morfik applications appear seamless and behave more like desktop applications with a greater level of continuity and smoothness. Also, the state of the application is not posted back to the server every time a user goes to another page within the same application. Imagine if every time you ran a command within a desktop application the application would save its current state before shutting down and then immediately restarting again! While this may be tolerable for smaller applications, it is clearly impractical to have this model used for larger applications such as word processing or spreadsheet. The same is equally true about simple and complex user interfaces on the web. Having a single page to represent an entire application within the browser is highly desirable from a software development point of view; however, from the Web point of view this model has some flaws that need to be addressed. The World Wide Web works best with pages and that shows through its basic operations. For example the history list within browsers and the associated back and forward buttons; the common practice of bookmarking; hypertext models and hyperlinking; and search engine bots all assume the existence of web pages with distinct URLs. Morfik applications need to comply with this page-centric view in order to successfully work with the rest of the web. To achieve this, Morfik introduces the abstract concept of virtual pages. In Morfik, the state of an application's user interface at any given point in time is considered to be a virtual page. Whenever the state of an application user interface changes in response to user input, the new state is thought of as a new virtual page. Morfik's virtual pages are abstract entities, but are "materialized" in high level objects called Pages. These Page objects represent particular states that the application will assume. From an end user's perspective a Morfik Page object is exactly like any other web page created with any other tool, but internally the Morfik Framework transparently makes it work in a more optimized manner, by morphing the single page Morfik uses to display the entire application. Pages are are published and made identifiable by defining a URL for them. Your application may define any number of Page objects for internal use which are not relevant to the outside world and are not worth publishing. On the other hand, some pages are extremely important and it is these that you want users to find and be able to directly access.
Read more about Virtual Pages... Read more about Page objects...
Designing Pages
How_is_Morfik_different
For every Form you get two code modules instead of one
One aspect of Morfik that might be difficult to get your head around initially is the fact that in Morfik every form has two associated modules. The code associated with the application user interface resides partly in the browser side and partly on the server side of your application. The module residing in the browser side uses red for syntax highlighting and implements the Ajax behavior. The one residing on the server side uses blue for syntax highlighting and has a more conventional role similar to server-centric systems such as PHP or ASP. Although closely related, these two modules do not directly interact with each other. They simply represent the same user interface elements in two different domains. One module compiles into binary and runs on the server side where as the other compiles into JavaScript and runs within the browser.
How_is_Morfik_different
anti-aliased text. Due to the current limitations of browsers, these images need to be broken down into a large number of smaller fragments which in turn need to be meticulously coded into HTML and CSS documents. Any non-trivial change to the user interface layout or style would require re-building and re-coding of these images. Morfik removes this burden by automating the creation and the subsequent management of these images during development and at runtime. This opens up new possibilities that are extremely difficult to achieve manually. Take Image Bundling for example. In order to reduce the number of round trips made to the server at runtime, Morfik bundles multiple images into a single file at design time and subsequently manages the complex partitioning of them at runtime. The complexity associated with this task makes it prohibitive to be done manually using conventional web development tools.
Related Topics
Introduction and Overview Understanding Morfik's approach to Web application layout Identifying and creating your application pages Building navigation menus and linking your application pages Getting to know Morfik Forms Using Forms to build your application user interface Working with Forms to add behavior and content to your application Using Controls and Widgets to add interactivity and display content Controlling the layout of your application Using Graphical Effects to enhance presentation Maintain consistent presentation through use of Themes and Styles Creating Interfaces for the Mobile Web
Back to top
Understanding_Morfiks_approach_to_Web_application_layout
When building Rich Internet Applications (RIAs) there is a greater need for control over the layout of the application user interface. The provision for a greater control is a common feature amongst RIA technologies such as Flex, Silverlight and JavaFX. Similarly, Morfik also provides a model that allows for a greater level of control over the application user interface layout; however, unlike these platforms, Morfik does not rely on browser plug-ins or special software to achieve this. Morfik has developed a unique technique that is implemented in Ajax code, removing the need for browser plug-ins. This approach is named Plastic Layout due to its ability to combine absolute positioning with flow layout.
Contents
1 Plastic Layout 2 Content-driven layout versus container-driven layout 3 Grow/shrink properties (content-driven) 4 Placement properties (container-driven) 5 Plastic Layout in action 6 Tips, tricks and things you need to know 7 Application?s alignment within the browser window 8 Related Topics
Plastic Layout
Plastic Layout is a technique in which the developer successively breaks the application user interface into smaller functional sections based on the application logic and the graphical design of the user interface. These sections are then programmatically organized into a spatial tree structure at run time. Each node in the tree is aware of the existence, state and behavior of other nodes and can respond to layout changes (communicated as events) according to changes in content and the rules set out by the developer at design-time. While in Morfik the navigational structure of an application is created with Pages, the pages themselves are composed entirely of Forms. All the application user interface is thus built using forms. Forms represent major nodes within this tree structure; however, there are other nodes that exist in the tree and are important in the layout process. A form is comprised of a series of repeatable bands. Within each band there are user interface elements such as button and container controls. A special node, the SubForm Control, is used to link forms within this structure. In this documentation the term Plastic Layout Tree is used to refer to this hierarchical structure as depicted in Figure 1.
Contents
Understanding_Morfiks_approach_to_Web_application_layout
Figure 1: Plastic Layout Tree All nodes within the tree have Width and Height properties. With the exception of Band nodes, all other nodes assume a location within the space provided by their respective parent nodes. The location is defined by the Left and Top properties. Bands are special nodes with unique layout characteristics. They are laid within a form in a sequence and with relative positioning.
Plastic Layout
Understanding_Morfiks_approach_to_Web_application_layout
' In the container-driven layout case, Figure 2, resizing of Container1 will force Container2 to move down (in this example Container2 is bottom-justified). In the content-driven layout case, Figure 3, the TextLabel control is forced by the content to grow in order to reveal the entire text content. These two processes operate independently and in parallel with little conflict. Conflicts can only arise along the Yaxis and when such a case arises priority is given to the change initiated by the container-driven layout process'. It is worth mentioning that content-driven layout dominates the process when building applications that have the look and feel of a website while the container-driven layout dominates when building desktop-like applications. In general, however, both these layout processes are used within most applications created by Morfik.
Understanding_Morfiks_approach_to_Web_application_layout
It is requested that a screenshot or screenshots be included in this article to improve its quality. () () Figure 4: Grow/shrink effects on sibling controls There are three control properties and four events that allow developers to fully control the behavior of the content-driven layout.
Grow/Shrink related properties: Property Description The CanGrow property determines the behavior when the Caption text is too large to fit into the Control:
if
Can Grow
CanGrow=No, the Control retains its design-time height if CanGrow=Scroll, the Control retains its design-time height, but allows the end user to scroll through the text if CanGrow=Yes, the Control increases its height to accommodate the text The CanShrink property determines the behavior when the Caption text is too small to completely fill the Control:
if
Can Shrink
CanShrink=False, the Control maintains its design-time height if CanShrink=True, the Control decreases its height to accommodate the text Note: enabling CanShrink has no effect unless CanGrow is also enabled. Using this property only makes sense if the control will contain data bound controls. If there is only a small amount of content to be displayed within the control, its height will be reduced so that it elegantly displays the content without leaving large blank areas in the page. More information on how controls can grow and shrink at runtime is available under the topic Plastic Layout. The ShrinkOnHide property specifies how Morfik's Layout engine repositions other controls when the container's visibility is changed at runtime.
Shrink On Hide
Understanding_Morfiks_approach_to_Web_application_layout
Event
Description
On After Grow Or Shrink This event is fired within the browser after the height of a control is adjusted in order to fit its new content. On After Pushed Or Pulled On Before Grow Or Shrink On Before Pushed Or Pulled This event is fired within the browser after the position of a control has changed in response to a change in the content of a sibling control. This event is fired within the browser before the height of a control is adjusted in order to fit its new content. This event is fired within the browser before the position of a control is changed in response to a change in the content of a sibling control.
Understanding_Morfiks_approach_to_Web_application_layout
Vertical Placement
Figure 6: Layout generation The first thing to note is that the Plastic Layout process does not generate the actual layout. The initial layout is created on the server-side by the form generator and then sent to the browser-side of the application for final processing. All the layout information defined at design-time is contained in an XML template which is stored inside the .MXR file. This XML template contains precise positioning information, information about formatting and data sources as well as instructions on the required plasticity of the layout. The Morfik Form Generator (on the server side) first processes this template and uses the formatting information as well as accessing the specified data sources to generate the starting HTML. It then sends it to the browser for final processing. The Plastic Layout begins in the browser by first interpreting the developer?s instructions on plasticity and then adjusting the location and the dimensions of various nodes in the Plastic Layout Tree to bring flexibility to a layout that is otherwise rigidly defined. The second thing to note is the nature of key events that start the layout process and the various actions taken by the Plastic Layout system in response to these events. Opening a FormThe layout process is triggered by a number of different events. The most significant of these events occurs when a form is opened in response to a call to the OpenForm function. The event occurs just before a form is made visible in the browser. It invokes the layout process to begin its plastic work on the content of the form. There are three steps involved:
Step 1: The layout process first processes all TextLabels, CheckBoxes and Optionbuttons and depending on their CanGrow and CanShrink properties will apply height adjustments to each of these controls. Each adjustment may result in subsequent changes of the height of the parent control or a change in the location of sibling controls. The cascading nature of this process, however, is confined to those controls that are within the same form; no Event is Plastic Layout in action 6
Understanding_Morfiks_approach_to_Web_application_layout
allowed to cross the boundary of the Form into the Parent Form. Similarly, the same layout process goes through all containers within the form that have their ShrinkOnHide set to true and will perform height adjustments.
Step 2: A single grow/shrink Event is triggered on the Form?s Owner Subform which will carry through to the Owner Form the aggregate result of all the changes that were made in the Form during Step 1. The Parent Form will do all the necessary adjustments to its child controls before passing this event up the next form in the tree. This will continue until the top form in the Plastic Layout Tree is reached. Step3: The container-driven layout process begins at this point in the cycle. It starts from the form node that is just being loaded and will recursively work down the Plastic Layout tree until the bottom most nodes of the tree are reached. All controls that have their HorizontalPlacement or VerticalPlacement properties set are processed during this step.
Note: When a Form is cached within a SubForm, subsequent calls to the OpenForm command on the same form will only result in Step 2 and Step 3 to be executed. Note: Opening a form often results in one or more child forms to open implicitly. These secondary forms, upon opening, will only execute Step 1 and Step 2. Step 3 is only run for the primary form being opened. Setting Width and Height propertiesProgrammatically setting the width or height of a control will trigger the container-driven and the content-driven layout processes to run. The container-driven layout process is run on all the child controls, provided that the HorizontalPlacement or VerticalPlacement properties are set. The content-driven layout is run on the control itself, provided that the control is a TextLabel, Checkbox or an OptionButton and either the CanGrow or CanShrink properties are set. Note: The content-driven layout process only responds to the changes in the Width property. Setting the height property does not start the content-driven layout process. Care must be taken when setting the Width or Height properties of a control as the recursive nature of the layout process could result in multiple runs that may not be necessary and be waste of processor?s time. Resizing Browser WindowThis event will trigger the container-driven layout process to run on the main form of the application and will expand through the entire Plastic Layout Tree. If the properties of controls that determine the layout behavior are not set properly this is where the negative effect will be seen. The application will appear as slow in responding to the resize events that are fired repeated during the resizing of the browser window. To mitigate this effect, a timer is set up to reduce the frequency of events that are passed through to the system; however, this does not remove the need to carefully configure control layout properties within a project. Other ActionsThere are three other actions that trigger the content-driven layout process to run: Changing the visible property of a container (only if it actually changes) Changing the caption of a TextLabel, CheckBox or OptionButton (only if the value changes) Changing the active tab in a TabControl result in the layout process to be run on the TabSheet control being activated.
Understanding_Morfiks_approach_to_Web_application_layout
Figure 7: Using containers to isolate siblings 2) Sometimes it is not possible to use a container to guard against the undesirable effects of ?grow and shrink? on sibling controls. In these situations use OnBeforeGrowOrShrink and OnBeforePushedOrPulled events to achieve the same result as shown in the code snippet below:
Procedure Form1.TextLabel5BeforePushedOrPulled(Var deltaY: Integer); Begin deltaY := 0; End;
3) Do not set CanGrow and CanShrink properties if not neededthere are normally many instances of TextLabel controls that are static and are not data bound. These controls usually do not require their sizes to be changed at runtime. Make sure that the CanGrow property and CanShrink properties for these controls are set to No and False, which are the default values. Otherwise the layout process attempts to adjust their size, which often results in an insignificant amount of resizing. This insignificant change in size can, however, trigger a wave of grow and shrink operations on parent nodes further up the Plastic Layout Tree. If not checked, this problem could have a very negative impact on the performance of continuous forms. You could alternatively set the
Tips, tricks and things you need to know 8
Understanding_Morfiks_approach_to_Web_application_layout InternalGrowShrinkOverride field of a control to True in order to make it invisible to the Plastic Layout process.
4) Place sibling controls with the same justification in a common container. This will reduce the number of operations performed to produce the same effect as shown in Figure 8. Note that Container A is the only control that needs to have its HorizontalPlacement property set to hpRightJustify.
Figure 8: Optimizing alignment 5) Do not change the design-time property values that are stored in the creation record field. The Plastic Layout process uses in its calculations the design-time values of position and size properties that are stored in the Attrs field. Changing these values could be detrimental to the Plastic Layout process.
6) The Plastic Layout process does not regard hiding a control as affecting its content. Therefore, it does not take any action when the visible property of a control is changed. For container controls, however, this behavior can be changed through the ShrinkOnhide property. The current implementation, however, simply sets the height of a container to zero when its visible flag is set to false, provided the value of ShrinkOnHide property is set to True. The problem will arise when the container is made visible again. The Plastic Layout process attempts to restore the original height of the container based on its child controls. This results in the bottom margin (the distance between the bottom of the bottom-most control and the bottom of the container) to disappear. To work around this problem a dummy control can be placed right at the bottom of the container control so as to maintain the bottom margin.
Understanding_Morfiks_approach_to_Web_application_layout
Understanding_Morfiks_approach_to_Web_application_layout
window. Resizing browser window in the horizontal direction will trigger an event that will start the layout process (Figure 11).
RightThe application?s Main Form is placed in the top right corner of the client area of browser window. Resizing the browser window in the horizontal direction will trigger an event that will start the layout process (Figure 12).
Figure 12: Right alignment StretchedThe application?s main form is stretched in both directions in order to fill the entire area of the client portion of the browser window. Resizing browser window in the horizontal or vertical direction will trigger an event that will start the layout process (Figure 13).
11
Understanding_Morfiks_approach_to_Web_application_layout
Stretched (horizontal direction only)The application?s Main Form is stretched in a horizontal direction in order to fill the entire width of the client portion of the browser window. Resizing the browser window in the horizontal direction will trigger an event that will start the layout process (Figure 14).
Related Topics
Introduction and Overview How is Morfik different? Identifying and creating your application pages Building navigation menus and linking your application pages Getting to know Morfik Forms Using Forms to build your application user interface Working with Forms to add behavior and content to your application Using Controls and Widgets to add interactivity and display content Controlling the layout of your application Using Graphical Effects to enhance presentation Maintain consistent presentation through use of Themes and Styles Creating Interfaces for the Mobile Web
Related Topics
12
Related Topics
13
Identifying_and_creating_your_application_pages
In Morfik all applications are composed of one or more pages, not unlike most websites you daily visit on the web. The Pages represent the pages the end user will be able to navigate to inside your application or website and created by assembling together a set of Forms and organizing them appropriately. The organization and navigational structure of the application is defined by how these Pages are assembled and linked together.
Contents
1 Pages define application organization 2 Identify your application's 'Pages' 3 Creating a New Page 4 Creating Application-Specific Page Templates 5 Master Forms 6 Page Templates for Mobile Devices 7 Page URLs 8 Page URL Parameters 8.1 Mapping Ambiguity 9 Related Topics
Figure 1: Top level navigation structure within a website or web-based application. In figure 1 you can see the basic structure of an application or website with several first level pages being linked to from the project's Home page. Pages also contribute to the definition of what an application will look as they
Contents 1
Identifying_and_creating_your_application_pages
are responsible for establishing the general layout of the application as well as setting the background over which the application is designed.
Identifying_and_creating_your_application_pages
Identifying_and_creating_your_application_pages
Identifying_and_creating_your_application_pages
Identifying_and_creating_your_application_pages
Identifying_and_creating_your_application_pages
Master Forms
In addition to the ability to define a template page based on an existing page within your project (see above), it is possible to define a page template based on an existing Form. Forms that are used in this way are called Master Forms. In deed, Master Forms provide the base layout for all pages in your application. In these Forms you will define areas, which might be common to a number of pages in your application and others that will always be different from page to page. To define an application-specific page template based on a Form, right-mouse click on the Form while in the Project view and then select the properties command. Once the Form document properties dialog appears tick the "Defines Page Class" checkbox. See Figure 6. The new page template should appear in the New Page dialog.
Master Forms
Identifying_and_creating_your_application_pages
Identifying_and_creating_your_application_pages
Page URLs
Morfik Pages have a URL property which is used to define a relative path for the page. This relative path will compose the page's full URL when combined with your application's root URL. Inside your current project you will be able to reference a page by its relative URL for the purpose of establishing links between pages and defining the navigational organization of the application. For navigation from outside the application you will always need to use the complete URL for the page. A URL can be defined by clicking on the URL button in the inspector panel, or selecting the Define URL command on the Ribbon and supplying a path for the URL which is shown in Figure 5.
Page URLs
Identifying_and_creating_your_application_pages
Given the above definition a given instance of a clean URL such as:
http://www.morfik.com/products/software/MorfikFX
It is important to note that when publishing a URL no new parameter is being defined. Publishing of a URL only involves the mapping of segments of a URL to parameters that are already defined by the underlying forms. Using the mapping information, parameter values that are present in a clean URL are passed through to all forms that happen to have a parameter defined by the same name.
Mapping Ambiguity
It is important to mention that the process of parameter mapping is not perfect. There may be occasions where it is not possible to perform the mapping due to ambiguous definition of published URLs. Under these circumstances parameter mapping may not produce the expected result. Ambiguity results when two or more published URLs have overlapping paths with parameters that can be interpreted in multiple ways. An example of this scenario is shown below:
http://www.morfik.com/products/software/[prmFeature] http://www.morfik.com/products/[prmCategory]/[prmProductName]
In the example above the two Published URLs create ambiguity. If the following URL is supplied, both of the
Page URL Parameters 10
Identifying_and_creating_your_application_pages above Published URL definitions can be selected by the system to perform the required mapping.
http://www.morfik.com/products/Software/auto-deployment
In the case where the first definition is selected, the mapping would produce the following full URL which is the correct mapping:
http://www.morfik.com/products/software?prmFeature=auto-deployment
Using the second definition, the mapping would produce the following erroneous full URL:
http://www.morfik.com/products?prmCategory=Software&prmProductName=auto-deployment
To resolve ambiguity Morfik uses the simple formula of selecting the published URL definition whose fixed portion (URL minus parameters) is the greatest in length. Using the above formula the right result is obtained for the given instance of the supplied URL. However, if the following URL is encountered the wrong definition would be selected.
http://www.morfik.com/products/Software/MorfikFX
instead of:
http://www.morfik.com/products?prmCategory=Software&prmProductName=MorfikFX
The above scenario highlights the need for careful selection of paths and a valid range of parameter values when defining parameters in a Form or Publishing URLs so as to eliminate potential for ambiguity. Ambiguity can be totally removed from the above definitions if the first published URL definition was changed to:
http://www.morfik.com/products/softwareProduct/[prmFeature]
And that ?SoftwareProduct? was never chosen as a label for a product category.
Related Topics
Introduction and Overview How is Morfik different?
Mapping Ambiguity
11
Identifying_and_creating_your_application_pages Understanding Morfik's approach to Web application layout Building navigation menus and linking your application pages Getting to know Morfik Forms Using Forms to build your application user interface Working with Forms to add behavior and content to your application Using Controls and Widgets to add interactivity and display content Controlling the layout of your application Using Graphical Effects to enhance presentation Maintain consistent presentation through use of Themes and Styles Creating Interfaces for the Mobile Web
Back to top
Related Topics
12
Building_navigation_menus_and_linking_your_application_pages Once you have identified and created pages in a manner such as described in the article, Identifying and creating your application pages, you can start to build a navigation menu for your application. There are several controls that can be used to create different types of menus, depending on how you want to structure the navigation of the application. Figure 1 shows the top level menu of one of the default template websites built just with the Button control.
Building_navigation_menus_and_linking_your_application_pages
Note: It's quite usual for secondary menus to follow a different "orientation" from the primary
one. This is specially true if the primary menu has a horizontal orientation. One benefit of this arrangement is that both menus can easily be visible at the same time, reducing the need for the user to "navigate" between menu levels.
Contents
1 Linking your Application Pages 2 Setting Up Hyperlinks 3 Using Page URLs as targets for Hyperlink properties 4 OpenPage Function 5 OnHyperlinkClick Event 6 Related Topics
When the hyperlink property is defined for these controls the Morfik framework inserts an HTML anchor tag <a>ctrl</a> when generating the control HTML. This would make these controls appear as hyperlinks to a browser whenever their hyperlink property is set.
The new hyperlink property for the above controls could be set either through the Properties panel or using the Link button in the URLs section on the Ribbon when the form designer is active.
Contents
Building_navigation_menus_and_linking_your_application_pages
Figure 3: Link Button on the Form Designer Ribbon. The value of the hyperlink property is commonly set at deign-time. It is also possible to define or modify this property in the server-side of an application at run-time. Currently, it is not possible to set or modify this property in the browser code of an application. The hyperlink property can easily be used to navigate to an external website by simply copying the full target URL into the hyperlink property. However to use hyperlinks for internal navigation within a Morfik application, a page must be created so that the system can navigate to the target location. Publishing URLs and using the hyperlink property for internal navigation is an essential requirement for SEO.
Setting Up Hyperlinks
In general you will be using either a TextLabel, a Button or an Image control to act as the visual representation of a hyperlink in your application. All of the controls have a Hyperlink property which can be set to point either to a published URL for navigation within your own application or website, or to an external application which will take the user to another website. They an be set to point to other protocols such as mailto which will be handled by the browser and should bring up the user's email client to send an email to the specified address. You can set the Hyperlink property of a control either by selecting a URL in the drop down that is displayed when you click on the small arrow by the editor for this property in the Properties panel, or by clicking the Link button in the Home tab of the ribbon when the appropriate control is selected. If you click on the Link button you will get a dialog for selecting a previously published URL or manually entering one. This dialog is shown in Figure 6.
Building_navigation_menus_and_linking_your_application_pages
Figure 6: Dialog for selecting or entering the URL which you want to assign to the selected control.
You can use hyperlinks for creating an isolated link just as you can to create a menu, through the usage of a group of controls you can create navigation menus for your application.
Product]
Please note that this notation is only valid for internal navigation. Another important point is that if a reference is created in this manner then the resultant URL would have high dependency on the data content which may change and render the URL as a broken link. This is particularly important if the URL is likely to be bookmarked externally. For situations like that it?s best to define a URL field in a table rather than a simple text field. This Setting Up Hyperlinks 4
Building_navigation_menus_and_linking_your_application_pages
way the URL value can remain the same while the description data changes.
OpenPage Function
A Page can be programmatically accessed through the use of the OpenPage function. The OpenPage function is the equivalent of the OpenForm Function function and uses a Page URL as its first parameter with an optional second parameter that is identical to the third parameter of the OpenForm Function. The second parameter is only used if the URL used in the first parameter does not follow the clean URL format. FX Code
Procedure frmRoot.Button2Click(Event: TDOMEvent); Begin OpenPage('about/contactus'); End;
OnHyperlinkClick Event
All controls with the Hyperlink property have an event that is invoked whenever the hyperlink is clicked on by the user. This event can be intercepted to introduce custom behaviour for handling a particular link within an application. FX Code
Procedure frmRoot.Button2HyperlinkClick(Var Url: string; Var Handled: Boolean); Begin If Not DataValid Then Begin Handled := True; Exit; End; OpenPage(URL); End;
BX Code Published Message Sub Button2HyperlinkClick(ByRef Url As String, ByRef Handled As Boolean)
If Not DataValid Then Handled = true Return
Building_navigation_menus_and_linking_your_application_pages
End If OpenPage(Url)
Related Topics
Introduction and Overview How is Morfik different? Understanding Morfik's approach to Web application layout Identifying and creating your application pages Getting to know Morfik Forms Using Forms to build your application user interface Working with Forms to add behavior and content to your application Using Controls and Widgets to add interactivity and display content Controlling the layout of your application Using Graphical Effects to enhance presentation Maintain consistent presentation through use of Themes and Styles Creating Interfaces for the Mobile Web
Back to top
OnHyperlinkClick Event
Forms
The Form is the canvas upon which you will do most of the work to create your application or website's visual interface. By placing and configuring controls on a the surface of a Form's bands you will customize it to achieve the desired look and feel. Forms can be used to create the Pages of a Morfik project or as pop ups that are presented to the user for quick interactions such as a log in request. Forms can be created in many sizes going from large ones that take up most of a Page to a small visual element that is composed together with other similar elements within a larger Form or a Page.
Contents
1 Plastic Layout 2 Form Designer 2.1 How Do I: Use forms in Morfik? 3 Bands 4 Data Bound Forms 4.1 Single Forms 4.2 Continuous Forms 4.2.1 Sorting and Grouping 4.2.2 How Do I: Implement Sorting and Grouping in Morfik Forms? 4.3 Continuous Editable Forms 5 Forms Make Up Pages 5.1 SubForms 5.2 Virtual Pages 5.3 Pages
Contents
Forms 6 Form Parameters 7 Opening Forms in Code 8 Copying Forms From Another Project 9 Related Topics
Plastic Layout
The Plastic Layout is a technique in which the application user interface is successively broken into smaller functional sections by the developer based on the application logic and the graphical design of the user interface. These sections are then programmatically organized into a spatial tree structure at run time. Each node in the tree is aware of the existence, state and behavior of other nodes and can respond to layout changes (communicated as events) according to changes in content and the rules set out by the developer at design-time. In Morfik the application user interface is built using forms. Forms represent major nodes within this tree structure; however, there are other nodes that exist in the tree and are important in the layout process. A form is comprised of a series of repeatable bands. Within each band there are user interface elements such as button and container controls? A special node, Subform control, is used to link forms within this structure. Read more... Forms are visually created in Morfik using a sophisticated WYSIWYG editor which is called Form Designer.
Form Designer
The Form Designer is a specialized part of the Morfik development environment which allows you to define the appearance and structure of your project's graphical user interface. whether you are building a Web-based application or a website, it enables you to position controls on the forms that compose the interface and configure their appearance and behavior. Form and control behavior can also be programmed with the code editor, which combines a powerful text editor with a debugger. Read more....
Plastic Layout
Forms
Bands
Forms are divided into a set of Bands. By default all Forms have at least three bands called: Header, Details and Footer. Additional bands can be created in Forms which are data bound, through the Sorting and Grouping option. Figure 1 in this article shows a diagram of a Form with its three default bands. The Header band appears at the top of the Form with the Footer at the bottom. The Details band which lies between the other bands is where most of your design work will happen, but both of the outer bands can be quite useful in completing a design which is both functional as aesthetically pleasing to the end users. A form can have one Detail band and has by default one Header band and one Footer band. But a form can have many more Footer and Header bands through the use of the Sorting and Grouping features of the Form and Form designer. Generally speaking it is unusual to see forms with more then seven bands, which imply two levels of Form Designer 3
Single Forms
A Single Form is a Form that is displayed just as designed, be it data bound or not. The only variations you will get in the appearance of a Single Form, i.e. a Form with View Mode set to vmSingle, are those relative to page resizing and the resizing of controls based on the content that is assigned to the Caption of TextLabel Controls. Non-data bound Forms are all Single Forms and data bound Forms are Single Forms by default. When data bound, a Single Form can be used to browser through data sets one record at a time, search for a specific record. If bound to a data source that references a single table it can also be used to edit or create a new record. All this functionality can be made available without coding if the developer chooses to display a Navigation Bar on one of the edge bands of the Form (Header or Footer).
Bands
Forms
Continuous Forms
Continuous Forms will replicate the controls which have been placed in its details band for each record in within data page for the data source to which the Form is bound. What this means is that it will visually transform, replicating those controls and their formatting and thus display a list. Once the the number of replicated control sets reaches the number specified in MaxRecordsPerPage the Form will stop replicating and will be complete. You can navigate to other data pages using either a Navigation Bar or the navigation methods available in the Form class. In as much as it displays a listing, but also has bands, a Continuous Form could be considered as a hybrid of an advanced data-grid and a Report. It can display in row-form a set of fields from multiple records. Of fundamental importance is to realize that both Single Forms and Continuous Forms are native to the browser and appear just like normal web pages. That is, any type of browser on any platform can view them. They do not any require any type of plug-in. In contrast to Single Forms, a Continuous Form can be considered as a hybrid of an advanced data-grid and a Report. It can display in row-form a set of fields from multiple records. It is from this perspective that a Continuous Form has some unique properties and features. It is possible, but not necessarily useful to anyone to display a thousand records, as this would lead to a very slow download time and an extremely large viewing page. Therefore, the most important feature is that you must define how many records are simultaneously displayed. The primary property that defines this limit is MaxRecordsPerPage. The power of a Continuous Form is that is represents the ultimate generalized version of a Data Grid. In a Data Grid, the data is displayed in a table-like manner with each record being displayed in a different row. However, with Continuous Forms, each record can be a fully-detailed Form in its own right each with its own data, formatting, and interactivity controls. The other advantage of a Continuous Form is that you only define the Form once and the Morfik Framework will automatically repeats the band for every record, up to the limit as defined by the value of the MaxRecordsPerPage property of the Form. Note 1: When you wish for users to enter or edit data it is best to use Single Forms as the Morfik Framework provides direct support for doing so. Single Forms, with the use of the Navigator, can be made not browse, insert, delete and edit records without any coding.
Note 2: For a Continuous Form, there is a one-to-many relationship between the controls that are placed on the Form (or Report) Canvas at design-time and those that appear at runtime.
To add the controls to allow a user to navigate between records, you can use the Form's built-in Navigation Bar. The Navigation Bar can be enabled and configured on either of the edge bands or even on both of them through the NavigationBar property that is available when one of these bands is selected.
Continuous Forms
Figure 5: Sorting and Grouping dialog in the Morfik Form Designer. How Do I: Implement Sorting and Grouping in Morfik Forms?
In this video you will learn how to use the Sorting and Grouping feature of Morfik forms to produce sophisticated data-driven web pages. You will see how data from two tables (Categories and Products) are presented inside a Query and list of products are Sorted and Grouped based on their categories.
Forms
Figure 7: The same ContinuousEditable form displayed in Figure 6, but with both versions of the Detail band stretched to show their labels in the Form Designer.
Continuous Editable Forms 7
Forms
When designing a Form that will be used as ContinuousEditable it is recommended that both versions of the details band have height as the Edit Mode version of the band will appear over the regular one whenever the Form enters data editing mode. For more on Continuous Editable forms refer to this article.
SubForms
A Subform is a special type of control which defines an area in which a form can be inserted into another form. SubForms are very important as they make it possible for the developer to breakup the design of a page into smaller parts. SubForms allow several different forms to be combined to make up a page. As you change which forms get inserted into what SubForms of an outermost form, you see different states which your application or website can assume. These different states that your application can assume are called virtual pages. Once you have established which of these states should be reproducible on demand by your end users, you can publish URLs for them.
Virtual Pages
A Morfik application is always composed of a single Web page, from the perspective of the Web browser. This page, through Ajax-based techniques morphs itself as it's state changes. In Morfik the state of an application user interface at any given point in time is considered to be a virtual page. Whenever the state of an application user interface changes in response to user input, the new state is thought of as a new virtual page. Read more...
Pages
Morfik Pages are the "materialization" of virtual pages that represent fixed states that your application will need to reproduce when required by the user. This is a technical way of saying that they represent what the end users of a Morfik application or website will perceive as web pages in their browsers. Read more...
Form Parameters
Form parameters are shared between the server side and the browser side of a Form. Every time you create a Form in the Morfik Workspace you are actually creating two common object classes in your code: one for the server and one for the browser side of the application. These two entities have very different behaviors at runtime but which, at the same time, are very tightly integrated. At runtime, the Morfik Application Framework makes sure that the correct, updated, values of these parameters are transferred from one side to the other. This ensures
Forms Make Up Pages 8
Forms
that no matter where your code is running those parameters hold the correct, valid, values. Read more ...
FX Code
Procedure frmArticle.EditBtnClick(Event: TDOMEvent); Begin Case UserPrivilegeLevel Of eGuest: OpenForm('frmEditingNotAllowed', eStandard: OpenForm('frmEdit', eAdmin: OpenForm('frmEdit', End; End;
BX Code
Published Message Sub EditBtnClick(Event As TDOMEvent) Select Case UserPrivilegeLevel Case eGuest : OpenForm("frmEditingNotAllowed", Case eStandard : OpenForm("frmEdit", Case eAdmin : OpenForm("frmEdit", End Select End Sub "POPUP", "Parent:Subform1", "Parent:Subform1", """Modal=True""") """ShowAdvancedOptions """ShowAdvancedOptions
CX Code
published message void EditBtnClick(TDOMEvent Event) { Switch (UserPrivilegeLevel) { eGuest: OpenForm("frmEditingNotAllowed", eStandard: OpenForm("frmEdit", eAdmin: OpenForm("frmEdit", } }
The first OpenForm statement specifies that frmEditingNotAllowed should be displayed as a popup form, and that the popup form should be displayed modally. The second and third OpenForm statements specify that frmEdit should be displayed in a subform 'Subform1' of the parent form, with form parameter 'ShowAdvancedOptions'
Form Parameters 9
Forms
having a value of 'False' and 'True' respectively. The behaviour of the parameter ShowAdvancedOptions would then be implemented in the browser-side code of frmEdit like so:
FX Code
Procedure frmEdit.WebFormReady(Var Ready: Boolean); Begin DeleteBtn.Visible := ShowAdvancedOptions; // ... other advanced options... End;
BX Code
Published Message Sub WebFormReady(ByRef Ready As Boolean) DeleteBtn.Visible = ShowAdvancedOptions ' ... other advanced options... End Sub
CX Code
published message void WebFormReady(ref Boolean Ready) { DeleteBtn.Visible = ShowAdvancedOptions; // ... other advanced options... }
10
Forms
Related Topics
Introduction and Overview How is Morfik different? Understanding Morfik's approach to Web application layout Identifying and creating your application pages Building navigation menus and linking your application pages Using Forms to build your application user interface Working with Forms to add behavior and content to your application Working with Continuous Forms at Run Time Using Controls and Widgets to add interactivity and display content Controlling the layout of your application Using Graphical Effects to enhance presentation Maintain consistent presentation through use of Themes and Styles Creating Interfaces for the Mobile Web
Back to top
Related Topics
11
Using_Forms_to_build_your_application_user_interface
Both the Morfik Framework and the development environment are designed to make it easy for the user to decompose the problem of creating a web interface into small and easily manageable parts. This is accomplished through the use of pages that are assembled from Forms. In order to create a good-looking and efficient interface for your web-based application you need to figure out the best way to break down your interface into small Forms and put them together as parts of Pages. You also need to decide how and where you will be using the Form's bands to display relevant data or achieve desired graphic results. There are two major factors that will influence your decision: Data Sources and Appearance.
Figure 1 A Page designed by using bands and composing several forms through the use of SubForm controls.
Contents
1 Breaking up your design into Forms 2 Design choices based on data sources 2.1 Handling Master-Detail Relationships 2.2 Displaying lists 3 Design choices based on appearance 3.1 Foregoing a Header Band 3.2 Foregoing a Footer Band 4 Related Topics
Using_Forms_to_build_your_application_user_interface within a form. These elements make the displaying of information from multiple tables pretty straightforward, leaving the work of assembling all the data into a single data set to the database objects of your application. The diagram in Figure 2 shows a Page that is divided into five different areas, two of them represented by a its native Header and Footer bands and three others represented by three SubForm controls and marked as: Side Bar, Featured Items and Content.
Figure 2: The areas highlighted in red indicate where SubForm controls are used to break up the Page into smaller areas, each of which can be designed as a separate form.
The difference between the layouts shown in Figures 1 and 2, for example, are related to the desire to have content that is considered special in some way appear at the very top. The natural way to implement such a scenario in Morfik is to use a SubForm control and embed a form which recovers and displays the required information in that particular position. The decision to embed a form in a particular position is generally more closely related to either aesthetic or data retrieval reasons, but in cases such as this both play a very important role. The form to be embedded at the Featured Items region will apply some sort of filter on the whole body of content to determine which items are to be featured. Because these items are supposed to be worthy of special attention, the design should be different enough from the rest of the page to draw attention. In the layout shown in Figure 2, the Featured Items section runs horizontally across the top of the area generally occupied by content. This would might be a good opportunity to employ a continuous form with columns, such as that employed in the home of Morfik's BookCollector sample project. This case highlights both major reasons why you would make a section of your "page" or outermost form into an embedded form: Selecting a new data source, and having data shown in a special design such as in columns.
Using_Forms_to_build_your_application_user_interface
Figure 3: The Form Band that can be seen at the top, with the text STITLE is what is known s a group header. This kind of header is added to the Form whenever you choose while creating a grouping or sorting option.
In the case of the form displayed in Figure 3, we wanted to have the title for a section of articles to be displayed above their summaries. We could not, however, use the regular header to do so, because the form must be a continuous form in order to display the titles and summaries for all articles. This precludes us from binding controls in the header to data fields as there would be no way to specify which of the records would be the source of the displayed information. To work around this we create a Group Header which will take the name of the field by which data is to be grouped. In such a group, all records will have the same value for that specific field and therefore it can be used in that particular header.
Using_Forms_to_build_your_application_user_interface
Figure 4: Same form that appears in the previous figure with the Group Header extended to show its name.
Displaying lists
Morfik forms have a view mode which is specifically designed for displaying lists of items. In this mode, which is set by choosing vmContinuous in the View Mode property of the form, all controls inserted into the Details band will be repeated once for each record in a data page. These records will be retrieved from the forms data source and the exact number of records will be defined by the MaxPageSize form property. Read more...
Using_Forms_to_build_your_application_user_interface
Continuous forms are ideally suited to presenting any and all kinds of lists to users. These can go from having the plain appearance similar to a sophisticated ListBox control from to very complex lists with varied control types for displaying different kinds of information or even recursively embedded lists to provide a view into a hierarchical data structure.
Figure 5: This form is used to provide a simple list of records in a table, one line/row for each record. The form that is shown in Figure 5, above, is intended to display information about an article or document being published on a website. Notice how different bits of information about the article are arranged around the form to provide clear and immediate access to everything a user might need to decide to go ahead and read an article in full. This form does not follow the mold of a plain list, but arranges information in multiple lines using up more vertical space in order to provide the application's user with a more meaningful sample of the articles.
Figure 6: This form is used to provide a structured view of information about articles. The information is arranged in fo lines/rows of controls, but the bottom TextLabel control will expand to multiple lines if the data so requires.
Using_Forms_to_build_your_application_user_interface
If you are building a corporate website or an internal system, there is no need to dynamically compose your header from a database. You already know the name of your company, you already have its logo. In most of these cases the best thing is to go ahead and just create a header with the information you want to display at design time. This will, actually, provide you with an exact picture of how your application will look, right in the form designer. Website footers are used most often as an area in which to place a series of links and information which, though not part of the core functionality of the application or website, should be available to the end user. This generally includes links to contact pages, copyright information, privacy statements, etc.
Figure 7: This page's design creates the website header within the Details band of the current form. Notice the image bleeds across the "boundaries" of the "header" and into the content area. In the picture you see in Figure 7 there is an image that crosses into the area that can be considered to be the Header that is going to be displayed in the application. This is only possible because the form is not making use of the actual Header band.
Design choices based on appearance 6
Using_Forms_to_build_your_application_user_interface
Placing controls that are not intended as content, but as a header, inside the Details band of your form or page can indicate the need to include one or more SubForms in the same band for displaying actual content, as more often then not it will come from the retrieval of records in a database.
Related Topics
Introduction and Overview How is Morfik different? Understanding Morfik's approach to Web application layout Identifying and creating your application pages Building navigation menus and linking your application pages Getting to know Morfik Forms Working with Forms to add behavior and content to your application Using Controls and Widgets to add interactivity and display content Controlling the layout of your application Using Graphical Effects to enhance presentation Maintain consistent presentation through use of Themes and Styles Creating Interfaces for the Mobile Web
Back to top
Working_with_Forms_to_add_behavior_and_content_to_your_application
Forms are a fantastic tool in Morfik as they can be combined and recombined in a Morfik application in order to achieve both design and functional goals. Forms allow you to partition your design into small parts which, once you are familiar with their usage and potential, can be combined in new and innovative ways to enhance how your application works.
Contents
1 Using forms as controls 2 Popup Forms 3 Form injection 4 Related Topics
Contents
Working_with_Forms_to_add_behavior_and_content_to_your_application
Figure 1: BookCollector application with a button strip that toggles which form is displayed within the central area of the Page.
Popup Forms
Popup forms are very easy to use in Morfik, differently from just about any other web development tool. A single parameter added to an OpenForm function call is all that is necessary to make a form appear as a popup. This allows Morfik developers to pursue design options which most other developers would avoid due to the amount of work involved. Popup forms are used in Morfik in several kinds of activities: to provide more detail about a data element selected within a page, for login in user authentication schemes and for general data entry. The first option is by far the
Using forms as controls 2
Working_with_Forms_to_add_behavior_and_content_to_your_application
least frequently used as consistent web interfaces will tend to adapt to changes in embedded information instead of relying on popups. The other two uses, however, are very common. Morfik's Authentication and Access Control Package offers a pre-built user sign-in form that can be displayed as a popup when the user chooses to be authenticated.
Figure 2: Popup sign-in form implemented by Morfik's Authentication and Access Control Package There are no limitations on the size or complexity of forms that are displayed as popups. This means that if the developer should choose to do so, large portions of an application's interface can be implemented in the form of popups. Popups can, for example, be used for data editing and input while the underlying page is used solely for data presentation. This approach requires the presence of links in the data presentation interface that invoke the popup forms for editing existing data or the input of new data. In order to display a form as a popup all you need to do is to specify the word "POPUP" as its target in a call to the OpenForm method, as shown in the following code snippet. FX Code
Procedure Index.SiteManagementOptionClick(Event: TDOMEvent); Begin If UserIsAuthenticated Then OpenPage('Admin', '"openmode=refresh"') Else OpenForm('UserSignIn', 'POPUP', '"title=Sign In", "modal=true"'); End;
Popup Forms
Working_with_Forms_to_add_behavior_and_content_to_your_application
BX Code
Published Message Sub SiteManagementOptionClick(Event As TDOMEvent) If UserIsAuthenticated Then OpenPage("Admin", """openmode=refresh""") Else OpenForm("UserSignIn", "POPUP", """title=Sign In"", ""modal=true""") End IF End Sub
CX Code
published message void SiteManagementOptionClick(TDOMEvent Event) { if (UserIsAuthenticated) { OpenPage("Admin", "\"openmode=refresh\""); } else { OpenForm("UserSignIn", "POPUP", "\"title=Sign In\", \"modal=true\""); } }
Form injection
Another interesting technique to add interactivity to your application or website's interface is to use form injection. When using this technique you position very thin SubForm controls in your forms so that when appropriate you can display a new form within them, making them grow. When you are through with the new forms, closing them can make the SubForm controls contract and disappear until a new form is opened within them.
Figure 3: A form with two very thin SubForm controls indicated by the arrows. In Figure 3 you can see a form from the Ajax for Small and Medium Business sample that is available from the Morfik website. At runtime the application causes the form shown in Figure 4 to appear within the top most SubForm shown in Figure 2.
Form injection
Working_with_Forms_to_add_behavior_and_content_to_your_application
Figure 4: Form which will be injected into the thin SubForm indicated in Figure
2. In figure 5 you can see a "page" which contains the form which is shown in Figure 2.
3 gets inserted into one of the SubForms in the first form. The result of this operation is shown at runtime in
Working_with_Forms_to_add_behavior_and_content_to_your_application
Figure 6.
Figure 6: Same "Page" shown in Figure 4, but now with the form show in Figure 3 inserted into the form that is shown in Figure 2, at runtime. In order to achieve this result, the following code was assigned to the OnClick event handler for one of the TextLabel controls in the form shown in Figure 3. Implementing this sort of behavior in your application's interface can yield a highly interactive application which provides a comfortable interface to the end users. A form appears on screen when it's needed, exactly where it is needed, and goes away later. This mode of interfacing with the end user for data entry is much less "disruptive" to the application's interface than bringing up a popup form. FX Code
Function "Staff ToDos Subform".Container1Click(Event: TDOMEvent); Var Inx : Integer; Begin Inx := Container1.BandIndex; EditContainer.BandIndex := Inx; SubForm1.BandIndex := Inx; ToDOIDLabel.BandIndex := Inx;
Form injection
Working_with_Forms_to_add_behavior_and_content_to_your_application
ToDosID := ToDoIDLabel.Caption; NewToDo := False; OpenForm('Staff ToDos Details Form','Staff ToDos Subform:SubForm1(' + Container1.BandIndex.ToStr End;
BX Code
Published Message Sub Container1Click(Event As TDOMEvent) Dim Inx As Integer Inx = Container1.BandIndex EditContainer.BandIndex = Inx Subform1.BandIndex = Inx ToDoIDLabel.BandIndex = Inx ToDosID = ToDoIDLabel.Caption NewToDo = false OpenForm("Staff ToDos Details Form", "Staff ToDos Subform:SubForm1(" + Container1.BandIndex.To End Sub
CX Code
published message void Container1Click(TDOMEvent Event) { Integer Inx; Inx = Container1.BandIndex; EditContainer.BandIndex = Inx; Subform1.BandIndex = Inx; ToDoIDLabel.BandIndex = Inx; ToDosID = ToDoIDLabel.Caption; NewToDo = false; OpenForm("Staff ToDos Details Form", "Staff ToDos Subform:SubForm1(" + Container1.BandIndex.ToSt }
Notice in the call to the OpenForm function in the previous code snippet, the target parameter is not a straight up form and subform name combination. The target in this case has an Index in its composition because the target form is included in the details section of a continuous Form. This means that at run time there will be several instances of that particular control in the page at any one time so we must identify which of those instances we wish to use as the target destination for the call to OpenForm. This use of an indexed target is not uncommon in Morfik programming and is in fact a necessity when dealing with SubForms in the details Band of a continuous form.
Related Topics
Introduction and Overview How is Morfik different? Understanding Morfik's approach to Web application layout Identifying and creating your application pages Building navigation menus and linking your application pages Getting to know Morfik Forms Using Forms to build your application user interface Working with Continuous Forms at Run Time Using Controls and Widgets to add interactivity and display content Controlling the layout of your application Using Graphical Effects to enhance presentation Maintain consistent presentation through use of Themes and Styles Creating Interfaces for the Mobile Web
Related Topics
Working_with_Forms_to_add_behavior_and_content_to_your_application
Back to top
Related Topics
Using_Controls_and_Widgets_to_add_interactivity_and_display_content
When you first create a form, it is just a an empty rectangle. In order for forms to display information to the users of your application or website, it needs to have mapped out what information to display, where and in what form. In order to provide this map to a form, we place controls and widgets in its design surface. The same concepts apply to the reports in your project. Controls are the most basic building blocks of the interface of your website or application. Controls are placed directly onto the design surface of forms or reports, inside one of the document's bands. Morfik offers a set of controls which are theme-aware and that will change their appearance when you change the project's themeguaranteeing that your project has a consistent look, always. Widgets are a level up from controls, being built from them. Every widget is composed of one or more controls, customized to work differently from how the base control(s) work by default. Read more...
Contents
1 Basic information display 2 Basic interactivity 2.1 Data navigation 2.1.1 Navigating through pages 2.1.2 Navigating through records 3 Data entry 3.1 Data entry controls 3.2 Navigation Bar for data entry 3.3 Functionalities in-a-Box 3.3.1 Widgets: user created controls 3.3.2 More widgets 4 Related Topics
Basic interactivity
Using Morfik we can start to create basic user interactivity using the same base controls involved in the basic information display, provided we just want to let the user change how and what information is being displayed. By assigning a URL to the link property of a TextLabel or Image control you can provide ways for the user to navigate to different pages. If a page to which the user is navigating to differs from the one that is currently
Contents 1
Using_Controls_and_Widgets_to_add_interactivity_and_display_content
displayed in the browser by only the contents of a SubForm control, only that SubForm will get reloaded. This is handled automatically by the Morfik Framework and provides a mechanism for allowing the user to choose different data sets to view. There developer does not even have to resort to writing code for this to occur. However, by adding a little bit of code to the mix it is possible to have small portions of the page change in response to where the user is moving the mouse pointer, or in response to clicks on specific controls. One of the most useful techniques for adding such bits of interactivity to a page is to simply toggle the state of the Visible property of a TextLabel or Container. The Morfik Framework automatically adjusts the position of controls which would be under the control which is becoming visible or invisible, providing a good visual result for minimum effort. When a page changes its state being so altered it becomes in effect a different virtual page.
Figure 1: A list of Frequently Asked Questions from the Morfik.com website. In Figure 2 you can see the same list of Frequently Asked Questions that is shown in Figure 1, but this time you can also see the answer to the first question. This answer is displayed by making visible a Container control which holds the TextLabel control for the answer and an "X" image in the bottom right hand corner when the TextLabel control with the text for the question is clicked on. To hide the answer of a particular question you click on the red "X" below and to the right of the answer.
Basic interactivity
Using_Controls_and_Widgets_to_add_interactivity_and_display_content
Figure 2: Same list shown in Figure 1, but with the answer to the first question visible.
Data navigation
While technically the Navigation Bar isn't considered a control or a widget it certainly looks like it. The Navigation Bar looks like a widget that was built from several Button and TextLabel controls. It lets the user navigate through a data set without ever doing a page reload. Read more... While this is a simple concept, the fact that the navigation does not require a page reload makes this a useful feature for adding interactivity to your application. By simply configuring a form to display a properly configured Navigation Bar you can allow the user to browse through different data sets. The Morfik Framework takes care of all the database connectivity and data set paging that is necessary to implement a smooth navigation experience for your users.
The Navigation Bar has options that work on the page and record levels. When you are building an interface to display information from multiple records in any portion of the screen, it makes sense to include a Navigation Bar configured for page-based navigation on that particular form.
Data navigation
Using_Controls_and_Widgets_to_add_interactivity_and_display_content
Page-based navigation options will request specific data pages from the server, as needed, when the user clicks on any operation. The actual number of downloaded records will match the value set in the MaxPageLength property of the form in question.
As previously mentioned, the Navigation Bar has options that work on the page and record levels. When you are building an interface to display information from a single record, at a time you can add a Navigation Bar configure for record-based navigation on that particular form. Record-based navigation options will request specific data pages from the server as the user navigates through the records. Records are always downloaded to the browser in a page-by-page manner. This means that the browser portion of your application will not be requesting more data from the server until your user attempts to navigate beyond the number of records already downloaded (in any direction).
Data entry
The next level of user interactivity is handling data entry. While websites are 95% built around displaying information, they do require some data input. Web-based applications are, generally, much more interactive in the sense that they are built to allow the user to store and manage information. In many cases we are talking about business information as web-based technologies become the standard for creating business systems in the corporate world.
Using_Controls_and_Widgets_to_add_interactivity_and_display_content
In Figure 3 you can see the Navigation Bar's buttons that are related to editing data. The highlighted buttons invoke the following functions, from left to right: Edit current record Submit/confirm edit Cancel edit Add record Delete record
Functionalities in-a-Box
Widgets are composed of controls and supporting code to provide some basic, pre-defined functionality. They allow you to combine several controls into what essentially becomes another control, available from the ribbon within your project. This can be a powerful resource to quickly add functionalities to an application. A good example of this is the Login Bar widget that is part of the Authentication and Access Control Package available from the Morfik Developer Assist program. When you drop this control onto a form it immediately adds user management and authentication functions to the application, without the user having to write a single line of code. Read more...