iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi There,
I've WebCombo 6. I want to handle OnBeforeItemSelected event and cancel the selection in some kind of cases.
Thanks,
Maged
I created a simple page and added two instances of WebCombo; then specify the name as WebComboSuppliers and WebComboProducts respectively. In OnBeforeItemSelected client-side event of WebComboProducts, the selected value of WebComboSuppliers is evaluated. If WebComboSuppliers's value is 1, then cancel the selection.
Following snippet code shows how to do this using OnBeforeItemSelected.
function wcProducts_OnBeforeItemSelected(controlId, selectedText, selectedValue) { var wcProducts = ISGetObject(controlId); var wcSuppliers = ISGetObject("wcSuppliers"); if (wcSuppliers.Value == "1") wcProducts.ClearSelection(); return true; }
Hope this helps.
Thanks for your reply.
This is may not what I'm looking for.
When the user trying to select a combo box item, I want to check first if the user saved the current vew, if not I want to stay in the same view, and cancel the combo selection from the user and stay with the original sselection.
I need your help to do that, how to cancel the user selection?
I modified my sample based on the following information:
... I want to check first if the user saved the current view...
In order to emulate such condition, I added a checkbox and do checking: if checkbox.checked is true then...
... cancel the combo selection from the user and stay with the original selection.
In the following snippet code, I use OnBeforeRequest client-side event to save original selection of WebCombo in a variable. In OnBeforeItemSelected, check the checked state of my checkboxDummy. If true, cancel the combo selection and restore the original selection.
var wcProductsOriginalSelection = ""; function wcProducts_OnBeforeRequest(controlId, action) { var wcProducts = ISGetObject(controlId); if (action == "LoadData") { // save wcProducts original selection to global variable wcProductsOriginalSelection = wcProducts.Text; } return true; } function wcProducts_OnBeforeItemSelected(controlId, selectedText, selectedValue) { var wcProducts = ISGetObject(controlId); if (document.getElementById("checkboxDummy").checked) { // cancel the WebCombo selection wcProducts.ClearSelection(); // restore the original selection wcProducts.SetText(wcProductsOriginalSelection); } return true; }
Glad to hear that the snippet code of OnBeforeItemSelected posted on March 12, 2015 helps.
Should you need further assistance or run into any problems regarding our controls, feel free to post it into our forum. We would be happy to assist you again.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname