FoxInCloud
Java Script How To and DatePicker
Gravatar is a globally recognized avatar based on your email address. Java Script How To and DatePicker
  Ryan Rindlisbacher
  All
  Jun 1, 2015 @ 10:37am
I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?

Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  n/a
  Ryan Rindlisbacher
  Jun 1, 2015 @ 11:27am
I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?


Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  Ryan Rindlisbacher
  James Patterson
  Jun 1, 2015 @ 12:45pm
James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?

Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  FoxInCloud Support - Thierry N.
  Ryan Rindlisbacher
  Jun 2, 2015 @ 12:57am
Hi Ryan,

Here is what you can find in http://foxincloud.com/roadmap.php

Enhancement: JavaScript DatePicker support


If, at design time, (Vartype(awTxt.Value) = 'D' or 'D' $ awTxt.format) and awTxt.wlDatePicker and xxxServer.wljQueryUIAdd, FAS automatically assigns a jQueryUI datePicker to the textbox.

By default, FAS sets language and date formats according to the browser first preferred language, English if this language is not provided or supported.

You can customize your datePicker's behavior using the following properties:
- .woDatePickerOptions: set as either a VFP empty object with properties matching those expected by datepicker.setDefaults() [assigned in this.Init()], or a JavaScript object litteral such as {option1:value1, option2:value2, ...} [assigned at design time or in this.Init()]
- .wdFrom, .wdTo: set dynamically in your code to limit the date range user can select.

