Just a guess:
You're executing 'getValue' _after_ page-level 'display' processing has
begun. It is variable, but, by default, page fields are cleared before
page-level 'display' processing begins.
You might want to try executing 'getValue' as part of the event method that
executes when your 'recalculate' button is clicked, and put the results
into an instance variable for later use during 'display' processing.
-- Curt Springer, Team ND
At 12:53 PM 8/12/99 -0700, Bhaskara Reddy wrote:
>Hi,
>
>I have a repeated called "rptCartItems" and a text box under that called
>"tbQuantity".
> The user enters the quantity in those text boxes and clicks on an
> href called "recalculate"
> which should display the same page with updated cart information.
>In this_onBeforeDisplayEvent(...) I check if user has clicked on
>"recalculate" and use the following generic if then logic:
> CSpValue tbValue = getDisplayFieldValue("*tbQuantity");
> if (tbValue instanceof CSpVector)
> {
> // It is a vector
> }
> else
> {
> // It is NOT a vector
> }
>It always goes into "It is NOT a vector" (else part).
>
>Why is this happening? Can anyone please help me?
>
>Thanks in advance,
>Bhaskara Reddy.
>----------------------------------------
>
>The following code is in this_OnBeforeDisplayEvent(...) of the page where
>I check if a page
>session object is set (when "update cart" button is clicked this page
>session object is
>set and the same page is reloaded).
>
>--------------------------------------------
>Code:
> CSpTextBox tbQuantity = (CSpTextBox)getDisplayField ("*tbQuantity");
> CSpValue tbValue =
>tbQuantity.getValue ();
> if (tbValue instanceof CSpVector) {
> // There are multiple row values in this display field
> umCartContents cart =
> (umCartContents)CSpider.getUserSessionObject("US_SHOPPING_CART");
> CSpVector tbValueVector = (CSpVector) tbValue;
> for (int i = 0; i < tbValueVector.size (); i++) {
> CSpInteger currRowValue =
> (CSpInteger)tbValueVector.get (i);
> umCartItem item = cart.getCartItem(i);
> item.setQuantity(currRowValue.intValue());
> }
CSpider.removeUserSessionObject("US_SHOPPING_CART");
> CSpider.putUserSessionObject("US_SHOPPING_CART", cart);
> } else {
> CSpInteger val = null; if (tbValue != null)
> val = new CSpInteger(tbValue.intValue());
>--------------------------------
>
>Thanks,
>-BhaskaraReddy
>_________________________________________________________________________
>
>For help in using, subscribing, and unsubscribing to the discussion
>forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
>For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]