PDA

View Full Version : Combo Box Help - Please


mingwingming
06-13-2005, 06:25 AM
I`m having a problem with the combobox (A user problem!!)

I have a drop down box - Now when looking at the Combo Box at first view I want it to Say in the Box [ Choose Vehicle..] then when you click the box it shows the 2 pages (choices) that the client would go to, now when I first run my Project it shows everything as I wish but should I jump between the pages the Initial (Choose Vehicle) prompt dissapears once I return to any of the pages that I have already visited, so How do I keep that text at the top of my ComboBox. (seems simple but not for me!!)

Below is how I have it setup at present.

If I click the Combo Box and then go to "Properties Window", in the "Items list" I have added the [ Choose Vehicle..] text that I would like shown at the top of the ComboBox, on the script side of things I have it setup as follows

ON SELECT
nIndex = ComboBox.GetSelected("wiring diagrams - info");
iText = ComboBox.GetItemText("wiring diagrams - info", nIndex);
Page.Jump(iText);

ON FOCUS
-- delete all items in the combobox
ComboBox.ResetContent("wiring diagrams - info");

-- populate combobox with suitable items
ComboBox.AddItem("wiring diagrams - info", "Wiring Diagrams - Auxiliary");
ComboBox.AddItem("wiring diagrams - info", "Wiring Diagrams - Hydrostatic - Unidrive");


I hope that makes some sense. Any assistance would be welcomed.

Thankyou

rhosk
06-13-2005, 09:38 AM
I think what you're looking for is -

"ComboBox.SetSelected(yourpluginname, "Choose Vehicle...");

Just put it on the page's 'On Show' event.

Darryl
06-13-2005, 09:41 AM
Hi mingwingming,

If your goal is to reinitialize the combo box each time the page is visited, try configuring the initial settings on the On Show event of the page (Page > Properties, On Show tab). Every time that page is shown, it will run those actions to configure the combo box as you wish.

I believe that will accomplish your goal.

Hope that helps.

Darryl

mingwingming
06-21-2005, 04:17 AM
Thanks guys for your replys unfortunately this noob is not getting far.

If I add

ComboBox.SetSelected("Wiring Diagrams - Info", "Choose Vehicle...");

to the "On Show" page (the same pages as the combo box), i`m still presented with the same scenario.

Where initially the Combo Box will show the "Choose Vehicle" text on view and if you click the combo box it then shows the 2 pages I would like the box to jump to, but as soon as I click the combo box the "Choose Vehicle" text dissapears or if I jump to one of those 2 pages and then return the "Choose Vehicle" text has gone.. Am I going MAD!! the other pages I am jumping to use basically the same combo box to jump back and forth.

(Hope your getting the idea)

Do you have any other ideas or example, or any more info I could provide you with to help you help me...

rhosk
06-21-2005, 06:14 AM
Very simple example attached. You should be able to expand from here. I sorta gave you wrong info in my initial response. When you 'SetSelected" you need to choose the index number of the box (sorry) and not a string set -I was thinking 'SetText'......

Anyway, see if this helps you out.

mingwingming
06-24-2005, 10:09 AM
Superb thanks for the example really apreciate it, not had a chance to check it out yet, will look more into it Monday, if I get any grief I`m sure i`ll be back !! Anyhow I do have faith, for now I just need to get home , sit in the back garden and have a couple of bottles of becks !!

Thanks Again

mingwingming
06-29-2005, 04:11 AM
Awesome, so simple when you see these examples..
Are their any other places that show obvious examples for noobs like me.. I been collecting a few that I have found via this site , but the more places I can grab eaxmples the better..

Thankyou Very Much..

Actually another test for you experts ;) how do I open a pdf from a combo box ? Up till now i been using listbox but in certain situations the combo box would be far neater. Sorry if i`m pushing my luck on examples !!