Hi all,
I'm using the comboBox widget, I need the filter propery but when user enters an invalid value into the input field I have to raise an error, how can I do that?
Is there any way to check if a comboBox contains a value?
Best regards
David
Hi all,
I'm using the comboBox widget, I need the filter propery but when user enters an invalid value into the input field I have to raise an error, how can I do that?
Is there any way to check if a comboBox contains a value?
Best regards
David
Invalid values in comboBox
18 June, 2008 - 15:15 — yudiHi David,
Could you try to check the value in the change event ?
~Yudi
Hi Yudi, Yes, I could try it
18 June, 2008 - 17:52 — DavidHi Yudi,
Yes, I could try it but I don't know how.
var value=this.getProperty('value');
// and now, how could I check wether my combo contains "value" or not???
</e:handler>
Thanks yudi
David
Hi David, It can be check if
19 June, 2008 - 09:39 — yudiHi David,
It can be check if the value is null or empty then give some message or something else.
alert('your message');
}
It is also possible to use validation bf:required or b:dataType with your own schema for this.For more info , please have a look http://demo.backbase.com/explorer/#|examples/contentValidation.xml
<b:comboBoxOption>Afghanistan</b:comboBoxOption>
<b:comboBoxOption>Albania</b:comboBoxOption>
</b:comboBox>
~yudi
Yes, I can know if the value
19 June, 2008 - 10:11 — DavidYes, I can know if the value is null or not, but what I want to know is if the value typed by user is one of the comboBoxOption. Because of filter="true", the user can type into the input a value not allowed (Only are allowed the values in the comboBox), and in this case I have to raise a message.
comboBox doesnot match any filter value
23 June, 2008 - 11:51 — andysHi David,
The comboBox will do filtering everytime the user type a letter in the inputText. And the method filter actually do filter and set bMatches variable.
You can access the javascript property which is 'this.__bHasMatches'
Next, you can check its value..whether it matches any value or not, if it does not match anything you can raise a message.
you can put this value in 'change' or in 'keyup' or in 'keydown' handler.
Hope this helps,
Andys
OK andys, this is what I
23 June, 2008 - 13:36 — DavidOK andys, this is what I wanted.
Thanks and regards
David