Skip to content

Web Framework Misc Tips

Secure File Streaming Interface

Suggested Web Browser Testing Environment

Visual Design in the Studio

  • In the Studio, use the Web Designer to review and modify visual web objects via drag and drop. This can be enabled by opening a Web view/dialog file and performing a code/designer view toggle (e.g., F7). The Web Designer is in a panel and can be undocked, sized, and located where you like.

  • The easiest way to move objects around is via drag and drop or in Code Explorer.

  • Building Views: You will probably want to start building a view by using the view wizard. The Web View Wizard allows you to create a view with no controls. This gives you all the flexibility of creating a web view using one of our templates (which can still be done) with the added capability of creating the DDO structure for you.

Designing Your Layout

  • When experimenting with multiple panel layouts, you can set the psBackgroundColor property of the panels to different colors (e.g., red, yellow, aqua) so you can see how the panels are laid out.

  • Start simple when laying out controls. The simplest way to get a good looking screen is to place every control in a new line at column 0 and then adjust each column’s piColumnSpan to get a good width.

  • You might want to set a fixed width and a fixed height for your views. This is most easily done at the view level using piHeight and piWidth.

  • You can learn a lot by using the Web Data Entry View Wizard. It has an automatic mode that attempts to create good widths for your controls based on the table column width. You can see how it adjusts piColumnSpan, piColumnIndex, and piLabelOffset to get the desired results.

  • While using the Web Data Entry View Wizard, turn off the Auto Adjust option and manually set numbers in the grid to see how each number affects the design of the view.

  • Choosing a larger piColumnCount provides greater precision. We have found that a count of 6 to 12 is a good start. Both are divisible by 2 and 3, which makes laying out controls that use that many spaces on a panel easy.

Unique Object Names

  • Web object names must be unique within their parent (i.e., each sibling web object must have a unique name).

Panel Layout Tips

  • First and foremost, start by keeping things simple. Don’t create panels if you don’t have to. We suggest that you start by creating a single center cWebPanel object in your view. Place your DDO structure at the top of your view and add your web-controls inside the panel. Often this is all you need. This is what the wizards do.

  • Web panels and web controls cannot be mixed within a parent. It is one or the other.

  • Each web panel within a parent must have a unique region (peRegion).

  • The center panel, which is the default region, is your most important panel and is always the place to start your design.

  • When attempting to control the heights and widths of panels, you should only set the dimensions that matter.

  • Controlling the border panels: The only size that you have to set is the width of the left and right panels; the system cannot calculate this for you. The top and bottom panel size to their content by default, but you might want to set it if you want them bigger.

  • Controlling the center panel: Usually, you won’t set the dimensions of the center panel, and it will take the space available. You might want to set the height, but if you do, it can be ignored if the left or right panel wants to stretch (see stretching below). The left, center, and right panels will always end up having the same height!

  • Stretching and pbFillHeight: A complicating factor in all this is when a panel has controls that have pbFillHeight set to true. If that is so, then this panel will try to take all the space available. Only panels in the center, left, or right region will do this. The effect actually bubbles up when multiple layers of panels are nested.

Web Property Tips

  • A web property is declared using the WebProperty meta tag, which must be placed above the Property command.

  • Unlike the Get and Set commands, WebSet and WebGet do not delegate. The property must be understood by the object receiving the WebGet/WebSet commands.

  • With web properties, Get & Set are used to retrieve and, less frequently, set the design-time/creation-time value of the property. WebGet and WebSet are used to retrieve and set the current value of that property. You will normally want to use WebGet and WebSet inside of your methods and events.

Web Event Tips

  • Remember that a client event does not send every event to the server and that for most events there is a property that determines if the event should be sent; that property takes the format of “pbServer + Event” name (e.g., OnClick is controlled by pbServerOnClick).

  • We've enabled server events for the events that are most likely to need them, such as OnClick and OnSubmit. When we are not sure, we've erred on the side of fewer client-server round trips.

  • The most common error will be to forget to enable a server-side event. When not enabled, nothing happens and your application appears broken. If you place a breakpoint on the event, it will never get called. If this happens, make sure the server-side event is enabled by toggling the related property to True.

  • You can use a browser debugger like Firebug to monitor requests and responses. If an event is not server enabled, there will be no request/response activity.

See Also