FoxInCloud
Problem showing a form
Gravatar is a globally recognized avatar based on your email address. Problem showing a form
  Michele
  All
  Nov 9, 2020 @ 09:03am

I have a form that shows some data about some customers. WHen i select one code i can't show nothing. With other codes data are shown correctly. If i activate debug in fox ide i can see data for all codes even those i can't see in browser... In the form i have a pageframe and one detail is that when nothing is shown i can see only one page of the pageframe not all...

Here is the form in the fox ide

Here is the form in the browser

And when i have this problem. In the browser console i have this error

Gravatar is a globally recognized avatar based on your email address. re: Problem showing a form
  FoxInCloud Support - Thierry N.
  Michele
  Nov 10, 2020 @ 01:35am

Ciao Michele,

Please try to display the instruction where error occurs: try clicking on VM888:2066 (you may need to enable break on uncaught exceptions).

Google Chrome offers a better debug support, especially for dynamic JS evaluation like in this case.

Gravatar is a globally recognized avatar based on your email address. re: Problem showing a form
  Michele
  Michele
  Nov 10, 2020 @ 01:43am

FOUND where is the problem ! Not the solution.

The problem appears when i have in one of the textboxes i have in the form the ' character I never saw this problem before. I don't know what is changed, we often use this character in italian language and it is particular that someone before yestreday never used it... I tested that one form that works fine. I edit a textbox and insert a ' in it, save data and close the form. Then i trid to open it and i had the problem...

How can i solve it ? It's impossible to not use this character

Gravatar is a globally recognized avatar based on your email address. re: Problem showing a form
  FoxInCloud Support - Thierry N.
  Michele
  Nov 10, 2020 @ 03:56am

Did you revert the changes we made for your date control issue? Should fix that.

What is the ANSI code of that character?

Also please share the failing instruction.

Gravatar is a globally recognized avatar based on your email address. re: Problem showing a form
  Michele
  FoxInCloud Support - Thierry N.
  Nov 10, 2020 @ 04:50am

Probably one of these

Which failing instruction ?

Gravatar is a globally recognized avatar based on your email address. re: Problem showing a form
  FoxInCloud Support - Thierry N.
  Michele
  Nov 10, 2020 @ 05:51am

Again, did you revert the change?

The JavaScript instruction that fails

Gravatar is a globally recognized avatar based on your email address. re: Problem showing a form
  FoxInCloud Support - Thierry N.
  Michele
  Nov 13, 2020 @ 03:14am

Michele, any feedback on this?

Which failing instruction ?

if you click on VM888:2066 in this screenshot

you should see the JavaScript instruction where error occurs.

Gravatar is a globally recognized avatar based on your email address. re: Problem showing a form
  Michele
  FoxInCloud Support - Thierry N.
  Nov 13, 2020 @ 03:37am

I deleted this test code that you suggest me for another problem

modify command awServer.prg
…
define class awAJAX …
…
hidden procedure PropChangedHTML_Value
…
&& replace
CASE m.BC == 'Textbox'
	local lcType as String, lDate as Boolean
	lcType = Vartype(m.toControl.Value)
	lDate = m.lcType $ 'DT'
	INSERT INTO PCHTML VALUES (m.BC, m.OA, 'value', 'S', cEscaped_XML(Iif(m.lcType == 'C', Trim(m.toControl.Text), Alltrim(m.toControl.Text))))
	this.cScriptJSAdd(Textmerge([FoxInCloud.inputDate(jQuery('#<<m.OA>>').<<Iif(m.lDate, 'add', 'remove')>>Class('awDate'), <<cLitteralJS(!m.lDate)>>);]))

&& by
CASE m.BC == 'Textbox'
	local lcType as String, lDate as Boolean, lcValue as String, lcYMD
	lcType = Vartype(m.toControl.Value)
	lDate = m.lcType $ 'DT'
	lcValue = Iif(m.lcType == 'C', Trim(m.toControl.Text), Alltrim(m.toControl.Text))
	lcYMD = Iif(m.lDate, Alltrim(cLitteralJS(m.toControl.Value,,.T.), '"'), m.lcValue)
	this.cScriptJSAdd(Textmerge('';
	 + [var $inp = jQuery('#<<m.OA>>'), $type = $inp.attr('type');];
	 + [$inp.val($type === 'date' ? '<<Left(m.lcYMD, 10)>>' : ($type === 'datetime-local' ? '<<Left(m.lcYMD, 16)>>' : <<cLitteralJS(m.lcValue)>>));];
	 + [FoxInCloud.inputDate($inp.<<Iif(m.lDate, 'add', 'remove')>>Class('awDate'), <<cLitteralJS(!m.lDate)>>);];
	 ))

And now it works

Gravatar is a globally recognized avatar based on your email address. re: Problem showing a form
  FoxInCloud Support - Thierry N.
  Michele
  Nov 13, 2020 @ 03:42am

Thanks,

No way you can provide the failing JavaScript instruction?

© 1996-2020