Hi Neil,
The fix with this issue is available with Wisej 2.5.26.
Best,
Alaa
Hi Angelo,
The fix for this issue is released in Wise 2.5.26 .
Best,
Alaa
Hi Bogdan,
At the moment, Wisej 2.5 is running on .NET framework 4.8 and with the next major releasr of Wisej 3 there’s going to be support for .NET 6.
Best,
Alaa
This extension method will format a button with a client-side link. It calculates the size of the rendered text, and applies a padding element to the link, so the link area is equal to the button area. The link foreground color is hard-coded as white, which matches the Blue 1 theme. It is also necessary to record the original button size going in, and then set it back after applying the HTML, or else the button may change in size by a few pixels.
It will NOT work if text is wrapped on the button; it must be on one line.
static class WiseJFunctions
public static void FormatButtonWithClientSideLink(this Button b, string url, string text)
{
int originalButtonWidth = b.Width;
int originalButtonHeight = b.Height;
Size szText = TextUtils.MeasureText(text, b.Font);
int Vpadding = ((b.Height – szText.Height) / 2) -2;
int Hpadding = ((b.Width – szText.Width) / 2)-2 ;
string pad = “padding: ” + Vpadding.ToString() + “px ”
+ Hpadding.ToString() + “px ”
+ Vpadding.ToString() + “px ”
+ Hpadding.ToString() + “px;”;
string html = “<a href='” + url + “‘ target=’_blank’ style=’display: block; white-space: nowrap; color: #FFFFFF; text-decoration: none; ” + pad + “‘>” + text + “</a>”;
b.AllowHtml = true;
b.AutoSize = false;
b.Text = html;
//ensure original size is enforced, if changed
b.Width = originalButtonWidth;
b.Height = originalButtonHeight;
}
I see this has been added in 2.5.26, Add ColumnHeaderAutoResizeStyle.HeaderAndContent. Thanks for considering!
It is true we can use CSS to improve the situation, like this
int padding = Convert.ToInt32(btnNavigateToSelectedIssue.Width / 2);
btnNavigateToSelectedIssue.AllowHtml = true;
btnNavigateToSelectedIssue.Text = “<a href='” + curMapUrl + “‘ target=’_blank’ style=’display: block; padding: ” + padding.ToString() + “px;’>Navigate</a>”;
However, the link text shows up as a different color than normal button text, and the padding is hard to determine exactly — you need to calculate the width and height of the rendered text, and pad exactly enough on top, left, bottom, right in order to perfectly fit the padded area inside the button.
Thus I propose a LinkButton, which I tried to get working based on the MenuItemLink example posted here (https://wisej.com/support/answers/4263/file/594/Wisej.DynamicFacebookMeta.zip)
attached is what I did so far. What is missing is a “Target” property, in addition to the HRef property … and also I cannot get the button to render in the designer. It says “Unknown type” where the button should be.
Would you be able to assist me further? Is it possible to get a LinkButton as a WiseJ standard control or extension? Then all users will be able to enjoy the benefits of a Button that can launch client-side links.
The issue is that only a small portion of the button is clickable to load the client-side link: the text
The problem is made worse for touch interfaces
You can put a <a href=””> anywhere. In a label, in a button, in a cell, etc. I tried with a button and with a label and didn’t see any issue. It’s a simple as this:
this.label1.AllowHtml = true; this.label1.Text = "<a href='http://google.com">Google</a>";
WiseJ’s Button can’t hold a client-side html link to begin with, so the native code would not even receive the link. What is needed is a LinkMenuItem equivalent for Button.
You probably need to implement the functionality in the related WKWebView delegate.
https://stackoverflow.com/questions/26501172/launching-phone-email-map-links-in-wkwebview.
HTH,
Levie
You should use the DataRepeater. Can handle millions of items from the data source and only create the visible items.
In your case if the memory is not released it means your code is holding on a reference to the controls. Wisej only keeps weak references and even if the app “forgets” to dispose controls they get disposed automatically. You can check easily using VS memory snapshots and compare before/after to find the GC root.
Hi there,
thank you for your question. Based on feedback from our customers, we removed a confusing paragraph in our licensing handbook referencing URLs.
In your example, if one application is published under three different URLs, this is just one app. If you are deploying three different apps (each under its own URL), this will be regarded as three different apps in the new Wisej license terms.
We hope that this addresses your question. For additional information, please take a look at https://docs.wisej.com/license/license-model-2022/server-licenses#overview or contact sales@wisej.com.
Thanks
Thomas
Thanks, I will give it a go. I recently learned how to wire events (I added the KeyUp event in the CKEditor, also noticed that had also been done on github now a few weeks ago).
Even tho its not a bug, when you “see” the enabled parameter one might think it actually does something. I do know thats now how it works with extensions 🙂
Thanks for the sample!
Vincent
Hi Vincent,
not a bug, the Enabled property is just not wired to the custom editor.
But it´s up to you to handle it. You can e.g. handle the EnabledChanged event and set the readonly property of the CKEditor instance accordingly.
Since Enabled and ReadOnly in general are not necessarily the same, we don´t wire it automatically.
Please find a simple sample attached.
Best regards
Frank
That works Frank, thank you. I think I tried every combination of setting focus, selecting text and application.upate (plus others), except the combination above!
Actually the best way to achieve what you want is by using this:
txtBox.Focus();
txtBox.Call("setTextSelection", 0, 0);
Otherwise the focus cycle is asychnronous and the selection only works with the code I previously posted
to have the cycle finish before.
But this code above is the preferred solution.
Best regards
Frank
Hi Neil,
as a workaround you can use code like this:
txtBox.Focus(); Application.Update(this); txtBox.SelectionStart = 0; txtBox.SelectionLength = 0;
We are currently investigating this issue and get back to you.
Best regards
Frank
If you need to enable autocompletion, add this in OnLoad somewhere
this.aceEditor1.Packages.Add(new Widget.Package
{
Name = "language_tools.js",
Source = "resource.wx/Wisej.Web.Ext.AceEditor.JavaScript.src.ext-language_tools.js"
});
this.aceEditor1.Options.enableBasicAutocompletion = true;
this.aceEditor1.Options.enableLiveAutocompletion = true;
Basically all the options are available through the Options dynamic object.
Why can’t I accept that sometimes it is the easy option? Thank you Frank and sorry for asking what looks like a really dumb question.
Hi Nello,
maybe the documentation helps you out here:
https://docs.wisej.com/docs/concepts/javascript-object-model
Please refer to the last paragraph in terms of the scope/registration of functions.
If it still does not work, please put together a compilable test case and post it here.
Best regards
Frank
