Monday, February 28, 2011

JavaScript Confirm Implementation in OAF

lolz XD I know it's not recommended, but I find redirecting the context to a dialog page not justifiable for a simple removal of a record in an advanced table ..

this snippet will append an OnClick event handler to a component (specifically an Image for this one). When a JavaScript call returns a false value, it will stop the page from submitting a request to the server.

TBC

Image Partial Page Rendering PPR

you could not declaratively attach a fire partial action on an image component, but you can programmatically do it ..


things to take note is the PRIMARY_CLIENT_ACTION_ATTR attribute object and FirePartialAction class.


PRIMARY_CLIENT_ACTION_ATTR represents the Action Type attribute of the (image) component.

OADataBoundValueViewObject allows you to use SPEL binding

Sunday, February 27, 2011

PER_CONTACT_RELATIONSHIPS

this table contains information on the employee's spouse, children, etc.

TBC

Wednesday, February 16, 2011

OAF Formatting Dialog Pages

by default, dialog page messages are formatted using only bold tags. However if you want to format it using other (combination of) tags ..

in Oracle Apps, first you need to wrap the message in html tags


this will tell UIX to use OAFormattedTextBean which will enable you to use the following tags


tags not on this list will be ignored @w@;;

sample usage:

ResultSetMetaData

I was looking for a way to determine the number of columns in a ResultSet object when I encountered ResultSetMetaData. With this class I only need to call on the getColumnCount() method


String getCatalogName(int column) Gets the designated column's table's catalog name.
String getColumnClassName(int column) Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet.getObject is called to retrieve a value from the column.
int getColumnCount() Returns the number of columns in this ResultSet object.
int  getColumnDisplaySize(int column) Indicates the designated column's normal maximum width in characters.
String getColumnLabel(int column) Gets the designated column's suggested title for use in printouts and displays.
String getColumnName(int column) Get the designated column's name.
int getColumnType(int column) Retrieves the designated column's SQL type.
String getColumnTypeName(int column) Retrieves the designated column's database-specific type name.
int getPrecision(int column) Get the designated column's number of decimal digits.
int getScale(int column) Gets the designated column's number of digits to right of the decimal point.
String getSchemaName(int column) Get the designated column's table's schema.
String getTableName(int column) Gets the designated column's table name.
boolean isAutoIncrement(int column) Indicates whether the designated column is automatically numbered, thus read-only.
boolean isCaseSensitive(int column) Indicates whether a column's case matters.
boolean isCurrency(int column) Indicates whether the designated column is a cash value.
boolean isDefinitelyWritable(int column) Indicates whether a write on the designated column will definitely succeed.
int isNullable(int column) Indicates the nullability of values in the designated column.
boolean isReadOnly(int column) Indicates whether the designated column is definitely not writable.
boolean isSearchable(int column) Indicates whether the designated column can be used in a where clause.
boolean isSigned(int column) Indicates whether values in the designated column are signed numbers.
boolean isWritable(int column) Indicates whether it is possible for a write on the designated column to succeed.

Tuesday, February 15, 2011

Mapping FND_USER to PER_PEOPLE_F

I would just like to note myself, EMPLOYEE_ID in FND_USER is the PERSON_ID in PER_PEOPLE_F

Wednesday, February 9, 2011

View Object Data Management Configuration



