WiseJ version 2 issues after upgrading

0
0

We have recently renewed our licence, in order to upgrade our solution to version 2 of the framework and take advantage of impersonation capabilities that are not included in version1. In preparation for the upgrade,which is also entailing us upgrading our .Net Framework version, I have been doing an offline dry run with the new version. I have upgraded everything according to the resources I found with regards to the upgrade steps. I have managed to resolve several issues that have cropped up, whereby logic that worked in version1 now no longer works.

Please note that your upgrade instructions that I found at the following resource did not include a step to also replace any version 1 extention references with the new version extention dll’s. You may want to amend that, as it did cause me a headache:

https://wisej.com/docs/2.1/html/UpgradeFromWisej1.htm

The following is what I picked up with version 2:

  • You have outright removed the Wisej.Web.Separator type
  • You added a property called AllowHTML in the middle of the MessageBox.Show method overloads, when it should have been added at the end:

Version1: MessageBox.Show(“mymessage”, “mycaption”, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, true, keepOnScreen, rightToLeft, onClose);

        Version2: MessageBox.Show(“mymessage”, “mycaption”, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, AllowHTML, true, keepOnScreen, rightToLeft, onClose);

  • DisplayedCells option removed from property type AutoSizeRowsMode
  • Mixed Method overloading that worked in version 1 no longer works. For example the following used to work:

Public Sub LoadCombo(Combo As ComboBox)
End Sub

Public Sub LoadCombo(Combo As Wisej.Web.ComboBox)
End Sub

but had to be changed to:

Public Sub LoadCombo(Combo As ComboBox)
End Sub

Public Sub LoadComboWiseJ(Combo As Wisej.Web.ComboBox)
End Sub

  • The IsVisible property on Control was removed. I found this property a few months ago, when I realised that the Visible property on control is unreliable, as it resolves to false when the control is not currently displayed to a user because it is, for example, on the second tabpage of a TabControl and the second page is not currently selected. I needed a reliable property to determine whether a control is outright hidden, irrespective of whether the user can actually see it(which is how winforms works). I determined that the additional IsVisible property provided this capability. After seeing it was removed in version 2, I asked a colleague for some help and he figured out that the IsVisible property hasn’t been outright removed but is now an internal property that can only be accessed using reflection. We are using new logic using reflection for now. I just would like an explanation of why the property was hidden and whether there is any intention to make the normal visible property act like winforms?
  • The UserComboBox DropDown event can no longer set the height of the DropDownControl. This worked in version 1 of WiseJ. The height gets set without errors, but only applies the next time the Dropdown is shown(ie the next time the user opens the DropDown, the previous height is then applied). I have tried using an Application.Update but it has not effect. Please see event userComboBox1_DropDown in the attached test case form. I have included a screenshot (UserComboBox issues.PNG) showing the dropdown height unchanged after setting it in the event. It should have changed to 200.With a Custom ComboBox I wrote ages ago, using a UserComboBox and Datagridview(which our system is very dependent on), I have overcome this issue by doing the dropdowncontrol height setting in other places like the logic where comboBox list items are added or removed. This will most likely result in a performance hit, which is precisely the very reason I wrote a Custom control (ie. the standard WiseJ ComboBox in version 1 experienced a serious memory bloat issue with large lists).  I am yet to stress test my fix.
  • Also with the UserComboBox, the behaviour I have wanted cannot be achieved anymore with version 2. With the mentioned Custom ComboBox, while running as DropDown dropdown style, I want the dropdown to open when the user types in the textbox area of the UserCombBox, but then the cursor must be placed after the last character the user typed, so if they tyope another character it appears after the previous character. With the version 1 framework, I had hacked the process, by adding additional logic after the request to show the dropdown, to put focus back onto the textbox of the UserComboBox and memorise the current text, clear it, set the original text value back and then set the cursor to where it needs to be using SelectionStart and SelectionLength. This hack no longer works, and after numerous attempts to do a similar hack with version 2 I just cannot get it to work .Please see method UserTyping in the attached test case form, which gets called by the KeyPress event. You will see my Fix attempt commented out. This ‘fix’ still doesn’t always work, as sometimes the cursor is placed at the start of the current text while you are typing. I am not sure if there is another way of setting the textbox cursor or whether my usage of SelectionStart and SelectionLength is correct and this is a bug.

    In the attached screenshot, I placed the cursor between the ‘b’ and ‘c’ in the existing text of ‘abcde’ and entered a ‘4’. The text updates correctly, but the whole text is selected, even though my logic is requesting that the cursor be placed after the last typed character(in this case the ‘4’)

Please can you review the attached test case and address the last 3 items above, concerning the IsVisible property and the UserComboBox? It is critical that they be resolved one way or another, as we are very close to going live with the WiseJ version of our System.

All the above seems like quite alot of issues to have to experience with an upgrade. My superiors would like to know if there is any indication whether this is more a once -off occurrence with the move from ver1 to ver2, or is it likely to experience issues every time an upgrade is done(for example upgrading to version3 next year with .Net Core support)?

