Adding Existing Properties to new Widgets.

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
mpilo0
Profound User
Posts: 49
Joined: Wed Jan 08, 2014 11:49 am
First Name: Michael
Last Name: Pilote
Company Name: Oceanex
Phone: (514) 875-8558
State / Province: Quebec
Country: Canada
Contact:

Adding Existing Properties to new Widgets.

Post by mpilo0 »

Hi, Sorry for all the questions we are still making our first widgets from scratch.

We would like to know if it is possible to add existing properties (In my case the required validation) to new widgets.

Ex: We made a custom Date Picker that offered us a few more options that we needed, however the new Date Picker doesn't have the validations. I was wondering if it would be possible to change the controls of the required validation to add our widget to the list of controls.

Thanks again for your help!
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Adding Existing Properties to new Widgets.

Post by David »

Sorry for the late response, I was researching this.

Unfortunately, there is not a way to add properties from the pre-built widgets onto a custom widget. You get just the basic set of properties, plus any that you add on your own.
mpilo0
Profound User
Posts: 49
Joined: Wed Jan 08, 2014 11:49 am
First Name: Michael
Last Name: Pilote
Company Name: Oceanex
Phone: (514) 875-8558
State / Province: Quebec
Country: Canada
Contact:

Re: Adding Existing Properties to new Widgets.

Post by mpilo0 »

In that case, if we were to make our own property for the required, how would we plug ourselves into the validations that profound does before going back to the server?
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Adding Existing Properties to new Widgets.

Post by dieter »

Hello,
maybe we had a similar problem. We also wanted to improve the date field widget. In our case the users wanted that the date entry is automatically formatted when they are typing the date. We solved this problem by writing a little bit of Javascript
We wrote 3 Javascript functions which are bound to 3 events (onChange, OnKeyDown and OnKeyUp) on every datefield. The functions make an instant validation of the typed data. Because we created our own date widget by deriving the Profound date widget we don't have to bind the functions to the events manually.

Dieter
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Adding Existing Properties to new Widgets.

Post by dieter »

Here is an example of such a funktion:

//-----------------------------------------------------------------------------------------------------------
// Formatting the date while the user types it. This funktion usually is called by onkeyup event:
// The German date format is DD.MM.YYYY. E.g. 20.05.2014
//-----------------------------------------------------------------------------------------------------------
editDate : function(event, element) {

// if a digit is typed:
if (ecc.keyCode_isDigit(event.keyCode)){
if (element.value.length==2) {
element.value = element.value + ".";
}
if (element.value.length==5) {
element.value = element.value + ".";
}
}
},

Dieter
mpilo0
Profound User
Posts: 49
Joined: Wed Jan 08, 2014 11:49 am
First Name: Michael
Last Name: Pilote
Company Name: Oceanex
Phone: (514) 875-8558
State / Province: Quebec
Country: Canada
Contact:

Re: Adding Existing Properties to new Widgets.

Post by mpilo0 »

The problem is that those events already exist. We need to create a new widget because we are adding properties. We want the properties to only apply to the widget we are making. So we can't do it that way.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests