2155
Views
10
Comments
datepicker
Question

Hi Outsystems,

can i trigger the datepicker from a button, the datepicker is bounded to the textinput widget,

is there way to trigger it also from a button or container?  i want to trigger on this controls 

(please see red arrow.)



Thanks,

Julius

UserImage.jpg
Davidk

Yes... you can call the .click() event of the Input Widget the Calendar is attached to.  I'll assume this is for Web.

E.g. I have an Input Widget named InputCal.  My button is set up like this...

Here you're calling a Javascript function named clickCal and passing in your Input Id as a parameter.

In your Screen Javascript property you'll have this code...

SyntaxEditor Code Snippet

function clickCal(inputId){
    document.getElementById(inputId).click();
}



2022-10-20 02-09-39
JeffT

JULIUS DELORINO wrote:

Hi Outsystems,

can i trigger the datepicker from a button, the datepicker is bounded to the textinput widget,

is there way to trigger it also from a button or container?  i want to trigger on this controls 

(please see red arrow.)



Thanks,

Julius

Hi Julus ,

 Yes you can , you just have to assign Id of button in ButtonwidgetId property of Calendar (Silk UI widget) .

Here is a screenshot :

2017-09-11 16-45-17
JULIUS DELORINO

Rocky wrote:

JULIUS DELORINO wrote:

Hi Outsystems,

can i trigger the datepicker from a button, the datepicker is bounded to the textinput widget,

is there way to trigger it also from a button or container?  i want to trigger on this controls 

(please see red arrow.)



Thanks,

Julius

Hi Julus ,

 Yes you can , you just have to assign Id of button in ButtonwidgetId property of Calendar (Silk UI widget) .

Here is a screenshot :

Hi Rocky

thanks for your reply, i want to trigger the date picker which is bound to textinput widget from clicking a button.


UserImage.jpg
Davidk

Althought Julius didn't specify... I thought he wanted to display the calendar from both a click in the Input Widget and a Button click - both.

When I assign a value to the ButtonWidgetId the calendar now only displays on the button click.  The value selected goes into the Input control, but clicking the Input control no longer displays the calendar.

Further, depending on the Theme selected you may have a choice of 2 Calendars.  If a SilkUI Theme is selected, e.g. Dublin, then you get an Input Calendar Widget and a Calendar Widget.  The Calendar Widget is based on a plugin named "Pikaday".  This Widget has no issues and works as described above... where you get a Calendar on the click of the Input Widget or the Button Widget (if you have that set up).

The Input Calendar Widget seems to have a bug when you set its property for ButtonWidgetId.  When you click the Button, you see the Calendar popup briefly, then the page goes bad.  I've reported this behaviour to OutSystems.  I'm using Dev. Version 10.0.717.0.

2017-09-11 16-45-17
JULIUS DELORINO

Davidk wrote:

Althought Julius didn't specify... I thought he wanted to display the calendar from both a click in the Input Widget and a Button click - both.

When I assign a value to the ButtonWidgetId the calendar now only displays on the button click.  The value selected goes into the Input control, but clicking the Input control no longer displays the calendar.

Further, depending on the Theme selected you may have a choice of 2 Calendars.  If a SilkUI Theme is selected, e.g. Dublin, then you get an Input Calendar Widget and a Calendar Widget.  The Calendar Widget is based on a plugin named "Pikaday".  This Widget has no issues and works as described above... where you get a Calendar on the click of the Input Widget or the Button Widget (if you have that set up).

The Input Calendar Widget seems to have a bug when you set its property for ButtonWidgetId.  When you click the Button, you see the Calendar popup briefly, then the page goes bad.  I've reported this behaviour to OutSystems.  I'm using Dev. Version 10.0.717.0.

Hi Davidk,

that i correct i want to trigger the calendar widget from Textinput click event, i don't want to maintain 2 calendar widgets, i need the value of it to be pass to the database. the trigger should come from the both of the highlighted

controls or widgets, currently the calendar is bounded to text input.

Dev. Env.


Thanks,

Julius

UserImage.jpg
Davidk

Since you want to trigger the calendar from both the Input Widget and Button Widget, then the process I posted using Javascript to call the Input click event will work well.

2017-09-11 16-45-17
JULIUS DELORINO

Davidk wrote:

Since you want to trigger the calendar from both the Input Widget and Button Widget, then the process I posted using Javascript to call the Input click event will work well.

hi Davidk,

i hjave dont that already, but it's not triggering the calendar widget.


UserImage.jpg
Davidk

Here's an oml that has both Calendar Widgets and a button for each.


CalendarButtonTest2.oml
UserImage.jpg
Davidk

Here is the same oml again, with a Link Widget firing the client event of an Input Widget which is tied to a Calendar.

CalendarButtonTest2.oml
2024-12-02 12-15-17
Aravind EONE

JULIUS DELORINO wrote:

Hi Outsystems,

can i trigger the datepicker from a button, the datepicker is bounded to the textinput widget,

is there way to trigger it also from a button or container?  i want to trigger on this controls 

(please see red arrow.)



Thanks,

Julius

Hi JULIUS DELORINO,

There is button widget ID option is available.

you can add a name for that button and then give that name.ID in button widget ID option available in datepicker options.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.