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,
Scenario:
Web page with WebCombo and Button
On server side in Page_onLoad I set my WebCombo1.Value=2
My Button has simple javascript where I'd like to get some info
alert(WebCombo1.Text); // return "Condiments"alert(WebCombo1.Value); // return 2alert(WebCombo1.IsValueInRange()); // return false - Why?...
// WebCombo1.GetRowsCount() => -1// WebCombo1.GetRow(0) => undefined//WebCombo1.GetSelectedRow() => null//resultBox => null
}
How can I init resultBox to get some info ?
Ok, Allow me to explain about our behaviour. When you Set Value at server side, indeed the value would be loaded/set. But the list/resultBox has not been loaded yet. IsValueInRange method is designed for when you typed something on WebCombo or ShowDropDown (as designed).If you want the resultbox to be loaded at the first load, then the only workaround is calling the dropdown at client side.
e.g
function WebCombo1_OnInitialize(controlId) { var WebCombo1 = ISGetObject(controlId); WebCombo1.ShowDropDown(); return true; }
Hope this helps.
Regards,Handy
You need to let the WebCombo1_OnInitialize to finish first in order to obtain the combo additional information. Specifically, you need to have WebCombo finish creating its resultbox (by invoking ShowDropDown() method).
You can use window.setTimeout at on load page to add some delay until WebCombo finish creating its resultbox.
<script language="javascript" type="text/javascript"> <!-- this.onload = WebButton1_OnClientClick; function WebButton1_OnClientClick(controlId, parameter) { var WebButton1 = ISGetObject(controlId); var WebCombo1 = ISGetObject("WebCombo1"); window.setTimeout(function() { alert(WebCombo1.IsValueInRange()); }, 600); return true; } function WebCombo1_OnInitialize(controlId) { var WebCombo1 = ISGetObject(controlId); WebCombo1.ShowDropDown(); return true; } --> </script>
I get another issue.
Scenario the same: WebCombo1 and Button.
Javascript:
this.onload = Button1_onClick; function WebCombo1_OnInitialize(ctrlId) { var WebCombo1 = ISGetObject("WebCombo1"); WebCombo1.ShowDropDown(); return true; }
function Button1_onClick() { var WebCombo1 = ISGetObject("WebCombo1"); alert(WebCombo1.IsValueInRange()); }
When the page (on the client side) trigger onload event , I've got alert with "false". When I click on Button1 once again I've got true.
More complicated scenario:In my app I'd like to read some additional information (from my webcombo with multicolumn ) at onload page (client side) and call some method to enable, disable, set default parameters another controls.
How can I do that ?
regards
Andrzej
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