p mayur

Ranch Hand
+ Follow
since Jun 28, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 p mayur

many values. it will show the top 5 and if i remove one item from list then the next one will be adde at the bottom
7 years ago
I am trying to show the first 5 items of an arraylist. when the list is 5 or above it works fine. if its below 5 then i get indexoutofboundsexcpetion.
How to check that? Please help me.

                 
     
7 years ago
At last got solution. As Ulf Dittmer said, there is no need for any if checks, i decrement cart quantity up to 1 and disable the button after it reaches one.
9 years ago
I realize my mistake . No need to apologize. I am trying. I will not leave and yes i am learning debugging now and come back with issue for solution or with the solution if i do it on my own.
9 years ago
I don't know what other information i need to give. I have clearly explained the
issue. Leave my method sir. Just give me an idea how i can implement what i want.
9 years ago
I checked what you said and i don't see any drastic change at least to my knowledge.
As i said earlier when i click decrement, when the cart value is 2, it changes to 1 and
stock stops updating , since the value is 1 in cart as per my validation.
9 years ago
The issue is when the cart quantity is 2 and i try to decrement , the stock stops updating, as the cart value is one now. So my validation is wrong. Thats what i am asking how i should do it.

Okay i will do and check that.
9 years ago
No i didn't place any debug codes. I don't know to do that. I just now started learning.

9 years ago
At first i just wrote code for increment and decrement button code. Then i tried to connect it with stock. Increment operation working fine.
Then i tried to do it for decrement. I got the issue as i explained above.
increment/decrement code in controller


Cart.java



These are the related codes. Please let me know do i still need to provide more information.
Actually just check my previous thread, they helped me solve the issue and i did it on my own. I am not expecting an spoon feeding here.
9 years ago
No sir, still it stops increment at 3 in stock
9 years ago
Any Help Please ?
9 years ago
Is it correct now.
9 years ago
How to do that Sir? could you help me please.



Is this right?
9 years ago
if i give >=1 it keeps on incrementing, because there will be always a quantiy in cart.
9 years ago
This is a shopping cart example using spring and hibernate. I am trying to increment a quantity in stock, if a user decrements a quantity in cart.There should be
minimum one quantity in cart always. So i tried to check cart quantity like shown below. But what happens is, the stock count stops when cart quantity reaches
2. (ie) for example, if there are 5 quantities in cart, when i decrement it 1 by 1 , stock is updated until it reaches 3 and stops. It should update upto 4 and the
last one can be updated when user removes the product from cart. So how can i make it update upto 4?



This is my decrement part.
9 years ago