Ayan Dutta

Ranch Hand
+ Follow
since Oct 16, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ayan Dutta

Hi ,
First of all I hope I am posting my query to the correct forum .

I am trying to implement drag and drop functionality (drag is no issue here ,main emphasis is on drop ) with dojox.gfx .
I have just two shapes ...one rectangle(say target ) and one circle .
The requirement is to detect the event when the circle is dragged and finally dropped on the rectangle (if dropped elsewhere just do not need to do anything)
I have explored the 'onMoveStop' event of dojox.gfx and made a bit of progress with it
but still not being able to implement the functionality .

I am attached the code below I have written so far .
Please help if somebody has any knowledge/idea regarding this .


Hi ,
I have written a custom MergeEventListener by sub-classing the DefaultMergeEventListener and overriding its onMerge(MergeEvent event) method .
My goal is to compare the pre-update db snapshot of an entity with the currently changed entity(the entity that is currently registered with the session ) .My goal is that , if there is a difference some processing will be done .
I am elaborating this part a little bit ,
say I have a record Course ( course_id:1, name:"First Course" ) . This is already saved in DB .Now I have loaded the course object using hibernate session and made a change and invoked merge on it .
Lets assume now its state is ( course_id:1, name:"First Course Changed " ) . This is where I want to track the change .For this what I am doing is mentioned below :

As you can see above , persister.getDatabaseSnapshot is for getting the preupdated state and persister.getPropertyValues is providing changed entity state (both of them are proving object arrays ) and then finally I am invoking persister.findDirty method , which is returning me indices of all dirty properties.
This is working fine for me . But when my mapping is changed a little bit with another many to one attribute , I am facing an issue .
For example I have one parent entity named Node and the structure becomes like the following
Node [node_id,name] --->Course[course_id,name]

[Node is basically an entity with table per subclass mapping ]
Then naturally course has a many to one mapping to the parent node .

While a many to one mapping is added , my code throws the exception
--------Exception start ---------
org.hibernate.HibernateException: Unable to resolve entity name from Class [java.lang.Long] expected instance/subclass of [com.ibm.lk.domain.portfolio.NodeBO]

--------Exception end---------
I have checked the exception with Hibernate 3.5.3 source code , it is showing that the exceptions starts from :

The reason as far as I understand , the oldstate[] passed to findDirty method by using the method

has an entry of a Long object with value 2 [That is the node_id value of Parent object ] whereas the newState array has an object entry of NodeBO object .

This difference of just the Long object (i.e. the object type of the primary key of the parent entity ) and the Node object is leading to the exception .
If I do not have the many to one mapping everything is OK.But otherwise I face this problem.
Any suggestions , so that I can use the findDirty method preperly with many to one cases with table per subclass mapping also ?
Hi Marcelo ,
I have one query regarding your post .
I am using WAS 6.1 with RAD .
You mentioned in point 3
"After deploying the application, change the value of the EAR ClassLoader to PARENT_LAST (Classes loaded with application class loader first option) "
I have followed this point by the following steps :
Navigating to Admin Cosole --> Applications -->Enterprise Applications -->Select Applicable EAR -->Manage Modules --> Select Applicable WAR --> Change Class loader order to "Classes loaded with application class loader first" .

Now , in point 4 you mentioned ..
"Verify that this configuration is replicated to the WEB module classloader configuration, if not, change there also to "Classes loaded with application class loader first" .
Can you explain this point a little bit more about the specific steps to verify the configuration replication ?
Ayan Dutta
14 years ago
I am new to JSF . I want to integrate Struts 1.x with Richfaces .
First of all, please tell me if it is possible at all or not ?
From struts site I have seen the guidelines to integrate Struts 1.x with Myfaces .
But I have not found any tutorial/Ebook on how to integrate with Richfaces .

Can anybody please help me in this regard ?

Ayan Dutta
14 years ago
Hi ,
I have faced similar problem recently . After the table loaded correctly with proper coloring of alternate rows etc etc ,
after clicking the link of sorting or prev/next link of pagination the coloring of all rows and pagination were lost .
After banging my head for some time , I had a look at some of the running examples using from internet , which uses struts and display tag together.
What I found out that if the requestURI is mentioned properly , this problem is gone .
In my case it was missing .

I have not drilled down the code of display tag , so I am not sure exactly why it happens like this .
So , if you have something like :
correctly , the rendering will be OK and you can get some relief as I got .

Let me know if it works for you guys .

Ayan Dutta
14 years ago
Hi ,
The forum is not allowing me upload the war file may be the size is big .
Please have look at the link

Hi ,
I am using an Ajax enabled version of display tag.
I have attached war file for your reference .
It is running wonderfully when I create a single grid , but when I have more one grid inside a jsp , I am facing the problem.

Here the main thing is the usage of a js file named displayTagAjax.js , which uses JQuery in turn .
Here this file displayTagAjax.js has a two methods changeLinks() and changeUsingSelector() which are kind of hard coded .I am pointing where the hard coding is :

1.In side changeLinks() method the line ..

