DEV Community

Peter + AI
Peter + AI

Posted on

🎨 Setting Widget Properties in Uniface 10.4 - A Quick Guide

Note: This blog post was created with AI assistance based on Rocket Uniface 10.4 documentation.

πŸ“ What Are Widget Properties?

In Uniface, widgets are the visual elements users interact with in your application. Think of them as building blocks for your user interface - like text boxes, buttons, or dropdown lists. Each widget has properties that control how it looks and behaves.

πŸ”§ Where Can You Set Widget Properties?

Uniface gives you three ways to configure widget properties, and they follow a clear priority order:

  1. Initialization Files - Default values for all widgets
  2. Properties Inspector - Override defaults for specific widgets
  3. Script at Runtime - Dynamic changes while the app runs

Each level overrides the previous one, giving you flexibility to set sensible defaults while customizing when needed. πŸ’ͺ

🎯 Setting Properties for Entities and Fields

Entities and fields are the data elements in your Uniface components. Here's how to configure their widget properties:

Step-by-Step Process:

  1. Open Your Component - Launch the Uniface IDE and open either a Component or Modeled Entity for editing
  2. Select the Element - In the Define Structure worksheet, click on the entity or field you want to configure
  3. Choose Widget Type - In the Properties Inspector, select the appropriate widget type for your component
  4. Configure Properties - Click the More icon in the Widget Properties section to open the properties dialog

πŸ’‘ Example Scenarios:

  • Form EditBox - Configure text input fields for desktop forms with specific formatting rules
  • Dynamic Server Page EditBox - Set up web-based input controls with validation
  • Static Server Page Text Control - Define read-only text displays for web pages

🌟 Important Concepts to Remember

Inheritance Model

Uniface uses an inheritance model for properties. If you set properties on a modeled entity, all components using that entity will inherit those settings. Component-level settings override modeled settings, giving you both consistency and flexibility. πŸŽͺ

Adding Custom Properties

What if the widget property you need isn't visible in the dialog? No problem! Click the More button and add it as a widget parameter. This extensibility ensures you can configure any valid property for your widget type. ✨

πŸͺŸ Window Properties for Form Components

Form components have a special physical widget called uwindow. This widget controls the overall window appearance and behavior. While Dynamic Server Pages and Static Server Pages don't have component-level widget properties (except Title), forms give you full control over the window through Window Properties.

Example Window Configurations:

  • Window size and position on screen
  • Whether the window is resizable or fixed
  • Title bar text and appearance
  • Modal or modeless behavior

πŸš€ Practical Tips

Use the Right Tool for the Job:

  • Initialization Files - Set organization-wide standards and defaults πŸ“‹
  • Properties Inspector - Configure specific components during development πŸ”¨
  • Script - Make dynamic adjustments based on user actions or data 🎭

Finding Property Names:

Each widget type has its own set of valid properties with specific literal names. Always consult the Widget Reference documentation for:

  • Dynamic Server Pages widgets
  • Static Server Pages widgets
  • Forms and Reports widgets

πŸŽ“ Conclusion

Understanding how to set widget properties in the Properties Inspector is fundamental to creating well-designed Uniface applications. The three-tier approach of initialization files, Properties Inspector, and runtime script gives you the perfect balance between consistency and flexibility. Start with sensible defaults, customize where needed, and use script for dynamic behavior. πŸŽ‰

Remember: The Properties Inspector is your friend during development - it provides a visual, intuitive way to configure your widgets without writing code. But when you need dynamic control, script is there to take over!


Happy coding with Uniface! πŸ‘¨β€πŸ’»πŸ‘©β€πŸ’»

Top comments (0)