normally this is how I configure my ViewObjects
  1. updatable access through entity objects
    • for maintenance screens. This is good enough for simple CRUD operations.
    • requires you to create EntityObjects which acts as an interface to the DB. When an EntityObject is configured to a ViewObject, changes you make in the VO data/attributes would be reflected in the database.
  2. via SQL query with read only access
    • used when an SQL call can completely represent the data you need. One good thing about the ViewObject wizard is that when you configure the SQL query - it automatically maps the result set columns to the corresponding Java class/object attributes. (though I'm not sure with queries that have *)
    • note that you can have multiple subqueries and even call PLSQL functions
  3. programmatic data population
    • I use this with modules that need complex data manipulation and requires me to use PLSQL procedures and functions. (Prolly my favorite type @w@;;) A Cursor/ResultSet to ViewObject mapper method would be handy in this case (a sample source code is given in the OAF documentation)
    • even Java alone can utilize this type of ViewObject
TBC

Using Bound Values for Screen Rendering

this method is an alternative to SPEL. moreover it doesn't require you to use a PVO


RENDERED_ATTR is part of UIConstants which is extended by OAWebConstants implemented by  OAControllerImpl. So just browse UIConstants to know what attributes can you further control via setAttributeValue().


10022011 update
I made a file reader program to extract the ATTR attributes - sorted via MSExcel (will be useful as reference in the future)



OAWebBeanConstants UIConstants
ADD_AUTOFOOTER_ATTR  ABBREVIATION_ATTR 
ADVANCED_SEARCH_CONDITION_DISPLAY_ATTR  ACCESS_KEY_ATTR 
ADVANCED_SEARCH_CONDITION_VALUE_ATTR  ALIGNMENT_GROUP_ATTR 
ADVANCED_SEARCH_LIST_DISPLAY_ATTR  ALL_DETAILS_ENABLED_ATTR 
ADVANCED_SEARCH_LIST_VALUE_ATTR  ALLOWS_TRANSPARENT_ATTR 
AGGREGATE_FUNCTION_ATTR  ALTERNATE_TEXT_ATTR 
ALLOW_BLANK_VALUE_ATTR  ANCESTOR_ATTRIBUTE_NAME 
ANCESTOR_NODE_ATTR  ANCESTOR_ID_ATTR 
ATTACH_APPROVAL_REQUIRED_VIEWATTRIBUTE  ANCESTOR_PATH_ATTR 
ATTACH_ENTITY_NAME_DISPLAY_ATTRIBUTE  ANCHOR_ATTR 
ATTRIBUTE_APPLICATION_ID  ANNOTATION_ATTR 
ATTRIBUTE_APPLICATION_ID_ATTR  ATTRIBUTE_MAP_NAME 
ATTRIBUTE_CODE  AUTOFLIP_ATTR 
ATTRIBUTE_CODE_APPID_ATTR  AUTOMATIC_ATTR 
ATTRIBUTE_CODE_ATTR  AUTOSTART_ATTR 
ATTRIBUTE_CODE_KEY_ATTR  BACKGROUND_ATTR 
ATTRIBUTE_LABEL_LONG  BETWEEN_TEXT_ATTR 
AUTO_FOOTER_ATTR  BLOCK_ON_EVERY_SUBMIT_ATTR 
BLOCK_SIZE_ATTR  BLOCK_SIZE_ATTR 
CALLED_FROM_QUERY_ATTR  BORDER_WIDTH_ATTR 
CATEGORY_ID_ATTR  BOUND_ATTRIBUTE_NAME 
CATEGORY_MAPPINGS_ATTR  BREAD_CRUMB_TEXT_ATTR 
CATEGORY_NAME_ATTR  BULLETS_GROUP_ATTR 
CELL_NO_WRAP_FORMAT_ATTR  CALENDAR_ID_ATTR 
CHILD_VIEW_ATTRIBUTE_NAME  CATEGORY_TITLE_ATTR 
CHILD_VIEW_AUTO_QUERY_ATTR  CELL_PADDING_ATTR 
CLEAR_CACHE_ATTR  CELL_SPACING_ATTR 
COLUMN_HEADER_CHILD_ATTR  CHECKED_ATTR 
COLUMNS_ATTR  CHILD_BLOCK_SIZE_ATTR 
CONTENT_VIEW_ATTR_NAME  CHILD_DATA_ATTR 
CONTENTS_GROUPING_ATTR  CHILD_NAME_ATTR 
CRITERIA_FROM_ATTR  CHILD_TYPE_TEXT_ATTR 
CRITERIA_ITEM_ID_ATTR  CHROME_TYPE_ATTR 
CRITERIA_ROW_ATTR  CLICK_THRU_DESTINATION_URI_ATTR 

Thursday, February 3, 2011

OAF Callable Statement Parameter Binding

unfortunately ..

  • when you set parameters using Ordinal binding, you must get OUT parameters via index
  • you could only get OUT cursor parameter via index which forces you to use Ordinal binding - because CallableStatement only have getCursor(int index) method.

Advanced Table Single Selection

This component is used when you have a requirement that enables the user to select only one record (row) from a table. The idea is to "flag" the row attribute with a non-null value, in order to identify the selected row.


right click the advanced table then select New > Single Selection. It will appear as one of the advanced table components named tableSelection. Afterwards you need to configure an attribute that would act as a flag on the ViewObject you are using.


In this case, I have created a transient attribute named Selected


to determine the selected record, you must iterate the ViewObject and evaluate the "flag" transient attribute you created above. Or it might be possible to attach a firePartialAction on the single selection component then set a form value in the page so you can pass the value via parameters (theoretically it could be done - but I still have to verify this)

TBC ..

Tuesday, February 1, 2011

Looping through REF CURSOR


inside a LOOP you need to FETCH from the REF CURSOR to a RECORD (with matching field declarations). Then from the RECORD you could access the field values. Terminate the LOOP via EXIT command (syntax: EXIT WHEN [condition]) - usually [cursor_name]%NOTFOUND condition is used.
  • RECORD must match the REF CURSOR's order/number of attributes
  • in case the REF CURSOR is opened to a [SELECT *] on a table, use the table's %ROWTYPE (e.g. syntax PAYMENTS%ROWTYPE)