as it takes the table id 'dispTable' as hard coded.
2.In side the method changeUsingSelector() the line ..

Here the div id 'ajxDspId' is hard coded .

Now the actual code snippet which uses the js file is like the following (you can also check the index.jsp inside the war file )

Now the main problem is as the dispTable and ajxDspId both are hard coded in side the js files ,I can not create more than one grid in a single .
Irrespective of how many grids I create in jsp , the two methods in side the displayTagAjax.js file will always work on the specific table id (i.e. htmlId="dispTable" ) and div id .
As I do not have any way to pass this two values from the jsp to the js methods , I am being able make this functions work properly for multiple grids .
Can some body help me to make this two methods generic ?

Hi ,
I am a beginner in EJB .I want to know the basic steps to write a stateless session bean with Eclipse 3.4 .I have JBoss 4.2 as my app server . Can anybody give me a link regarding this ?
I have searched a lot using google regarding this ,but could not find a detailed help.
Thanks Eric .
What a coincidence !! I also thought the same way as you mentioned in the point 1.
And the funny side is ,I just thought about the same problem of
dimensions .That is why I did not go for that option.

Anyways ,I will give it a try.

Lets see what can I do with this problem.
Thanks for your thoughtful input .
The approach that you are talking about I have already
done in the past many times and needless to say it is a patch work .I am just giving you an example .
Say you have many controls (say 10 ) in a page and 5(say a,b,c,d,e) of them are enabled and 5 (say p,q,r,s,t)are disabled.
Now if I apply the idea of disabling elements/controls when validation fails ,then if I have to disable all of them (5 already disabled ,another 5 I need do disable).When user provides correct input I have to enable the fields which I have disabled.Now this is not enabling all !! Now I have to enable only 5 which I disabled(i.e. a to e) and not the set which were disabled(i.e. p to t) earlier.
Unnecessarily I need to keep a track of previously enabled/disabled elements .
Do you get my point ?

Stopping tab key based navigation is not a big deal and disabling
all elements is also easier,but that is not a generic solution at all.
I am not "throwing up a layer" for endless time also , when validation succeeds ,that particular div will be removed .
The code that I have written in the previous post is just a rough code ,
the div itself will be a dynamic one ,created in the page when required.

If you have any idea to hide all controls except one using div ,that
will be helpful ,disabling all element is solution is always there
with its own limitations.
Ayan Dutta
Hi ,
Thanks for your prompt reply .But sorry to say ,the answer is no.
In the actual scenario the page contains a tree on the top left,a tabbed panel containing 20 plus tabs and the page it self contains many buttons .
If you go through my previous post you can see the requirement is such that user should not able to navigate anywhere until he corrects the wrong input he provided.

If I try to disable other elements like.
1.other page controls.
2.tabbed panels.
3.tree on the left

It would be a patch only and not a generic solution.Applying javascript method to disable all other contents is a 2 minute solution and that is last and worst thing I will do if I have no other choice .

But think if your validation methods are enhanced with such capabilities
(like preventing the navigation if required ) ,no page specific code will be required .
Ayan Dutta
Hi ,
First I am explaining my requirement a little bit .
Suppose in page there are many controls like link,text boxes ,save-edit-delete buttons etc etc .
Now the requirement is that ,If any user enters wrong data in any one of the input fields and validation fails,then the user should not be able to click any where in that page, except that field where he has entered the wrong value.
He should be correct the wrong input first and then only other parts of the page should become click able/accessible for him.

What my plan is that when the user enters a wrong value and subsequently when the validation fires and fails ,
1.then entire page should be covered with a div so that the user can not click anywhere else .

2.When the user enters correct data ,the covering div should be removed after successful validation.

That first part is done ,but the input field that has wrong value should be accessible to the user ,so that
the user can modify the incorrect data.
Here the entire page gets covered with the DIV so the user can not access the field ,where he needs to modify the data .

I have finalized my approach ,so my requirement is to hide entire page with a div , but one control/input should be accessible to the user(i.e. the control for which the validation has been fired).
Can the control/input be made accessible using higher Z index than the DIV ? I have tried once without much success.
I have just added some rough sample code for your help.
One thing I have written xyz instead of using click event pqr for blur related event for message post related problem.

I think this scenario will be interesting for you guys also.
With regards,
Ayan Dutta
Hi , I had a code that was detecting whether the user has attempted to close the browser or not .
If yes ,then there should be a message ,other wise not .
The code that was working fine ,is like

This works fine but with two exceptions that I have noticed so far.

1.If the user right-clicks on the title bar , an option to close the browser appears.Now if he clicks on that close option browser gets closed without any message .
2.If the browser is minimized and the user right-clicks on the minimized browser , an option to close the browser appears.
Now also if close option clicked browser gets closed without any message .

Both of the cases do occur as the condition mentioned in my code i.e.
"event.clientY < 0 " is violated .

What can be a generic code to handle these two situations ?
One thing I have noticed that in case 1 and case 2
the event.srcElement is null .
Would adding that check will be a full proof check ?

Any suggestions ?
Any idea from anybody ?
15 years ago