PDA

View Full Version : [solved] Issue with selectboxes



xiaolung
16 Jul 2013, 11:08 PM
Hi,

I'm hoping for some insights here since I have been trying a lot of things without success. I have a dialog with two tabs. Both tabs contain one selection (and some other elements not relevant to this story). Both of these fields get their options on initialization. These options have the same name, but not the same value.

What I want to achieve is getting the second selectbox to show the same option as the first selectbox has after someone selects something there. I can get it to have the same value (I used .defaultValue) but it won't show this value as being selected. Also tried .select and .fireEvent but those did not work either.

Any ideas on how t achieve this?

The code:

UpdateHeaderTag = function (component) {
var dialog = component.findParentByType('dialog'),
headerTag = dialog.find('name', './size')[0].getValue();
headerTag = headerTag.toUpperCase().substring(1);


dialog.find('name', './header')[0].defaultValue = headerTag;
}

Thanks in advance,

Xiaolung.

// Edit
Solved it. The value of the second selectbox was small caps, that's why setValue didn't work at first. After removing .toUppercase it worked.

Don't see a mark as solved option...

slemmon
18 Jul 2013, 3:39 PM
Thanks for commenting back with your solution! The community appreciates it!