I got curious about what was going on and did some research. I am pretty
convinced that there is a bug (may be two) in ND.

My conclusions:

1. If you have selected Emp Name and Emp id as the value for the combo,
the value is constructed as "John, 1234". While
combo.getSelected().getValue() correctly gives "John, 1234",
combo.getValue() returns "John,1234" (takes out the space after ,)

2. combo.select(CSpValue) fails even after the above glitch is taken
care of. I guess the culprit is none but the implementation of
select(CSpValue).

I could get going with the following piece of code.
======================================================================
                Enumeration enum = combo.getChildren().elements();
                int count = 0;
                while (enum.hasMoreElements()) {
                        CSpSelectable sel = (CSpSelectable)
enum.nextElement();
                        if
(sel.getValue().toString().equals(myDesiredString))
                                break;
                        else  {
                        CSpHtml.sendMessage("Val :
|"+sel.getValue()+"|<BR>");
                        count++;
                        }                       
                }
                combo.select(count);
======================================================================

Well, I was driven by curiosity. Otherwise I would have used a computed
column in the DataObject where Oracle would have neatly concatenated the
fields and given one field to ND.


Aby

-----Original Message-----
From: Curt Springer [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 10, 1999 11:50 AM
To: Shamdasani Nimmi-ANS004
Cc: Shamdasani Nimmi-ANS004; 'NetDynamics'
Subject: Re: [ND] FW: [ND] Trying to use setValue for a Combobox with
the concatena tion of d atafields


Oh, OK, now I get it.

Don't know the answer, but here's a way to find out:

theBox.doAutoFill();
theBox.selectAll();
Vector v = theBox.getSelectedList();
for(Enumeration e=v.elements(); e.hasMoreElements();)
{
  CSpListItem currSelected=(CSpListItem) e.nextElement();
              String   currSelectedLabel=currSelected.getLabel ();
              CSpValue currSelectedValue=currSelected.getValue ();
CSpLog.send(this, CSpLog.ERROR, "label ="+currSelectedLabel + ", value="
+ 
currSelectedValue);
}//for(Enumeration e=v.elements(); e.hasMoreElements();)

-- Curt, Team ND


At 01:20 PM 9/10/99 -0500, Shamdasani Nimmi-ANS004 wrote:
>No Curt, I want to select only one entry except that entry value is
made up
>if 2 data fields.
>
>-----Original Message-----
>From: Curt Springer [mailto:[EMAIL PROTECTED]]
>Sent: Friday, September 10, 1999 11:57 AM
>To: Shamdasani Nimmi-ANS004
>Cc: 'NetDynamics'
>Subject: Re: [ND] FW: [ND] Trying to use setValue for a Combobox with
>the concatena tion of d atafields
>
>
>If you want to select 2 entries in your combo box, you need to execute
2
>select statements, each with one value as the argument, not a single
select
>with comma-separated values.
>
>WHOA -- just made play page in studio.
>
>It's the listbox that allows multiple values, NOT the combobox!  The
>listbox has a property called 'Multiple' which is 'True' or 'False' and
>defaults to 'False'.
>
>-- Curt, Team ND
>
>
>At 11:11 AM 9/10/99 -0500, Shamdasani Nimmi-ANS004 wrote:
> >Curt,
> >
> >I have tried select, it still doesn't work. I looked into the
combobox
> >properties but couldn't figure out what needs to be set. I am
attaching the
> >code below if it helps.
> >
> >BTW my combobox is only single item select.
> >
> >Thanks.
> >
> >-Nimmi
> >
> >-----------------------------------------------------------------
> >public int
>
>MCSC2_NETWORK_ELEMENTS_FK_SW_RECORD_ID_onBeforeDisplayEvent(CSpDisplayE
vent
> >event)
> >{
> >
> >         CSpComboBox theBox = (CSpComboBox) event.getSource();
> >
> >         theBox.removeAllChildren(true);
> >
> >         CSpSelect theDO = (CSpSelect)
> >CSpider.getDataObject("doSoftwareReleaseList");
> >
> >         theDO.clearDynamicCriteria();
> >
> >
>
>theDO.addDynamicCriterion("MCSC_SOFTWARE_RELEASES_FK_ELEMENT_TYPE",CSpC
rite
>r
> >iaSQLObject.EQUAL_TO_STR_OPERATOR,
> >getDisplayFieldValue("MCSC2_NETWORK_ELEMENTS_FK_ELEMENT_TYPE"));
> >
> >         theBox.doAutoFill();
> >
> >         CSpValue theSoftwareID =
> >getDisplayFieldValue("MCSC_NETWORK_ELEMENTS_FK_SW_RECORD_ID");
> >
> >         CSpValue theSoftwareVer =
> >getDisplayFieldValue("MCSC2_NETWORK_ELEMENTS_FK_SW_VERSION_NUM");
> >
> >         CSpString selectSoftware = new CSpString (theSoftwareID +
"," +
> >theSoftwareVer);
> >
> >         //next line is just for me to see what's in selectSoftware
> >
> >         CSpHtml.sendMessage("selectSoftware =" + selectSoftware);
> >
> >
> >         theBox.select(selectSoftware);
> >
> >         return (PROCEED);
> >}
> >-----Original Message-----
> >From: Curt Springer [mailto:[EMAIL PROTECTED]]
> >Sent: Friday, September 10, 1999 10:02 AM
> >To: Shamdasani Nimmi-ANS004
> >Cc: 'NetDynamics'
> >Subject: Re: [ND] FW: [ND] Trying to use setValue for a Combobox with
> >the concatena tion of d atafields
> >
> >
> >I think you need to use 'select' and/or 'selectAll'.
> >
> >Also, I think there is a flag or property you need to set in order to
have
> >multiple values selected.
> >
> >-- Curt Springer, Team ND
> >
> >At 09:18 AM 9/10/99 -0500, Shamdasani Nimmi-ANS004 wrote:
> > >I am resending this hoping to get answer from someone.
> > >
> > >-Nimmi
> > >
> > >-----Original Message-----
> > >Subject: [ND] Trying to use setValue for a Combobox with the
> > >concatenation of d atafields
> > >
> > >
> > >Hi All,
> > >
> > >My Combobox value is made up of 2 data fields. When I try to use
> > >ComboBox.setValue with the concatenation of the two datafields it
does
>not
> > >work. I have tried it different ways e.g.,:
> > >
> > >Just concatenating the two data fields.
> > >
> > >Putting a comma between the two fields to be concatenated.
> > >
> > >But nothing seems to work. Does anyone have an answer to this
problem?
> > >
> > >Thanks
> > >
> > >-Nimmi
> >
>_______________________________________________________________________
__
> > >
> > >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]
>
>_______________________________________________________________________
__
> >
> >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]
_________________________________________________________________________

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]

Reply via email to