Run time adding url to link control

Not sure what the issue is here… but, I have a small web app that I upgraded to the 2.0 framework and now I am having issues sending URL information to the link control.

My programs adds links dynamically according to how many documents need to be accessed. It was working before the upgrade, but now (in a shell window) I am seeing the following error: JSONException
root{“url”}: String value does not have a specified encoding

My code is:

If mLinkContainer(0) Is Nil Then
Dim lc As New LinkContainer
lc.Link1.URL = STATE
lc.Link2.URL= FEESTATE
lc.txtDate.Text = tDATE
lc.EmbedWithin(Self, 300,250, 532, 29)
mLinkContainer(0) = lc
Else
Dim lc As New LinkContainer
lc.Link1.URL = STATE
lc.Link2.URL = FEESTATE
lc.txtDate.Text = tDATE
lc.EmbedWithin(Self,300,t, 532, 29)
mLinkContainer(x1) = lc
x1=x1+1
end if
t = t + 30
rstStatements.MoveNext

The default URL, HTTP://xojo.com works fine though…

This looks like the terrible JSONItem regression that Xojo won’t admit to or fix bites them in their own framework.

Well, I cant bill my clients until this is running… any suggestions?

This may help:

Try this

If mLinkContainer(0) Is Nil Then
  Dim lc As New LinkContainer
  lc.Link1.URL = STATE.DefineEncoding(Encodings.UTF8)
  lc.Link2.URL= FEESTATE.DefineEncoding(Encodings.UTF8)
  lc.txtDate.Text = tDATE
  lc.EmbedWithin(Self, 300,250, 532, 29)
  mLinkContainer(0) = lc
Else
  Dim lc As New LinkContainer
  lc.Link1.URL = STATE.DefineEncoding(Encodings.UTF8)
  lc.Link2.URL = FEESTATE.DefineEncoding(Encodings.UTF8)
  lc.txtDate.Text = tDATE
  lc.EmbedWithin(Self,300,t, 532, 29)
  mLinkContainer(x1) = lc
  x1=x1+1
end if
t = t + 30
rstStatements.MoveNext

It looks like you’re getting STATE & FEESTATE from a recordset and the data is not encoded.

Hmmm…I will give that a try… it did work with Xojo 2019… I am looking for my old, un-improved code to see if it will still work, but will try your suggestion as well. Thank you.

It did, and it even works in 2020r2.1. In 2021 they made some poor decisions with JSONItem and forced a bug onto all of us already using JSONItem. So much for just opening old projects and compiling. The way this bug affects you shows just how short-sighted Xojo’s decision making was.

Thank you everyone… our suggestions enabled me to get the site / service up and running again.