All Answers

0 votes
In reply to: ReadOnly property

Hi Luca,

Do you mean in option 1 is change the theme so the disable checkbox looks better (more contrast)?

And we just use Enable = True/False as now?

  • Tung Ngo answered Feb 7, 2017 - 6:26 pm
  • last active Feb 7, 2017 - 6:27 pm
0 votes
In reply to: ReadOnly property

Hi Luca,

I must be missing something basic here… Let’s talk specifically about CheckBox, which does not have the ReadOnly property.

Option 1, if I go into ThemeBuilder, go to CheckBox and  make the Disabled state look like the Default state (change the opacity), this would mean that all my checkboxes throughout my application will look as enabled. However, I want to have this only in a specific form, not for all checkboxes.

Option 2, if I add a ReadOnly property to the GroupBox containing a CheckBox and a TextBox. Then, iterate over controls in my container (the GroupBox) and check for ReadOnly. It is present for the TextBox and the TextBox is indeed set to ReadOnly = true, but it is not present for the CheckBox and nothing changes. What do I achieve this way? The CheckBox is still editable.

Best,
Alex

 

0 votes

Commit that GeoLocation works in FireFox with http.

I try Chrome with https later … thank you for information.

  • Kay answered Feb 7, 2017 - 4:42 pm
0 votes

Hi Luca,

First of all, sorry for my poor English as it is not my native language. I think I have ask the question in a wrong direction. Maybe let me rephrase my question below. The file download problem is solved (and thanks Frank). I am just ask something I am interested in.

The method Application.Download(string localFilePath, string name) does not support downloading file outside the web app folder to the client from the server. But the method Application.Download(Stream stream, string name) allow and work very well.

Why not WiseJ implement the Application.Download(string localFilePath, string name) look like this:

using System.IO;

public static void TheNewDownloadMethod(string localFilePath, string name = null)
{
   //try
   //{

       /// Need to check for null value of localFilePath, etc...

       FileInfo fiDownload = new FileInfo(localFilePath);

       /// Need to check for file exists, is local file, is allow to read, etc...

       if (name == null)
       {
           name = fiDownload.Name;
       }
       using (FileStream fileStream = fiDownload.OpenRead())
       {
           Application.Download(fileStream, name);
       }
   //}
   //catch (Exception ex)
   //{
   //    log.Error("Error in downloading file.", ex);
   //}
}

Hope this will make the question more clear.

I just wondering if this is correct or not, and should I (and every developers) need to do in this way when the program need to download a file by a file path (string).

 

Regards,

Felix CHAN

  • Felix CHAN answered Feb 7, 2017 - 3:04 pm
  • last active Feb 7, 2017 - 3:09 pm
0 votes

Hi Felix,

The reason is that the URL used to download the file can be modified to access other files outside of the app. It’s not easy but it’s possible. That why also other web frameworks don’t let a URL download anything outside of the application.

See this post: https://wisej.com/support/question/directory-traversal-security-issue

Best,

Luca

  • Luca answered Feb 7, 2017 - 2:22 pm
0 votes
In reply to: ReadOnly property

Got it. The Enabled property is inherited and allows you to enable/disable a container. The ReadOnly is specific. Some of the options could be to:

a) Modify the theme and change the disabled state, now it uses opacity to disable the entire control including child widgets;

b) Add a ReadOnly property to your containers (or add an extension method) and iterate the children of a container using a dynamic cast in a try/catch or using TypeDescriptor to get the “ReadyOnly” property.

HTH

Best,

Luca

  • Luca answered Feb 7, 2017 - 2:18 pm
  • last active Feb 7, 2017 - 2:18 pm
0 votes

Hi Frank,

Thanks. It works when I change the code and pass a Stream into it instead of a filePath.

However, what I am using is just a local file path, such as “D:\DocBase\SomeTestingFile.pdf”. It is located in the same machine of the web server. There is nothing related to external URLs.

Secondly, PDF Viewer works because its “path is directly provided by my application…”, but for this Download() operation, the filePath is also provided by my application.

I don’t understand the concern and reason behind. But in all, what I need to do is to code a block of code instead of one single line, as below.

//Application.Download(fiDownload.FullName, displayName);
try
{
    if (displayName == null)
    {
        displayName = fiDownload.Name;
    }
    using (FileStream fileStream = fiDownload.OpenRead())
    {
           Application.Download(fileStream, displayName);
    }
}
catch (Exception ex)
{
     log.Error("Error in downloading file.", ex);
}

