Friday, May 29, 2009

Default User Name on LoginScreen for Business Matrix or System

Have you ever been annoyed that every time you open enovia's "Business", "Matrix" or "System", you have to remove the name which is by default your login id and replace it with creator.

Its time to stop being annoyed, here is a solution for that problem.

Open your Matrix.ini file which is present by default in C:/Windows.
Add the following line to it.

USER=creator

What is this setting doing??
This setting is telling the applications (Business,Matrix, and System) to use creator as the default user name.


Hope this will save some time for all of you ...

Tuesday, May 26, 2009

Type Ahead (Auto Complete) in UI Webforms / Tables

Today I would like to share Matrixone's Type Ahead feature a feature very much similar to Google's Auto Complete.

The Type Ahead feature stores text values entered in form text fields, then displays the most recent entries the next time that the user enters that field. They can then select from the list rather than needing to type the complete value or use a chooser.

If the field uses a JPO:method, the functionality is slightly different. The field pops up the list of recently-entered values as described above. When the user types something that does not match any of those values and exceeds the character count setting, the JPO is triggered to return the list of matching values returned by the JPO method.

Below are the UI field settings:

· TypeAhead=true|false Enables type ahead. If not provided, automatically set to true. Typically used to disable type ahead for a field.
· TypeAhead Program—Name of the JPO called to retrieve a list of possible values. This JPO is called after the user types the specified number of characters. A JPO is typically used by fields that are normally populated using choosers.
· TypeAhead Function—The name of the JPO method used in conjunction with the TypeAhead Program setting.
· TypeAhead Character Count—Overrides the emxFramework.TypeAhead.RunProgram.CharacterCount system property. This setting may be useful for fields whose values may all contain the same prefix.
· TypeAhead Saved Values Limit—Overrides the emxFramework.TypeAhead.SavedValuesLimit system property

The configured TypeAhead program should extend emxTypeAhead and the function should have the below format

public String test(Context context, String[] args) {
String filter = args[0];

addValue("first", "hidden_first");
addValue("second", "hidden_second");
addValue("third", "hidden_third");
setAllDataSentAttribute(true);
return (toXML());
}

This Type Ahead feature is implemented using the Matrix Cue objects which are context specific just like the sets, so the stored / returned values are also specific to the context user. The number of values stored for each user per field depends on the value for the emxFramework.TypeAhead.SavedValuesLimit property in the emxSystem.properties file. The default is 10 unique values and can be overridden at the field level using the Type Ahead Saved Values Limit setting.

This Type Ahead feature can also be implemented in custom forms using framework’s tag library, please refer to the app dev guide for more details.

Thursday, May 21, 2009

Dynamic Columns in UI Table

Discussed here is the UI Table feature that was introduced recently into enovia.

Have you ever run into a situation where the requirement said that the display screen should have multiple columns depending on the input, and we had to write a JSP to implement this, because UI Table could not display multiple columns depending on the input?

This kind of requirement can be implemented using dynamic columns feature in UI Table.

Dynamic Columns in UI Tables

Traditionally we used to define a certain number of columns in the UI Table definition, and all those columns were displayed on the screen.
With dynamic columns feature we can define the number of columns displayed on the screen , on the fly using a JPO.
Here is how you define a dynamic column

UI Table column definition.
• Column Type = Dynamic
• Dynamic Column Program = JPO name
• Dynamic Column Function = JPO method name
In this JPO Method you can define the # of columns that will be displayed on the screen.
The output of this column to should be a Maplist, that will contain the # of maps that is same as the # of columns you want to display.
The format of the Map per column is given below.

if colMap is the Map for one column, then at a minimum the Map should contain.

colMap.put("name", "<Name of the Column>" );
colMap.put("label", "<Lable for the Column>" );
colMap.put("settings",<Map with the settings for the column>);

example for settings Map:

settingsMap.put("Registered Suite","Framework");
settingsMap.put("Admin Type","Type");
settingsMap.put("Target Location","content");


Please let me know if you have any questions.

UI Table Validations



Basically this is explaining how to do validations on tables.

Last week I had to do number validation on a emxTable edit to allow user only to key in values between 1-999. Initially thought of handling it with the attribute range but it becomes a huge drop down to choose from, that is when I opted for custom JavaScript validation on edit table (this valid for forms)

Below is a quick summary of the implementation:

1. You can use a custom JavaScript method to validate any field when it is displayed in Edit mode and the Editable setting is true. The method name is configured for the field with the Validate=methodName in table setting. The method can refer to the control with the keyword “this”.
2. For example, for a field with the Validate=validatePortfoilioPriority setting, the system calls the validatePortfoilioPriority () JavaScript function (shown below).

The function must return true for successful validation.


// JavaScript
function validatePortfoilioPriority() {
if(condition) {
} else (condition) {
}
return true;
}


3. Add this function to any JavaScript file or any JSP file. Make sure the name of the file is specified in emxSystem.properties file with the key SUITEKEY.UIForm.ValidationFile. You can assign one or more
files (separated by a comma) as the property value.

eServiceSuiteProgramCentral.UIForm.ValidationFile = scripts/bcValidation.jsp
You can assign one or more files separated by a comma as the property value
Please refer to Enovia Matrixone Application Development Guide for more detailed information.



Note: For reference just sees the “bcProjectDashboardEditTable” table in clear case (spinner/programcentral/business) and the method what I wrote is put in “bcUIFormValidation.jsp” in programcentral. And search for the fallowing line

“eServiceSuiteProgramCentral.UIForm.ValidationFile = emxProgramCentralUIFormValidation.jsp,bcUIFormValidation.jsp” in emxSystem properties file. This is the way we have to give the name of the file in emxSystem Properties file.