royale-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ent <>
Subject Re: Convert s:DateChooser to js:DateChooser
Date Wed, 25 Oct 2017 14:29:14 GMT
Hi Doug,

I'll try and answer your questions in-line, below. In Royale, a "bead" add
functionality or a visual component to another component. Some components
are actually composites made from other components. DateChooser is like
that: the DateChooserHeader and DateChooserList are themselves components
with beads. A bead would be more like the Password bead that you can add
to a TextInput component which intercepts your keystrokes and replaces
them with "*".

As you'll see from my answers in-line, I have a couple of things to check
for you. But the Royale DateChooser should be serviceable for you right
now and it needs a little more work to come up to par with the Flex

Peter Ent
Adobe Systems/Apache Royale Project

On 10/25/17, 4:19 AM, "doug777" <> wrote:

>I have a DateChooser that looks like this
><s:DateChooser id="dcCal1"
>		headerColors="[0xdee7f6, 0xacc9f6]"
>		showToday="false"
>		contentBackgroundColor="0xffe189"
>		selectionColor="0x83fc61"
>		change="dateChangeEventHandler(event)"
>		valueCommit="cbChangeEventHandler(event)"
>		scroll="dateFieldScrollHandler(event)"/>
>Taking the attributes one by one
>headerColours - Do I set the CSS background-color style on the
>DateChooserHeader bead? Is there now any easy way to set a color gradient
>do I have to create and set a background-image?

You are correct that you need to set the style on the DateChooserHeader
(it is not a bead, but a component in its own right). Right now we do not
have a gradient background bead. We also do not support a background image
yet on the SWF platform; it should work for the HTML platform although I
have not tried that. If you can set gradient colors in CSS (not an expert
in this, I'm afraid), then that might work, too.
>showToday - Presumably this is not set in flexjs so I can omit this, but
>when I want to set it later in actionscript, is there an easy way to do

We haven't written any way to distinguish "today" from any other
selection. This, to me, is a gray area in terms of pay-as-you-go.
Presumably, most DateChoosers would want to show "today" and if that's the
case, the functionality would be built in. But if most DateChoosers would
not do that, then the pay-as-you-go philosophy would have it as a bead
that would make it happen just for those DateChooser instances that
require it.
>contentBackgroundColor - Do I set the CSS background-color style on the
>DateChooserList bead?

Yes - set the background color for DateChooserList (also, not a bead but a
>selectionColor - How do I set this?

Not sure - its been awhile since I looked at that code and will have to
get back to you. 
>change - I guess I just set this in the main tag or do I have to set it on
>the DateChooserList bead?

You put the change event handler on the DateChooser itself, just like with
Flex. In general, events that sub-components or beads issue are dispatched
by the main component (strand) itself so there is one central place to
listen for events. Sometimes events internal to the function of the
component are dispatched on some other part and then transformed and
dispatched off the strand.
>valueCommit - Previously the change event fired only on user changes.
>valueCommit event was needed for programmatic changes. If the js change
>event works the same way as before, how do I set a valueCommit event?

I don't think we are issuing valueCommit events in Royale; I'll have to
check on that, too.
>scroll - I only want this event to fire when the Next/Previous Month
>are clicked. Do I set the click event on the DateChooserButton bead to
>achieve this? Presumably the click event on the main tag affects the whole
>calendar, but it looks as though the DateChooserButton is just for the
>header buttons - is that right?

I'm pretty sure no events are being dispatched when the month changes. I
think it should and this would be a bug, IMO.
>Can anyone say whether I'm right or wrong on each point and give some
>pointer as to which direction I should take to solve the issues.
>Sent from: 

View raw message