You can also customize datePicker appearence using jQueryUI global theme (xxxServer.cjQueryUItheme), or additional CSS directives in xxx.css
(all details on jQueryUI datePicker API - such as options, methods and event - at http://api.jqueryui.com/datepicker/)


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?


-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  FoxInCloud Support - Thierry N.
  James Patterson
  Jun 2, 2015 @ 01:05am
Hi James,

DatePicker support was released with version 2.10 on 09/18/2014

You have a sample implementation in objects 'mySearchDateFirst' and 'mySearchDateLast' of

MODIFY CLASS myDemofrmmb OF ab\aw\samples\fic\classe\ficdemo


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?


-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  FoxInCloud Support - Thierry N.
  Ryan Rindlisbacher
  Jun 2, 2015 @ 01:19am
Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?


Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  Ryan Rindlisbacher
  Thierry Nivelet (FoxInCloud)
  Jun 2, 2015 @ 03:35am
Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?



Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  FoxInCloud Support - Thierry N.
  Ryan Rindlisbacher
  Jun 2, 2015 @ 03:41am
Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?





-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  Ryan Rindlisbacher
  Thierry Nivelet (FoxInCloud)
  Jun 2, 2015 @ 05:42am
Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?





Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  FoxInCloud Support - Thierry N.
  Ryan Rindlisbacher
  Jun 2, 2015 @ 05:46am
Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?






Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  Ryan Rindlisbacher
  Thierry Nivelet (FoxInCloud)
  Jun 2, 2015 @ 06:06am
Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?







Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  FoxInCloud Support - Thierry N.
  Ryan Rindlisbacher
  Jun 2, 2015 @ 06:19am
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?









-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  Ryan Rindlisbacher
  Thierry Nivelet (FoxInCloud)
  Jun 2, 2015 @ 08:24am
Made those changes, still not working. Any other ideas?



thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?









Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  FoxInCloud Support - Thierry N.
  Ryan Rindlisbacher
  Jun 2, 2015 @ 09:17am
did you try without .controlSource, by assigning .Value straight?
procedure getData
...
thisform.txtDate.value = m.webservicedt

don't worry about .wcPropSave - FoxInCloud takes the right default whether .controlSource is used or not


Made those changes, still not working. Any other ideas?



thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?











-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  Ryan Rindlisbacher
  Thierry Nivelet (FoxInCloud)
  Jun 2, 2015 @ 09:29am
Assigning the .value directly did not help.
Procedure thisform.getdata()
thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt


did you try without .controlSource, by assigning .Value straight?
procedure getData
...
thisform.txtDate.value = m.webservicedt

don't worry about .wcPropSave - FoxInCloud takes the right default whether .controlSource is used or not


Made those changes, still not working. Any other ideas?



thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?











Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  FoxInCloud Support - Thierry N.
  Ryan Rindlisbacher
  Jun 2, 2015 @ 09:31am
did you clear thisform.txtNewDate.controlSource?


Assigning the .value directly did not help.
Procedure thisform.getdata()
thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt


did you try without .controlSource, by assigning .Value straight?
procedure getData
...
thisform.txtDate.value = m.webservicedt

don't worry about .wcPropSave - FoxInCloud takes the right default whether .controlSource is used or not


Made those changes, still not working. Any other ideas?



thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?













-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  Ryan Rindlisbacher
  Thierry Nivelet (FoxInCloud)
  Jun 2, 2015 @ 10:04am
No, I hadn't. Clearing the .controlsource seemed to fix it. It's now showing up!


did you clear thisform.txtNewDate.controlSource?


Assigning the .value directly did not help.
Procedure thisform.getdata()
thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt


did you try without .controlSource, by assigning .Value straight?
procedure getData
...
thisform.txtDate.value = m.webservicedt

don't worry about .wcPropSave - FoxInCloud takes the right default whether .controlSource is used or not


Made those changes, still not working. Any other ideas?



thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?













Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  Ryan Rindlisbacher
  Ryan Rindlisbacher
  Jun 2, 2015 @ 10:08am
OK, I was wrong. When I got the date to finally show up, I lost the datepicker options (I don't think FIC saw it as a date field anymore). In the designer I set thisform.txtNewDate.value={} so FIC would see it as a date during instantiation. This did make FIC see it as a date (the datepicker was back) but it no longer shows the date (back to just showing mm/dd/yyyy). :(



No, I hadn't. Clearing the .controlsource seemed to fix it. It's now showing up!


did you clear thisform.txtNewDate.controlSource?


Assigning the .value directly did not help.
Procedure thisform.getdata()
thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt


did you try without .controlSource, by assigning .Value straight?
procedure getData
...
thisform.txtDate.value = m.webservicedt

don't worry about .wcPropSave - FoxInCloud takes the right default whether .controlSource is used or not


Made those changes, still not working. Any other ideas?



thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?














Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  FoxInCloud Support - Thierry N.
  Ryan Rindlisbacher
  Jun 3, 2015 @ 08:55pm
Ryan,

not sure I understand all what's going on in your case ...

did you try to add 'D' to .Format?

You can also refer to the class I mentioned recently - works pretty much like your app.


OK, I was wrong. When I got the date to finally show up, I lost the datepicker options (I don't think FIC saw it as a date field anymore). In the designer I set thisform.txtNewDate.value={} so FIC would see it as a date during instantiation. This did make FIC see it as a date (the datepicker was back) but it no longer shows the date (back to just showing mm/dd/yyyy). :(



No, I hadn't. Clearing the .controlsource seemed to fix it. It's now showing up!


did you clear thisform.txtNewDate.controlSource?


Assigning the .value directly did not help.
Procedure thisform.getdata()
thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt


did you try without .controlSource, by assigning .Value straight?
procedure getData
...
thisform.txtDate.value = m.webservicedt

don't worry about .wcPropSave - FoxInCloud takes the right default whether .controlSource is used or not


Made those changes, still not working. Any other ideas?



thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?
















-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  Ryan Rindlisbacher
  Thierry Nivelet (FoxInCloud)
  Jun 4, 2015 @ 02:55am
Yes, I tried a 'D' in the .Format. Still the same issue.


Ryan,

not sure I understand all what's going on in your case ...

did you try to add 'D' to .Format?

You can also refer to the class I mentioned recently - works pretty much like your app.


OK, I was wrong. When I got the date to finally show up, I lost the datepicker options (I don't think FIC saw it as a date field anymore). In the designer I set thisform.txtNewDate.value={} so FIC would see it as a date during instantiation. This did make FIC see it as a date (the datepicker was back) but it no longer shows the date (back to just showing mm/dd/yyyy). :(



No, I hadn't. Clearing the .controlsource seemed to fix it. It's now showing up!


did you clear thisform.txtNewDate.controlSource?


Assigning the .value directly did not help.
Procedure thisform.getdata()
thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt


did you try without .controlSource, by assigning .Value straight?
procedure getData
...
thisform.txtDate.value = m.webservicedt

don't worry about .wcPropSave - FoxInCloud takes the right default whether .controlSource is used or not


Made those changes, still not working. Any other ideas?



thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?
















Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  FoxInCloud Support - Thierry N.
  Ryan Rindlisbacher
  Jun 9, 2015 @ 06:48am
did the new beta fix this issue?


Yes, I tried a 'D' in the .Format. Still the same issue.


Ryan,

not sure I understand all what's going on in your case ...

did you try to add 'D' to .Format?

You can also refer to the class I mentioned recently - works pretty much like your app.


OK, I was wrong. When I got the date to finally show up, I lost the datepicker options (I don't think FIC saw it as a date field anymore). In the designer I set thisform.txtNewDate.value={} so FIC would see it as a date during instantiation. This did make FIC see it as a date (the datepicker was back) but it no longer shows the date (back to just showing mm/dd/yyyy). :(



No, I hadn't. Clearing the .controlsource seemed to fix it. It's now showing up!


did you clear thisform.txtNewDate.controlSource?


Assigning the .value directly did not help.
Procedure thisform.getdata()
thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt


did you try without .controlSource, by assigning .Value straight?
procedure getData
...
thisform.txtDate.value = m.webservicedt

don't worry about .wcPropSave - FoxInCloud takes the right default whether .controlSource is used or not


Made those changes, still not working. Any other ideas?



thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?


















-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: Java Script How To and DatePicker
  Ryan Rindlisbacher
  Thierry Nivelet (FoxInCloud)
  Jun 9, 2015 @ 07:40am
Just got done testing it. Yes, it looks like v2.20beta7 fixed it. It appears to work in both Chrome and IE (haven't tested it yet in other browsers). Thanks for your help!



did the new beta fix this issue?


Yes, I tried a 'D' in the .Format. Still the same issue.


Ryan,

not sure I understand all what's going on in your case ...

did you try to add 'D' to .Format?

You can also refer to the class I mentioned recently - works pretty much like your app.


OK, I was wrong. When I got the date to finally show up, I lost the datepicker options (I don't think FIC saw it as a date field anymore). In the designer I set thisform.txtNewDate.value={} so FIC would see it as a date during instantiation. This did make FIC see it as a date (the datepicker was back) but it no longer shows the date (back to just showing mm/dd/yyyy). :(



No, I hadn't. Clearing the .controlsource seemed to fix it. It's now showing up!


did you clear thisform.txtNewDate.controlSource?


Assigning the .value directly did not help.
Procedure thisform.getdata()
thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt


did you try without .controlSource, by assigning .Value straight?
procedure getData
...
thisform.txtDate.value = m.webservicedt

don't worry about .wcPropSave - FoxInCloud takes the right default whether .controlSource is used or not


Made those changes, still not working. Any other ideas?



thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"

Please do this in form.load() and user wcPropSaveEdit():

procedure form.load
wcPropSaveEdit(this, "hadInstantiationError, rescheddt")

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

Once .controlSource is assigned at design time, non need to reassign at each event


Wow, I really must be missing something as I'm sure it can't be this hard :)

Still can't get the date value to show in the browser. Here is how my code looks:
In the designer, I've set the default value of thisform.rescheddt to {//}
and thisform.txtNewDate.controlsource=thisform.rescheddt

thisform.init()

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.wcPropSave="this.hadInstantiationError,this.rescheddt"
ENDIF

thisform.refresh_()
lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()
thisform.txtNewDate.Refresh()

Then

thisform.getdata()

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.controlSource = 'thisform.rescheddt'

The date value is showing up in the vfp window, but not in the browser (same as before).
I'm sorry to take up so much of your time, but I can't quite figure out what I'm doing wrong.



Right, was not aware of this possible looping

you need to choose whether you use .controlSource or work on .value
either one works, both don't

This code is designed for using .controlSource (option I prefer)

thisform.txtNewDate.controlSource = 'thisform.rescheddt'

procedure form.refresh_
thisform.rescheddt=m.mywsdate

thisform.txtNewDate.Refresh() will later execute automatically and adjust thisform.txtNewDate.Value according to thisform.txtNewDate.controlSource


Trying to code it like you suggested, I seem to be going into an infinite loop. In thisform.getdata() I added a thisform.refresh() to get my date value to show up. I'm guessing my code in thisform.refresh_ that calls thisform.getdata() is getting called again via my thisform.refresh(), thus causing the infinite loop.

To recap, thisform.refresh_ looks like:

lparameters void_parameter_reminder_implement_your_Refresh_code_in_this_method

thisform.getData()

and thisform.getData now includes:

thisform.rescheddt=m.mywsdate
thisform.txtNewDate.value=thisform.rescheddt
thisform.refresh()

Maybe I'm guessing wrong about what's causing the infinite loop, but when I comment out the thisform.refresh() call in thisform.getdata() the form loads, but doesn't show the date value. If I uncomment it, the form doesn't load. Ideas?



Ryan,

Here is what I would do:

you don't need that:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

You can just set .controlSource and .value in designer

then

procedure thisForm.getdata
thisform.rescheddt=m.webservicedt
thisform.Refresh && this will propagate to all member objects


Thierry,

I'm not doing something correct. Here is what I'm seeing. On the FIC side, it looks correct:

But in the browser I still get this:

In form.init() I've got this code:

IF thisform.wlInitFirst OR PCOUNT()=0
thisform.txtNewDate.wcPropSave="value,controlsource"
thisform.txtNewDate.Value={//}
ENDIF

and then in form.getdata()

thisform.rescheddt=m.webservicedt
thisform.txtNewDate.value=thisform.rescheddt
thisform.txtNewDate.Refresh()

I have confirmed that m.webservicedt is a good date value in type()='D'

Any idea why I can't get the date to show in thisform.txtNewDate?


Re-hi Ryan,

So far http://foxincloud.com/roadmap.php is probably the best resource to discover features;
once you've discovered a feature, looking at the PEM descriptions and source code gives additional insight: .wReadMe() and/or 'show parent source code'
then ultimately we are here to help!

PS: http://doc.foxincloud.com/doku.php construction should resume this summer, after shipping version 2.20

Do feel free to spread the word about FoxInCloud on forums, social networks, blogs and the like - the more traction we get, the more we can invest on further developments, including documentation.

regarding your issue,
whenever you define control.controlSource, FoxInCloud does not save .Value because it considers that .value derives from (.controlSource) and this should be saved instead.

In this case, you can either set

thisform.txtDate.controlSource = '' && at design time

and work only with .Value,
or

with thisform.txtDate
store m.mynewdt to (.controlSource)
.refresh() && updates .Value
endwith

In this latter case, make sure the form-level property acting as .controlSource is saved, eg:

procedure thisform.txtDate.init
wcPropSaveEdit(thisform, m.this.controlSource)

James,

Thanks for the info. I wasn't aware of .wlDatePicker. Very cool. I wish FIC had a help file that I could search for these things, but FIC keeps surprising me with it's cool features. However I can't quite get it working correctly. The textbox is bound to a form prop that has a default value of {//}. When the form is loaded I'm setting thisform.txtDate.value=m.mynewdt (comes from a web service query), but the textbox is never reflecting this. In fact, it's never showing the empty date either. Here's a screen shot of what I'm seeing:

Even when I click on it and get a datepicker (which is cool!) it never updates the display value of thisform.txtDate. Any ideas of what I'm missing?


I may not fully understand what you need, but with a FIC textbox make .wlDatePicker true. Insure textbox is bound as a date, or has {} in the .Value. I only quickly tested this a few weeks ago, and I haven't had a chance to get back to it. Seemed to work fine, I had some initial issues in IOS I need to workout. There is also a .woDatePickerOptions, kinda curious about that one too. Post back anything you discover about the date picker!

This date picker was not available early on, seems Tuvia posted about adapting a JS picker back them. Take the date back a few years and search on this. Tuvia is the man on adding JS and CSS, adding menus and page tabs before FIC had them. Wish I understood half of what he posts...


- James


I've come to a point in coding a form that I need to pop up a date picker when the user clicks in a text box that shows a date. Basically it comes down to two things: 1-how to use java script in FIC, and 2-how to solve this particular need (date picker). I've tried to find some tutorials for this but haven't found any. Does anyone have sample code or can point me in the right direction?