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,
I’m not able to set the date time value in client side. I was trying to use SetValueData() and el.Value = dateTimeValue.
Nothing works. I need this very urgently. If there is no solution I will have to look for some other control with similar functionality.
Sample code included.
Please help!
Thank you in advance
Mark
Hello Mark,
The method needs additional parameters (boolean).
E.g
el.SetValueData(txt.value, true);
It should work. Hope this helps.
Regards,Handy
Hi Handy,
This at first it appears to be working fine but I see one problem:
When trying to retrieve value it shows “” when checking the properties for Value and Text they are also empty.
function getWI_value(controlID) {
var IS_WI = ISGetObject(controlID);
if (IS_WI) {
return IS_WI.GetValueData();
}
For DateTime scenario, please try not to use string. GetValueData() only can be used for DateTime object in this scenario. This happens because you use Format Date in this scenario.e.g
If you assign the Date object in WebInput1 such as :
var currentTime = new Date(); currentTime.getDate(); el.SetValueData(currentTime, true);
When you use GetValueData(), it will show the value.
Thanks for the tip.
How can I display formatted date time immediately after calling SetValueData() instead of edit format. Is there another function I need to call? I have attached sample to illustrate the my concern.
I have noticed that I need to change the value of the control in order to switch to Display Format,
Also if you could check if I’m using correct functions for setting ReadOnly and focus. I’m not able to set focus on the control if I do the following in sequence:
1 PageLoad ... WI.ReadOnly = true; 2 action: WI. SetValueData()
1 PageLoad ... WI.ReadOnly = true;
2 action: WI. SetValueData()
3. WI.readOnly = false;
4. WI.SetFocus();
Is there a timing issue?
Thanks
I was unable to open or save the attached sample file in your previous post.Could you please kindly re-attach the sample so that we can continue to investigate the problematic behavior?
Hi Yudi
here is the attachement again...
I can see the behavior that you referred to. It happens because you were misunderstanding the concept.You should not set the value when WebInput still in ReadOnlymode.If you set the value when the ReadOnlymode is still true, it would cause the ReadOnlycould not be set as false.The correct sequence should be:1.ReadOnly false;2.SetValueData();3.SetFocus();
Hope this helps.
Hello Handy,
Thanks for your aswer but i still have a problem. After seting value i want the control to be read only again but this does not happen. Not my sequence is as following
1. Page Load WI.ReadOnly = true (server side)
2. User clicks button[SetValueData] (all client side, see my sample)
-WI.SetReadOnly(false);
-WI.SetValueData(newDT, true);
-WI.SetReadOnly(true); ... this is not happening you can still edit the value!
Is there still I'm doing something wrong?
And after WI.SetValueData() how can i make cotrol to display Formatted date "yyyy-MMM-dd HH:mm"instead of Edit/Mask format "yyyy/MM/dd HH:mm"? Please reffer to my sample...
"yyyy-MMM-dd HH:mm"
"yyyy/MM/dd HH:mm"
Hello,
Your sample is corrupted. However, I can see your issue in here. After SetReadOnly(false), it could not SetReadOnly(true). For temporary workaround, please try FullPostBack approach.I will report this issue to our developer teams. Also, you could not change the EditFormat with javascript approach. There is no available method to change that.
FullPostBack is not an option for me since the form i'm working on loads around 8-10 sec. I cannot afford reloading just to set one control. I need this fix as ASAP. I'm using your WebInput very extensively mostly for datetime entries. Being able to set the read only flags on and off is compulsory for this app security. So please escalate this issue and let me know the time line. If this will not be resoved soon it will put my project in jeopardy.
Thank you for your help
Hello MArk,
Ok, I will inform this situation to our developer teams.
Any update on this issue ?...
Our developer has added new logic to SetReadOnly method. While it is being fixed, you can apply below snippet code for your scenario. In the next release, you can ignore the code.
function setWI_valueTest(controlID) { var el = ISGetObject(controlID); var txt = document.getElementById('txt1'); if (txt) { var newDT = new Date(txt.value); if (newDT) { if (el) { WI_setReadOnly(controlID, false); // set to read only el.SetValueData(newDT, true); el.SetReadOnly(true); el.EditFormat.ReadOnly = true; el.GetControlElement().removeAttribute("readOnly"); } } } } function getWI_value(controlID) { var IS_WI = ISGetObject(controlID); if (IS_WI) { return IS_WI.GetValueData(); } } function WI_setReadOnly(controlId, readOnly) { var IS_WI = ISGetObject(controlId); if (IS_WI) { IS_WI.SetReadOnly(readOnly); IS_WI.GetControlElement().setAttribute("readOnly", "readonly"); return true; } } function setDT(controlID, isReadOnly) { setFocusISWebInput(controlID) WI_setReadOnly(controlID, true); //false is passed; make it writable return true; } function setFocusISWebInput(controlID) { var WI = ISGetObject(controlID); if (WI) { WI.SetFocus(); return true; } } function WI_OnAfterValueChanged(controlId, newValue, newText) { alert('value changed!') } function setWI_Date(controlId) { setWI_valueTest(controlId) }
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