zaxxon25

Ranch Hand
+ Follow
since Feb 26, 2005
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 zaxxon25

I am fetching a set of data from database and displaying in jsp. The data is of the format :

checkbox1 category1
subcategory key1 subcategory value 1
subcategory key2 subcategory value 2
subcategory key3 subcategory value 3
checkbox2 category2
subcategory key4 subcategory value 4
subcategory key5 subcategory value 5
subcategory key6 subcategory value 6

I am able to display the above data in jsp using combination of list of objects having hashmap.

The problem is occuring when user updates the above data in jsp and form is submitted.

I am at loss as to how i can get all data and also link it...

So say user updates values in jsp represented by category 2 ,subcategory key2 and subcategory value 3. How do i send this data to my action class in linkable format.

I am using struts 1.2.

Data in my jsp after logic iterate is in <html:text> format ....

Please suggest ways of doing this....

11 years ago
am facing issue on how to store and then retrieve data . In my program which is simple java class i am retrieving data at 3 places from an xml. i need to store this temporarly in particular fashion as data is related and needed to be used later on at end program to generate report.

first data i am retireving is employee names eg Tom , Reggie, Martha.
Second data is department (Each employee belongs to 1 or many department ) so in this case

Tom : Billing
Reggie : Admin , HR
Martha : IT

Third data is Department number (This has 1 : 1 relationship with Department )
Billing :01
Admin :02
HR:03
IT:04

So when i am parsing xml first i am getting employee data, then department and lastly department number. I need to store it in collection in such way later on i can retireve and link data and use it.....

Which java collections i should use....
16 years ago
I am having issue with passing variable value from one class to another.
I have class A and Class B bot in same package.

package D
Class A {

private int j = 0; //I have getters and setters for this variable

public void doSomething(){
j++;
this.setJ(++j);
}

}

Class B{
A a = new A();
int i = a.getJ();

System.out.println("value of j is "+i);

}

My problem is class A gets called first and j's value get incremented twice...it becomes 2. But when i am calling the getter value in i received is 0 (initial value of J).
Someone recomened since A does not know about method getJ in B i use request object to set value of j in B which i did but result is still same i am getting value as 0. I tried using request dispatchr but than also am not getting right value of J in A.

I know this is basic issue in java if anyone canhelp me i will be really grateful.
17 years ago
In the example given by you suppose we are having multiple attributes. Basically i have to iterate through my query in model class and each iteration i want to store in bean object and ultimately return as array of beans from method.
17 years ago
Can anyone send me sample code which can guide me ho to create array of bean objects
17 years ago
Thanks Kris for being on the forum and sharing the ajax knowledge. Wow !!what a christmas gift for me . Congrats to other winners too...
Ajax is being used nowdays heavily for gui designs in some third party open source libraries like scriptaculous , moo.js, dojo . However when code is used on different browsers it shows different effect. Is it because of html limitation or ajax+javascript limitation.
Is there any way of creating spin control component which is having up and down arrows and only one value visible at a time in javascript. I looked around and found way in swing/JSF but nothing in javascript. Any help or guidance will be appreciaited.
Hi Frank,
I have worked on Ajax components in my current project. But all of them were ready made. However at times one needs to modify exisiting readymade ajax component for some required behaviour. Does your book has an example of that?
[ October 04, 2006: Message edited by: Bear Bibeault ]
Thanks for the info. I am looking forward to reading your book.
17 years ago
JSF
How is your book different from other books in market like Core java server faces,Java server faces in action...Also does it contain some examples showing JSF devlopment with Ajax.
17 years ago
JSF
will using valuechangeListener work ....something like this ....

JSF
<h:inputText valueChangeListener="#{myBean.inputListener}" />



MyBean
public void inputListener(ValueChangeEvent event) {
Object oldValue = event.getOldValue();
Object newValue = event.getNewValue();
// do your thing
}
17 years ago
JSF
I am having a screen in which all values being dislayed are stored in java backing bean.
i have to code particular functionality under which whenever a person cliks OK button at end of screen a call needs to be made to server to compare current values on screen with stored value in backing beans. If values are different an alert is sent to user informing him that values have changed. If he opts yes then new values are retained and old values lost.
The new values will also be stored in same bean. Can any one using some sample code explain me how this can be done .....

In summary how can i use my form bean's same field to store different values on each form submission and also retain old values for comparision purpose....
17 years ago
JSF
I am having a screen in which all values being dislayed are stored in java bean.
i have to code particular functionality under which whenever a person cliks OK button at end of screen a call needs to be made to server to compare current values on screen with stored value in beans. If values are different an alert is sent to user informing him that values have changed. If he opts yes then new values are retained and old values lost.
The new values will also be stored in same bean. Can any one using some sample code explain me how this can be done .....

In summary how can i use my form bean's same field to store different values on each form submission and also retain old values for comparision purpose....
17 years ago
JSP
I have resolved the issue. I was using tomahawk component which was creating javascript issue. Thanks Divya for your help.