Date Widget

Use this board to ask questions or have discussions with other Rich Displays users.
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Date Widget

Post by Paul_Ramcharitar »

Hi scott, how do I go about preventing the default action?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Date Widget

Post by Scott Klement »

We provide an API for this:
http://www.profoundlogic.com/docs/displ ... +event+%29

However, you need to pass the event object to it. In the newest release, we've created a global variable for the event object, but in previous releases it wasn't always available.
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Date Widget

Post by Paul_Ramcharitar »

preventEvent didn't work (in the mobile client). I put it in the onlick on the widget, like so:

Code: Select all

setTimeout( function() { pui.showCalendar("Date1"); }, 0 );
preventEvent(event);
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: Date Widget

Post by David »

What version of Profound UI are you using?

Also, when you say it doesn't work, do you mean to say that the default event action is just not prevented, or is some error reported?
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Date Widget

Post by Paul_Ramcharitar »

version : 4.7.1

I have this set in the onclick of an image widget:

Code: Select all

pui.showCalendar("Date1");
preventEvent(event);
It works in the browser (the calender pops up), so I assume the default action is prevented, but it does not work in the profound ui mobile client. When I tap on the image nothing happens.
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: Date Widget

Post by David »

Thanks. If you have 4.7.1, it should work, as the 'event' variable was only added to the widget event properties in that release.

It must be some issue with running it in the mobile client. Can you please contact our technical support team and:

1. Send a copy of your display source code. You can use File->Save As and then the Local tab to save it to your PC.

2. Let us know what specific device and OS version you are running the mobile client on.

We can then test with the screen here to see if we can reproduce and correct the problem.
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Date Widget

Post by Paul_Ramcharitar »

Thanks David. I sent a email with the details and source code.
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: Date Widget

Post by David »

Thanks, we'll have a look. In the meanwhile, an alternative might be to use the device's built-in date picker. To do that, you could just use a normal textbox and set 'input type' to 'date'. This will bring up the device's built-in date picker anytime the user puts the cursor into the text box.

If you wanted to still have a separate image they can tap on to show it, you could just focus in the box with this code when clicking on the image.

Code: Select all


getObj("Date1").focus();

Of course, we will try to determine what is going wrong with the PUI date picker in this case, but this might get you going in the meanwhile.

The device's built-in picker might also be a bit more 'finger friendly'. Maybe that was the motivation for them to tap on a separate image to begin with?
Paul_Ramcharitar
Profound User
Posts: 91
Joined: Fri Aug 03, 2012 11:07 am
First Name: Paul
Last Name: Ramcharitar
Company Name: Banks DIH
City: Georgetown
Zip / Postal Code: 592
Country: Guyana
Contact:

Re: Date Widget

Post by Paul_Ramcharitar »

Hi thanks. Yes my problem was the pui datepicker not being finger friendly in mobile devices. The built in date picker is a great solution. But can I change the format the date is returned in? Right now it returns this format: "mm/dd/yyyy". I would like it in this format: "yyyy-mm-dd"
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: Date Widget

Post by David »

What type of field are you binding to the 'value' of the text box? If you use a date field, it will simply be returned as a date value. I'm guessing that you are not using a date field, if the format is coming into play? If you need to store dates in a different type of field, you could date fields in the display file, and then use %Char() in your RPG program to convert them to character, and then %Dec() to convert to numeric, if you are storing it that way.

Does that help?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest