Thursday, August 23, 2007

Duncan Again

Using the Value of an ADF List Binding
Written By Duncan Mills, Oracle CorporationJune, 2006
Using list bindings ADF makes it very easy to associate drop-down lists and radio groups with either static or dynamic sets of data. When a suitable attribute is bound by dragging from the Data Control Palette and dropping as "Single Selection" the user specifies the value that will be populated and the label to use on the list entries themselves.
Where things get slightly confusing with such bound list UIs is the matter of a developer's initial expectation as to how the list should work. Taking the example of the EMPLOYEES and DEPARTMENTS table from the HR demo schema. If the Employee DepartmentID attribute is bound as a list and populated from the DEPARTMENTS table, the natural assumption would be that the list is composed of a set of elements, each of which, has a DepartmentID value and a DepartmentName label, for example 10-Administration, 20-Marketing, 30-Purchasing ...80-Sales and so on.
With this assumption in mind, developers often make the mistake of treating the value of the list binding as one of these expected values and trying to write code or expressions based on that. For example the developer might decide to conditionally render the Commission field on the screen using an expression based on the value of the DepartmentId field. In the example of a JavaServer Faces UI this might look like the following:
However, the expected result is not achieved because that initial assumption about the "value" of the list binding is actually incorrect. ADF actually manages the selected value of the list item internally and the value that is exposed through the list binding itself is only the index number of the selection in the list. So in the above example, the evaluated value of bindings.EmployeesView1DepartmentId.inputValue will probably evaluate to 8 rather than 80, depending on the contents of the DEPARTMENTS table.
This article examines how you can access the true value of the selected list item or radio button directly from ADF.
Creating a Secondary Binding
The simplest way to gain direct access to the true value of an attribute that is populated from a list binding is to create a secondary value binding to the underlying data. This secondary binding can then be used within expressions to access the true value of the attribute. Reverting to the example of the DepartmentId field, here are the steps. This assumes that you have suitable collections of data defined, in this case we're using ADF Business Components with default view objects for EMPLOYEES and DEPARTMENTS. We also assume here that you have already bound the DepartmentId attribute of the Employees collection as a list (for example an af:selectOneChoice if using JSF)
Open the page that contains the list item if it is not already open, and select Go to Page Definition from the right-click menu.
In the Structure window, select the bindings node, and from the right-click menu choose Insert inside bindings attributeBindings.
The attribute Binding Editor will appear. From the drop down list labeled Select an Iterator, select the iterator that the form fields are based on i.e. the Employees in this case. Then select the DepartmentId attribute on the right hand side. The dialog should look like the following illustration:
OK the dialog and a new binding (in this case called simply DepartmentId) is created. The primary (list) binding for the DepartmentId attribute will be called something like EmployeesView1DepartmentId.. You might want to clarify the purpose of the secondary binding by selecting it in the Structure window and using the Property Inspector to change the Id property to something that describes its function, such as "DepartmentIdCurrentValue".
Now the secondary binding is created you can go ahead and use it in expressions, for example "#{bindings.DepartmentIdCurrentValue.inputValue =='80'}" and it will evaluate as expected. You can also use the binding in code for example:

AttributeBinding deptIdBinding = (AttributeBinding)getBindings().getControlBinding("DepartmentIdCurrentValue"); Number deptId = (Number)deptIdBinding.getInputValue();

The ability to specify multiple bindings against the same attribute provides the developer with a great deal of flexibility. This example of working with list bindings shows one common use of the technique, but it can also be used in alternative contexts such as combinations of table and attribute bindings for "Summary Table + Detail View" type UIs.

Oracle - Delightfully creepy

(I) It's not the software itself that's expensive and painful, it's the psychotherapy you need afterwards...

(II) The Difference Between God and Larry Ellison: God Doesn't Think He's Larry Ellison

Tuesday, August 21, 2007

Intrinsic decency -- a rare commodity

It is strange when bad things sometimes make you happy!!!!!
How would you feel if your BMW 525i is hit! Bad, right! i mean Real Bad!
Well my car was hit yesterday on the left wing while is was parked near Al-Dastour Newspaper main building. Normally, i park my car at Abu-Elhajj commerical complex at floor -1 where i have a parking lot reserved for me,, but sometimes when i am coming from the University direction and traffic is heavy, I just part across the street.

When i arrived at the Car location, there was a note written on the wind-chill of the car, saying

"I am sorry to have hit your car while on reverse, Not to worry, my insurance shall cover for the expenses" She left her phone mobile no and name (Rula)

I was happy to realize that people with integrity still exist. She could have walked away carelessly! couldn't she? Regarless of "Samet El-baden" I went home with an inner feeling of joy. Henceforth, i called the lady and asked her to relax as i am not going to press chargeses, nor pursue her insurance credit.

Duncan Says

Few will enjoy this post or even make sense of it. It is about writing J2EE application using Oracle ADF/JSF framework. The frame work is good and productive, but has it own problems as well. Ducans Mills is one of the people whose finger prints are all over the ADF framwork and he writes below about what is know as Drop Down list.. and a reply at the end

Duncan says
"List bindings are a very powerful feature of ADF. They make it really easy to automatically manage the population of select-type components such as dropdown lists, radio groups and so forth from a collection of data you have in your model. ADF manages the mapping between your collection type and the format of the mini-model used by the controls themselves. There is, however, one problem with list bindings. They are intensely private. What I mean by this is that if you try and get the value of the list binding directly say using an expression (in the JSF case) of #{bindings.deptList.inputValue}, it will return you an index number which reflects the position of the selected item on the list - not the value of that selection as you might expect. This can catch you unawares, particularly if your values are already numerical - you could easily miss this and end up with weird bugs."

and i say
"The issue here is that when binding is explained using ADF framework, they are explained in a generic way. #{bindings.EmpView1Deptno.inputValue} means the value of an input item, and this works well for DNAME if you try it. How in the world am i expected to know that in the case of a list item, it returns an index. A human mind can only be useful if it can learn little things and then infer big things the follow similar behaviour. For example, Newton learned and explained a lot about gravity by watch an apple drop. All object drop in the direction of the gravitational force, if some object go up aginst gravitational force without any external force, then Newton would have been confused. The beauty is when things are exact and consistent as is the case with our universe. Well, the Universe is the creation of God, and ADF is the Creation on Man. Therefore, we strongly ask Oracle to write GOOD manuales that explain and pinpoint in great extend the behaviour of their frameworks with lots of example and therefore, make the learning curve less steep, because as things are designed in ADF, one cannot necessarily extends his understanding of EL binding and arrive to the fact that accessing the inputValue of a list item would return and index value.i hope i was able to give an insight about the difficulty that we can be facing. After saying all of that, i am still a firm believer of the future of ADF "


Introducing the 1.0 Version - Smart Comedy

This is entirely extracted from
" The crancky product manager"
The ugly side of software product development

Introducing the 1.0 Version
You may wonder where the Cranky Product Manager has been for the last few months.
Well, she and Delightful Husband had been working on their own product release of sorts.
The Cranky Product Manager is proud to announce the release of CrankyKid Version 1.0, released to manufacturing sometime in the last month or two (or three) at a very healthy birthweight. All in the Cranky Family are doing well and are in excellent health.
The new product release has been extremely well received by the extended families, even after playing with the product for a few weeks. Considering this is a 1.0 release, CrankyKid seems quite stable and free of major defects (though time will tell). This is particularly impressive considering CrankyKid was not developed with an iterative/agile development processes. Not taking the baby out of the womb to see if its done yet and then stuffing it back in. Nay. Instead, a more waterfall-esque methodology was used. Of course, as one would expect with waterfall development, the last month of the release cycle was arduous. And the last day -- that final "push" to get the product to market -- well, it was painful and hectic and painful and painful and a hell of a lot of work, to say the least.
CrankyKid truly lives up to his/her name. And thus, two major enhancement requests have already been logged:
# E000001) Identify and remedy the cause of CrankyKid's inconsolable crying (colic? acid reflux?)
# E000002) Let mother sleep more than 2 hours at a time
If only a service pack would clear up these issues...
And just you remember, the Cranky Product Manager is a fictional character with a fictional husband and a fictional child. Everything in this post might be fabricated and be utter bullshit* nonsense.
* Now that she's a parent, the Cranky Product Manager is trying to clean up her language. Hahahaha, as if.

Monday, August 20, 2007

Nice pictures

Bodrum the city

with Laith

Side view from our room balcony

Half Olympic swimming pool

From inside DolmaBahce

Ininity pool

Some Castle in Istanbul

Scenes from the room

Swiming with the kids

The beach

Saturday, August 18, 2007

First day after vacation

Simply Ugly!
There has to be something called post vacation depression in medical literature! Otherwise i have found a new syndrome

ammar sajdi

Friday, August 17, 2007

On this Day

People get born and people die every day. But on this day (Aug the 17th) more than 30,000 people died when a 7.5 earthquake hit Izmit Turkey. On this day also, God gave life to a bunch of other people, probably to balance out the devestation of this day and more than offset the melancholy with a smile on faces :) (i m sure you also agree that i am too humble)

The list includes

-Robert De Niro


Hurrican Camille made landfall in the US in 1969 with a pressure of 909 mbar (hPa), estimated sustained winds of 305 km/h, and a peak storm surge of 7.3 m ; by maximum sustained wind speeds, Camille was the strongest landfalling tropical cyclone recorded worldwide, and one of only four tropical cyclones worldwide ever to achieve wind speeds of 190 mph. The hurricane flattened nearly everything along the coast of the U.S. state of Mississippi. In total, Camille killed 259 people and caused $1.42 billion (1969 USD, $9.14 billion 2005 USD) in damages.


In a political-sex scandal Clinton admitted in taped grand jury testimony on August 17, 1998, that he had had an "improper physical relationship" with Lewinsky. That evening he gave a nationally televised statement admitting his relationship with Lewinsky which was "not appropriate".

Technologically - MD5 is no good

In cryptography, MD5 (Message-Digest algorithm 5) is a widely used Hash Functionwith a 128- bit hash value.MD5 has been employed in a wide variety of security applications,. An MD5 hash is typically expressed as a 32-character Hex number.

MD5CRK was a project started with the aim of demonstrating that MD5 is practically insecure by finding a collision using a birthday attack. MD5CRK ended shortly after 17 August 2004, when collision for the full MD5 were announced by Xiaoyun Wang, Dengguo Feng, Xuejia Lai, and Hongbo Yu Their analytical attack was reported to take only one hour on an IBM 690p cluster.
Note: a collision occurs when two distinct strings produce the same hash output.


Thursday, August 16, 2007

Again from Turkey

Turkbuku, a pretty, traditional fishing village set on a peninsula hillside, Turkbuku is a fashionable destination for Turkish celebrities, and fashionable society.
The pricesses Hotel is around 5 minutes away from the center of Turkbuku, a nice resort with plenty of swimming pools and dazzling sceneries overlooking the Aegean sea. Even though the princess hotel is a five star hotel, but when it comes to rooms, amenities, service it stands no chance when compared to Ritz. Anyway, the food is very good, the landscape is excellent. The airconditioning systm poor.
We went to near by villege and had a good dinner in a restaurent called Sait. The waiter spoke Arabic as he was born in the Iskenderon provice (disputed land between turkey and Syria).
We had good seafood.

Tonight we are leaving back to Amman on Turkish airline, we shall be arriving in Amman at 2:00 AM, really ugly timing.


Tuesday, August 14, 2007

Lavishly exquisite ... in Istanbul

