Posts

Showing posts from 2011

تاسيس الشركات ذات المسؤلية المحدودة

http://www.lawforall.info/index.pl/incorporation_of_llcs

error in internet explorer

http://www.oratraining.com/blog/2010/04/internet-explorer-has-closed-this-webpage-to-help-protect-your-computer/

how to create dynamic menu based on table

http://biemond.blogspot.com/2008/11/dynamic-menu-based-on-roles-database.html

How to create fixed list in ADF

Image
1- create a read only view object based on a query example: SELECT 'Reject' DESCRIPTION ,'BCK' CODE FROM DUAL UNION ALL SELECT 'Accept' DESCRIPTION ,'GM' CODE FROM DUAL 2- in the base view object (your main view object that you want to add the fixed list) add a new Transient attribute for example "Manager_descision" 3- Create view accessor in the main view abject that referes to the readonly query VO 4- associat a LOV to your Transient  attribute that is based on your view accessor   Note that you must add list return value to retrun the value to the database attribute to save the returned value in the DB 5- in your page drag and drop the transient attribute from the data control to the page as selectOneChoceList 6- go to the page Bindings and select the attribute in the strucure window and right click to add attribute names and attribute values 6- save and run the page

The JRE was not found in directory

Image
The JRE was not found in directory G:\weblogicServer\jdk160_21. (JAVA_HOME) Please edit your environment and set the JAVA_HOME this error occurred when deploying a page on jdeveloper. to solve this error go to tools menu and  select credentials and correct the path specified

Deleting multi-selected rows from adf table

Image
In this example i will selected rows using 1)  CTRL or SHIFT with mouse click 2)  Checkbox at the row and press Delete button for ease of understanding i created 2 separate buttons in the examples. Before start i assumed you already setup a Application with EO,VO and AM also using HR Connection - Add a Transient Attribute to VO of Boolean type named "SelectedRow" We will use this to select row Here the layout looks like - Drag a Collection from DataControl as ADF Table to JSF page - Dont Check RowSelection Checkbox - Set the table RowSelection property to multiple - Set EditingMode property to clickToEdit - Surround your table with af:PanelCollection for look and feel give table a id "myTab" - Add a toolbar in toolbar facet of Panelcollection - Add 2 toolbar buttons to your toolbar - Add partial triggers to your table reference both buttons on toolbar - Create a backing bean - Add a RichTable object to your bean with getter and setter methods.

Another user has changed the row with primary key oracle.jbo.Key[12 ].

Image
Try these solutions:  make sure that you check "refresh after insert" and refresh after update" for the primary key column in you entity object. in the application module tab Click the Properties tab and select jbo.locking.mode. Double click the “pessimistic”value next to the property to open the field editor and type “optimistic” over the value.Press enter. if error still exist then you must set "refresh after insert" and refresh after update" as true for all attributes in the entity object another way is to execute the View Object after the commit operation to bring back updated data to ViewObject. For this we need to override the  afterCommit()  of ViewObject class as follows:                  public void afterCommit(TransactionEvent){                         executeQuery();                       }              5- another way to solve this error is to overide the lock() method of the EntityImpl class       public void lock() {    

Detail entity with row key null cannot find or invalidate its owning entity.

Image
in the model project go to the association. double click on the association and expand the behavior node under relationship tab. make sure that the primary key column is set to DBsequance, if you have a sequence on the database or a function that generate the db sequence from a trigger 3- check on composition association and cascade update key attribute 4- When an entity row is created it's row status is STATUS_NEW . This means row is added in the transaction's list of changes to be validated or posted or committed. This is fine and expected in most of the cases. However, during complex business objects like master-detail there comes the situation where you may want to turn off these validations until both master and detail are available. For such situations to remove the row from transactions's list of changes ADF exposes an api setNewRowStatus(ROW.STATUS_INITIALIZED). This is specifically helpful when master-detail association is a composite association

Open wikipedia in a modal popup.

Image
This post was more or less inspired by the  noteWindow  example on Oracles tag demo site. When hovering the highlighted text in this example the user gets extra information about the subject. I wanted to give the end user the opportunity to get even more information, for instance by invoking a wikipedia page about the subject. The catch here is that I wanted this information to be shown in a modal popup, and one that is not prohibited by popup blockers. Luckily ADF 11g provides javascript popups that can also be made modal, so the user has to close the popup before returning to the application. This post describes how I used an  in a  to open the correct wikipedia in a modal popup. Step 1: Create the plain text that invokes the noteWindow. This is taken directly from the mentioned Oracle example. Vultures are scavenging birds, feeding mostly on the carcasses of dead animals. Vultures are found in every continent except

How to launch LOV and Date dialogs using the keyboard

How to launch LOV and Date dialogs using the keyboard By frank.nimphius on February 26, 2011 9:13 AM Using the ADF Faces JavaScript API, developers can listen for user keyboard input in input components to filter or respond to specific characters or key combination. The JavaScript shown below can be used with an af:clientListener  tag on  af:inputListOfValues  or  af:inputDate . At runtime, the JavaScript code determines the component type it is executed on and either opens the LOV dialog or the input Date popup.    < af:resource  type="javascript">       /**       * function to launch dialog if cursor is in LOV or        * input date field        * @param evt argument to capture the AdfUIInputEvent object      */    function launchPopUpUsingF8( evt ) {       var component = evt.getSource();        if (evt.getKeyCode() == AdfKeyStroke.F8_KEY) {        //check for input LOV component          if (component.getTypeName() == 'AdfRichInputListOfValues') {

Dynamically add region at runtime

1-       Create a .jspx page based on your template as usual   and leave it blank until this time 2-       Create   all the bounded taskflows   that you wants and create the page fragments as usual. 3-       Create a java bean class called"DhamanJavaBean" Package org.dhaman import oracle.adf.controller.TaskFlowId; public class DhamanJavaBean {     private String taskFlowId = "/WEB-INF/emp-flow.xml#emp-flow";     public DhamanJavaBean () {         super();     }      public TaskFlowId getDynamicTaskFlowId() {       return TaskFlowId.parse(taskFlowId);   } }  At this moment the calss contains only one attribute " taskFlowId" and only one method " getDynamicTaskFlowId()" 1-       Double click the "adfc-conf.xml" unbound taskflow and click on overview tab to add a new managed ben as follow: -           Name:           dhamaBean -           Class :           org.dhaman .DhamanJavaBean -           Scope:           pageflow 2-       Now re