Tariq Ahsan

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

Recent posts by Tariq Ahsan

I am running into an error condition on the Alfresco based application's UI web page with the error message -
javax.faces.el.EvaluationException: Exception while invoking expression #{mycode.changeDisplayResults}
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:156)


....

Caused by: java.lang.NullPointerException
at org.alfresco.web.bean.mycode.changeDisplayResultsEra(mycode.java:779)


This would happen if I make the changes in the SavedSearchResultDataMgr class which does the jdbc database query. The changes are –



By the way, I added a new column in the CODE_LIST_TABLE table – NEWCOL differentiate between code lists to be displayed on the dropdown based on certain business logic.

In my investigation I found that, in the method –



If I change back the query string back to it's original state without " and newcol= 'ABC'" +
the drop-down for Reason field on the screen will display all the required rows including the new values I added to the table.

ValueChangeEvent object - event is not null altogether as ValueChangeEvent.getOldValue() returning value.
Here's the part of the jsp page -



Any idea about this problem?

Thanks
13 years ago
JSF
Thanks for response. I know I have to do it using a JavaScript. I am toying around using event.keyCode. For decimal value it is coming out to be the values - 190 and 110. I am trying out something like the follow to see if the entered key value is a decimal -



just to test if a decimal key has been entered. I guess now I have to find a way to count the number of keys pressed. Once it hits the count to 2 I have to find way to disallow the user to enter any more digits.

Would you know that can be done? Or there are much simpler way to achieve this?

Thanks once again.
Hello,

I am new to JavaScript. Wondering if there is a way an user can be prevented to enter more than two digits after the decimal point on a field? User would be able enter a whole number or a decimal value which would eventually get mapped to a database table column of NUMBER(9,2) datatype?

Any idea this can be best done?

Thanks

Tariq
Hello,

I was wondering if it is possible to get the whole row data with selective columns dumped into a String variable preserving spaces if it exists. I have been able to some way get individual column data of a table and padded with spaces based on the column length and then construct a single line string text. But if there is already way to do it easily in Hibernate it would surely make it lot easier. Also, would it be possible to create a generic utility where all this string text construction can be handled easily by just passing the persistence entity object? Basically I am trying to create a fixed length file with the data from the entity object.

Thanks
One other thing. Is it possible to get a source where I can get a sample codes specifically using JPA, EntityManager?

Thanks
Thanks a lot Mark!!! I'll check out those links.
Hello Everyone!

I was wondering if anyone could point me to some simple codes along with configuration setups that uses specifically ORM data access of JPA, EntityManagerFactory, EntityManager etc. to do a database transaction in the Spring Framework. I already have some existing entity POJOs which is been used using JPA to do database transactions under the JBoss Seam Framework. I want to use those entities in the Spring Framework code. By the way do I need to have all these on an application server like to do a simple run? Or I can just execute the code with a client app?

Thanks
All,

I seeing little problem when I am reading the properties stored as an Enumeration object. While reading each <entry> is not getting retrieved according to the order it is in property xml file.

Is there anyway, I can retrieve these field value in the same order the elements are in the property file?

Thanks
Had to make some changes to the return type of the readFixedLengthFile method from Map to List object.
Here's the code change -


Had to change the client program too.


This is what I came up with to read a file with fixed positions records and parse it contents by using a XML property file. This meta data XML file contains the lower and upper boundary of each field's character positions.

The readFixedLengthFile method of the FixedLengthFileReader class takes the arguments of the input data file and the xml property file. Each line of the input file is read and by using the xml file's field description it is parsed and stored in a HashMap object. This HashMap object is then returned back to the caller.



Here's client application -



The input data file - Test.txt :



XML property file - Test.xml :



The console output from the client run -



Like to also mention that the fixed length file reader and writer would create a POJO and write to a fixed length file from a POJO.
Sorry. My mistake. What I actually want to use is some form of an xml file where it would have fields and it's character positions. This file would be used to parse a fixed length file by file reader and writer code.

Thanks
I was wondering if I could use a xsd file in the context of an xml file parsing after a fixed length file is transformed into a corresponding xml file/object. Mentioning Hibernate does not have anything to do with the file parsing. I guess shouldn't have mention about that to create any confusion. Just a thought, in any way javax.transform.xml or JAXB would be any use for what I want to achieve? Or there are much simpler way in doing this.

Thanks
Hi All,

Was wondering what would be a good way to come up with a generic solution where I can some how use a xsd file to read a fixed length data file? I would be using the file data to do a database transaction using Hibernate. So, basically I would be using the xsd file to parse the file as well as do initial data validation.

Thanks