Anyway, Thanks for the solution. I will continue to try converting an ERP from WVG into WiseJ.

Regards,
Felix CHAN

0 votes
In reply to: FullCalendar Extension

Hi Ben,

we are currently working on a sample. I’ll send you something in a few days.

Best

Thomas

0 votes
In reply to: ThemeBuilder Editor

Good suggestion. In fact we are discussing usability and will add this to the improvement list.

  • Luca answered Feb 6, 2017 - 8:39 pm
0 votes

Hi Luca,

Thanks for the code. But here is what I want to achieved relating to issued #4 in my original post.

I have an existing UserControl (ucGLCodes) with a DGV in it. It is used to display list of GL Accounts for CRUD operations. Following principle of reusability and DRY, instead of dropping a new DGV into the form that uses the UserComboBox control, I would just like to use that same UserControl as a DropDownControl. It displays the UserControl with the right width if I assign it to the DropDownControl property at design time but  I can’t make it to display when I am creating an instance of the UserControl from code. And it will only clutter the design surface of the form/window.

Is it by design not to assign a DropDownControl at runtime?

Also, from the attached sample and using at design time, if I press Tab to transfer control from “Column” to “Value” combobox in the UserControl, the dropdown closes automatically. Is there a way it can be prevented from closing?

Thanks.

 

  • Cris answered Feb 6, 2017 - 7:02 pm
1 vote
In reply to: OpenFileDialog

Hi Tung,

The FileDialog class is the base for OpenFileDialog and SaveFileDialog. They are all not available yet. Will be soon.

Best,

Luca

  • Luca answered Feb 6, 2017 - 5:53 pm
0 votes
In reply to: Screencast Sample

Hi Diego,

That was created just for the graphic designer. I’ll see what I can find that still survives. You can also use any of the examples here: https://wisej.com/examples/

Best,

Luca

  • Luca answered Feb 6, 2017 - 5:40 pm
1 vote
In reply to: ReadOnly property

Hi Luca,

Thanks for your answer. My “problem” is that I would like to show a form with various controls on it (textbox, datetimepicker, combobox, checkbox, groupbox, …) without allowing the user to do any changes. This is achieved with each control’s .Enabled = false, but the disabled controls are difficult to read as they are grayed out. That’s why I would like to have them all as ReadOnly, which, for TextBox and ComboBox at least, does not gray them out but effectively disables them.

Best,
Alex

0 votes
In reply to: ReadOnly property

Hi Alex,

Enabled and ReadOnly are treated differently. Enabled works for any control while ReadOnly is for editable controls and each editable control can be different (i.e. DataGrid or TextBox). There are base common classes when they share the base. In other words, ReadOnly in Control wouldn’t work.

You can read the property without having to cast using a dynamic object:

dynamic control = this.textBox1;

bool readOnly = control.ReadOnly;

Works regardless of the class. You get a binding error if the ReadOnly property is not found.

HTH

Best,

Luca

 

  • Luca answered Feb 6, 2017 - 5:23 pm
0 votes

Hi Kay,

The issue is probably Chrome: https://developers.google.com/web/updates/2016/04/geolocation-on-secure-contexts-only

FireFox doesn’t have that restriction. Basically you need to use https to use geolocation from a source that is not localhost.

Best,

Luca

  • Luca answered Feb 6, 2017 - 4:55 pm
0 votes

Hi Ser,

sorry for the delay in answering.

You can use Application.Browser.Device to detect the device type.

Possible values are Desktop, Mobile, Tablet.

Other properties are e.g. Application.Browser.OS etc.

Best regards
Frank

0 votes
In reply to: FavIcon

Hi Tung,

you can use standard html techniques to achieve this:

Either you add a favicon.ico to your projects resources to make it appear in the application web root
or add a reference to a favicon file in default.html if it is in a different graphic format.

Find more information here: https://en.wikipedia.org/wiki/Favicon

Best regards
Frank

0 votes
In reply to: ListView Grouping

Hi Tung,

please refer to our answer to your questions at: https://wisej.com/support/question/missing-features-of-the-listview

Best regards
Frank

0 votes

Hi Tung,

thanks, we have logged this bug as WJ-8006.

Best regards
Frank

0 votes

Hi Ralf,

thanks for your description and sample.

We have logged that issue as WJ-8007 and will inform you when it is fixed.

Best regards
Frank

Showing 9621 - 9640 of 11k results