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,
It would appear I've found bug in the WebInput control, it is not possible to access the values of the WebInput control using the Client Side API when using WebInput controls inside a UserControl.
The sample is comprised of a MasterPage with a WebPaneManager, a content page which contains a user control, and a Usercontrol that has three Webinput controls.
I want to be able to grab the values from all three date fields whenever a user changes one of the values so I can recalculate the months between dates.
With this combination of controls the Webinput client api fails to work.
The "Hack" to actually get the value from the date controls is:
document.getElementById(ISGetObject("wiCaptureDate").Id).value
Can you verify and advise when this will be fixed.
Regards,
Adrian.
The behavior is by design, during DayEvents-OnClick the selected value has not been applied to the WebInput. In order to determine the WebInput that triggered the event and the currently selected date, you could use the event parameter. Here is the snippet:
function UpdateDates(ctrlId, selectedDay, selectedMonth, selectedYear) { var currentInput = ISGetObject(ctrlId); var dataCaptureDate = ISGetObject("wiCaptureDate"); var webInput1 = ISGetObject("WebInput1"); var webInput2 = ISGetObject("WebInput2"); var strMessage = ""; var selectedDate = new Date(); selectedDate.setFullYear(selectedYear, selectedMonth - 1, selectedDay); strMessage += "Current input:" + selectedDate.toDateString() + "\r\n"; if (ctrlId != "wiCaptureDate") strMessage += "Data Capture Date:" + dataCaptureDate.GetValueData() + "\r\n"; if (ctrlId != "WebInput1") strMessage += "Web Input1:" + webInput1.GetValueData() + "\r\n"; if (ctrlId != "WebInput2") strMessage += "Web Input2:" + webInput2.GetValueData() + "\r\n"; alert(strMessage); }
Glen,
The problem isn't so much with the DayEvents-Onclick event, it is with trying to retreive a value from the control with any event from any function, even from the controls that didn't trigger the event.
Also, I am setting the values of the Date Controls in the Code Behind page, not in client side script so when the controls display they show the correct values, I simply can't retrieve them with your API.
However, if I move the same controls to a standalone ASPX both, both versions that I have supplied work fine, so to me this is a bug. So if this is "by design" how come the same code works differently in a a StandAlone ASPX page. Sample is attached, have a look at the "StandAloneWebInput.aspx" page which works just fine with the same code, however inside a Master Page, user control, it does not work.
In this sample I have provided I have even tried to call the UpdateDates method from the "body.Onload" event.
I have also tried looking at the script in the debugger, the WebInput control simply does not return the value unless you use the initial workaround I supplied.
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