Couple of thoughts:
When you create a ComboBox with preset values, you enter two sets of things
- labels and values. For example, the Labels can be 'January','February' etc
while the values are 1,2,3. setValue() should always pass the value (1,2..).
Further, if the values are taken as numeric, it is possible that there are
issues with trying to setValue() with a CSpString.
I would like to mention that pageSessionObject is least meant for this kind
of situations. If putPageSessionObject() and the getPageSessionObject() are
within the same web event processinng - within a single http
request-response - the most efficient and appropriate way to pass the values
from some other method to cbCreType_onBeforeDisplayEvent() would be to use
simple instance variables. UserSessionObjects would be another inefficient
but less harmful option. Liberal use of pageSessionbjects results in large
SPIDERSESSION values, which can lead to truncated SPIDERSESSION and all
kinds of problems.
Aby
TeamND
> -----Original Message-----
> From: Greg Hart [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 24, 2000 3:25 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [ND] Setting Combo Box Value from Database-ASAP
>
>
>
> "Greg Hart" <[EMAIL PROTECTED]> wrote:
> >
> >I have a combo box that is prefilled with data, i.e.
> January,February, etc. I am
> reading values from a database based on a particular user.
> However, the combo box
> value does not get set when I try to set it using:
> >
> >putPageSessionObject("*cbCreType",resTab.getRowData(0,43));
> >
> >The value read from resTab.getRowData(0,43) is correct but
> the combo box still has
> the first value in the list, not the value from the
> database. All of the other values
> being set in text boxes work, it is only the combo boxes I
> have a problem with.
> >
> >Thanks.
> >
>
> Later in the page I have:
>
> //[[SPIDER_EVENT<cbCreType_onBeforeDisplayEvent>
> public int cbCreType_onBeforeDisplayEvent(CSpDisplayEvent event)
> {
>
> CSpComboBox cmb = (CSpComboBox) getDisplayField
> ("*cbCreType");
>
> CSpValue val = getPageSessionObject("*cbCreType");
> if ((val != null) && (!val.isNull()))
> {
> cmb.setValue(val);
> }
> return (PROCEED);
> }
> //]]SPIDER_EVENT<cbCreType_onBeforeDisplayEvent>
>
> So thanks for those who suggested .setValue, but I am already
> using it. Any other thoughts?
> ______________________________________________________________
> ___________
>
> 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]