I have attached the Designer and Code file for a simple form with a UserCombBox and panel (Please see Window1.zip)

 

  • You must to post comments
0
0

I tried your code after fixing some issues and also tried a new test:

private void userComboBox1_DropDown(object sender, EventArgs e)
{
this.userComboBox1.DropDownHeight = 200;
}

I can set the DrownDownHeight before or after it’s dropped down and it always works.

About the ComboBox performance, the issue was the browser not being able to handle too many elements. Several builds ago we added the VirtualScroll property to the ComboBox, ListBox, and TreeView allowing the to handle unlimited items without any performance loss.

  • You must to post comments
0
0

Hi Luca and Frank. Thank you for fixing the Caret/Cursor issue. I see it is working now with the latest version whereby I just need to set the new SelectionStart and SelectionLength.

I haven’t seen any further mention of the other issue, also with regards to the UserComboBox, whereby setting the DropDown height and Width in the DroppedDown event no longer has an effect, and the change is only applied the next time the DropDown is shown. I have tested with the new version and the issue persists.

 

‘The UserComboBox DropDown event can no longer set the height of the DropDownControl. This worked in version 1 of WiseJ. The height gets set without errors, but only applies the next time the Dropdown is shown(ie the next time the user opens the DropDown, the previous height is then applied). I have tried using an Application.Update but it has not effect. Please see event userComboBox1_DropDown in the attached test case form. I have included a screenshot (UserComboBox issues.PNG) showing the dropdown height unchanged after setting it in the event. It should have changed to 200.With a Custom ComboBox I wrote ages ago, using a UserComboBox and Datagridview(which our system is very dependent on), I have overcome this issue by doing the dropdowncontrol height setting in other places like the logic where comboBox list items are added or removed. This will most likely result in a performance hit, which is precisely the very reason I wrote a Custom control (ie. the standard WiseJ ComboBox in version 1 experienced a serious memory bloat issue with large lists).  I am yet to stress test my fix.’

  • You must to post comments
0
0

Hi Kenneth,

issue with UserComboBox was logged as #2295 and a fix is included in the latest Wisej release (2.1.75).

Best regards
Frank

  • You must to post comments
0
0

The attachment is not runnable, but I copied it into another project to try and also looked at the code:

  • Calling Application.Update() in the Click event is not necessary. The click event is fired when the request comes in and the response will update the client. Pushing the update makes sense only if the code after keeps running.
  • Trying to alter the keyboard of the browser from the server is not a good idea because the events in the browsers have already happened. For example, you can’t stop a character from being processed on the client from server code.
  • IIUC, all the code (I guess it’s the hack is not working anymore?) in the KeyDown event is just so that forcing the drop down to open when typing keeps the caret where it is?

For the last point, I tried a regular combobox and it doesn’t select the text when dropping down while the UserComboBox does so it’s an inconsistency that we can certainly fix. It’s a lot easier to do that in the javascript side. In fact, if you set AutoCompleteMode to Suggest it already automatically drop down the list but it still selects the text.  I will log the text selection in the UserComboBox as a bug, the fix should be very quick.

HTH

 

  • You must to post comments
0
0

Hi Luca. Thank you for the response.

  • With regards to the separator being renamed, understood.
  • With regards to the allowHtml argument, my concern was where it was added. If it is new and optional it should be added at the end of the arguments, otherwise it results in the need to redevelop code. Otherwise  The code I provided was C#
  • The DisplayedCells option being removed issue resulted because of the conversion process and just meant we needed to remove the property like we did with multiple other unsupported properties when migrating from winforms, so there is no problem.
  • The overload issue must then have been due to the .Net Framework upgrade instead. Thanks for the confirmation
  • With regards to the IsVisible property, understood.
  • With regards to the UserComboBox issue, which is my main concern, I did attach the sample:

‘I have attached the Designer and Code file for a simple form with a UserCombBox and panel (Please see Window1.zip)’

  • You must to post comments
0
0

The separator has been renamed to Spacer, as documented.

The allowHtml is an optional argument that should be used by name (I’m not familiar with VB.NET but in C# you use allowHtml:true) regardless of the position. The default arguments have remained unchanged.

Autosizing or rows and columns was not implemented at all in 1.5 so the enumeration value that has been removed didn’t have any effect.

The overload issues that you reported are not related to Wisej, since it’s not a compiler.

The IsVisible property was misleading and was meant to be used internally since it was returning the internal raw VisibleInternal value. The Visible property returns whether the control or its parent are Visible. If a control has Visible = true but the parent has Visible = false when checking Visible on the control it returns false.

About the UserComboBox issue, please send a sample that we can run and I’ll be happy go over the specific issues. In the mean time I’ll try to reproduce.

 

  • You must to post comments
0
0

I forgot to mention that I am running the latest release 2.1.70.

  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.