datepicker

  

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

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();
}



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 :

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.

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.


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

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.

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.


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


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