For the record, here's the solution to my problem from last week.

You can't  do this:

cboTasks.addSelectable("   Test this", new CSpString("xxx"));

else ND will literally write this in the drop-down:
        Test this

So the work around <<suggested by Aby>> is to put in a weird character, say
"###",

     cboTasks.addSelectable("###Test this", new CSpString("xxx"));

and later change the # character to &nbsp; in the ComboBox's _onBeforeHtmlOutput
event, like this:

//[[SPIDER_EVENT<CboBudgetTasks_onBeforeHtmlOutputEvent>
public int CboBudgetTasks_onBeforeHtmlOutputEvent(CSpHtmlOutputEvent event)
{
     CSpDisplayField df = (CSpDisplayField) event.getSource();
     df.setHtmlText(CSpUtil.replaceSubstringAll(df.getHtmlText(),"#","&nbsp;"));
     return (PROCEED);
}
//]]SPIDER_EVENT<CboBudgetTasks_onBeforeHtmlOutputEvent>


Here's more help that I got <<from poster Ron Schiller>> about how to manually
populate ComboBoxes using either a Data Object or manual list of values:

CSpSQLObject thedoGetPersonName;
thedoGetPersonName = (CSpSQLObject) CSpider.getDataObject("doGetPersonName");
thedoGetPersonName.clearAllValues();

thedoGetPersonName.setSqlTextOverride(CSpSQLObject.FULL_TEXT_OVERRIDE);
thedoGetPersonName.setSqlTextFull("SELECT name, ssn FROM
dbo.person" + " WHERE assigned_org="+'"'+"04811"+'"');

thedoGetPersonName.execute();

CSpComboBox cbEmployee = (CSpComboBox) getDisplayField("cbEmployee");
cbEmployee.removeAllChildren(true);

// Construct the selectable list

******** Decide how you're going to populate it here

for (int i=0 ; i < thedoGetPersonName.getNumOfRows() ; i++)
{
     ********* do some concatenating here

     cbEmployee.addSelectable((thedoGetPersonName.getValue(i,0)).toString(),
     thedoGetPersonName.getValue(i,1));
}


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 30, 1999 3:38 PM
To: [EMAIL PROTECTED]
Subject: [ND] Leading spaces in a ComboBox

I have a combo box and would like to flag active customers, and have blank space
for non-active customers.
_____________________
|<Select one>       |
|** John            |
|** Sue             |
|   Bob           |
|** Mickey          |
---------------------
How do you make the spaces display in the list items?

I know how to handle those spaces on StaticText where I use &nbsp and set
HtmlEscaping = false. But how about items in a Combo Box?

NOTE: Sometimes this Combo is populated from a DO. Other times it's manually
populated. If a DO is involved, I imagine I computed column might be part of
the solution.

Thanks,
Janet


_________________________________________________________________________

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