a Lavishly exquisite Hotel in Istanbul. Yes, it is the Ritz Carlton. Over looking the Bosphorus and right opposite to the phenomenal Dolmabahce palace at the European side of Istanbul. No wonder why the Ritz Carlton group was rated a Strong First "Most Prestigious Luxury Hotel Brand" among 15 rated luxury brand beating the Four Seasons (which came second). This however, comes with a staggering price tag. eg, the lentil soup costs 13 JD (19 USD), Turkish Coffee 11 JD and snickers chocolate costs you something like 12 JD (The bar only not the entire pack). The service is amazingly superb and the staff are astonishingly friend (compared to Turks), but you feel that they were taught lessons. Once you have an eye contact with any of them , you feel that, some where in the system, a push button action is invoked and SMILE event executed. I tried to observe this performance over a period of time; it is so robotically crafted and this seemingly unconditional loop keeps iterating over and over without reporting a single bug in its logic. I guess the EXIT statement takes place when they leave the hotel to get a chance to immensely indulge themselves frenzy Istanbulian lifestyle caused by a spaghetti styled coded system.

The first language in Turky is obviously Turkish
The Second Language in Turky is strangely Turkish
The Third Language in Turkey is (unbelievably) Turksih
The fourth Lauguage in Tureky is sadly Turkish
The fifth language is normally a mix (some German, some Arabic and some English ..)

I wanted to ask what people learn as a second language at schools, but could not pose this question in any of the most popular 4 languages in Turkey!

What was most interesting for me was the fact that I went to Friday prayers at the DolmaBahce mosque (By the way i don’t know the root of the name, i know Dolma is stuffed vegetables Ya3ni Ma7ashi in Arabic). Same rituals as in any other friday prayer, but most intriguing was the fact that Salah is preceded by Quran read quite nicely in 90% near perfect pronunciation. Then the speech started with "Alsalat 3la Alnabi" Also in Arabic and many Du3a in Arabic by a Turksih Imam. Then the speach is Turkish {very short , just a few minutes, but i understood exactly what he was saying since, he was introducing some Quranic verses every now and then} The speech was about Isra and Miraj. Then the Salah took place in less than 2 minutes, (Al-fatiha and a small verses afterwards, i mean really really small) Looks like this Friday Prayer is well suited for tourist. A good offer (Iqama, speech and salat in less than 7 minutes,, we beat any other offer!!)

To treat yourself well foodwise, Balikçi Sabahattin is a fish restuarant that serves really good food. This is a place i would come back to. That was not only my opinion , but the entire group unanamously agreed (Price is about 50 USD / person -no Alcohol)

The most religious belief that the Turks observe seem to be Halal meat (kosher). It is kind of fun to notice how Infuriate they could become when you ask them if the meat is Halah (The answer is predictably Al-Hamdulila), immediatly then, they ask you if you care for a beer!

Anyway, the question that is still unanswered:

Are they proud of being Muslims???

So far, i could not mingle with the right people to get answers

Finally, it could possible be appropriate for me to mention at this stsage that my grandfather is half turkish!

We left Istabul two days back, we are now in an area called Turkbuku in Bodrum province. Our hotel is very big, it more like Spa. Some Russian Tourists but surprisingly, mostly Turks are staying in the hotel. Very little from the eastern med. We ran across two jordanian families that we know from Amman! and could over hear and Eyptian family and that is about it. More about Pricess hotel and Turkbuku later


Tuesday, August 07, 2007


maybe it is LIS (Lack of Interest Syndrome) or my every-once-in-a-while mood swing cycle. Not been in the mood.
As a remedial, i am taking a break, Yeh, i am traveling ! What is unique this time is the fact that I shall be traveling on vacation with family and relatives. The initial plan was to Spain (i declined then since it was going to be hectic), but joined in, when the destination was changed to a near by country. Two days at Istanbul, then some place called Bodrum. I have been to Istanbul some 10 years back and I thought it was a great City, I am keen to see it again, and feel any change. Also would like to sense Turks perception (especially those who are living in major cities) about the ruling party. Bodrun??? Really have no idea! hope it is better than Antalya. Only time will tell

Say Hi to Julia

By Ammar Sajdi Well, Do not get tooexcited, Julia is a programming language. It saw the light on  Valentine’s  day, 2012. While it can be...