Developer forum

Forum » Development » Using the IntegerNumberParameterEditor

Using the IntegerNumberParameterEditor

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

We have a custom BatchIntegrationScheduledTaskAddin with public integer properties to control some internal stuff. To make these editable we've defined the properties as follows:

[AddInParameter("Property 1")]
[AddInParameterEditor(typeof(IntegerNumberParameterEditor), "NewGUI=true;")]
public int Property1Parameter { get; set; }

When we load the tasks, the UI shows up and we can enter values. However, when we reopen the task or run it, these values are always zero. We tried nullable ints but that didn't work either.

As soon as we change the type of the property to a string and use the TextParameterEditor, it works.

Is there an issue with the IntegerNumberParameterEditor? We can make it work with the text version and string properties, but it means additional work on our end to parse the values properly. We're testing this on 8.9.x

Thanks!

Imar


Replies

 
Viktor Letavin
Reply

Hi Imar,

I don't think the problem is in IntegerNumberParameterEditor. I've jsut checked and it works - https://www.screencast.com/t/ExtPN51EV6s

I even tried to reproduce issue with changing existing batch integration task with adding editor the way you do - and everything works still - https://www.screencast.com/t/fM11ocpAuN

 

So it is more likely on your side.

BR, Viktor.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Viktor,

That's not what I am seeing when create a scheduled task. I have uploaded a video here: https://www.screencast.com/t/EGrBEXtfJ

It shows that when the job is run, the integer value is 0, not the value I entered when creating the task. Also, when reopening the task it's zero which seems to indicate it's not saving the value to the task.

I attached the source code that I used to repro this. Can you take another look please?

Note: my video is showing Dynamicweb 9, but the same issue exists on 8.

Imar

 
Viktor Letavin
Reply
This post has been marked as an answer

Hi Imar,

seems like dw8.9.1 have no problems, but in dw9.2 I've reproduced the problem - https://www.screencast.com/t/RjvXb1Jzg

Bug # 30991 is created to fix the issue.

P.S. if you duplicate property name in addinParameter then during execution you will be able to get integer value
        [AddInParameter("IntParam")]
        [AddInParameterEditor(typeof(IntegerNumberParameterEditor), "allowNegativeValues=false;NewGUI=true;")]
        public int IntParam { get; set; }

BR, Viktor.

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Great; thanks Viktor!

Imar

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Imar

The problem TFS#30991 "IntegerParameterEditor not saves values" has now been fixed in 9.3+ versions

You are able to find this build in the download section:

http://doc.dynamicweb.com/releases-and-downloads/releases

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum