DateChooser selectableRange
All the documentation makes it very clear how to set a
specific "date start" to "date end" range in the DateChooser. But
how do I set the range from today (or whatever day 'today' is) to 3
months from now? In other words... the selectable range should
start on the present day and end in 90 days.
Many many thanks.
I agree Jim. I have copied and pasted it into multiple docs
and it works fine. I have used the clean project option as well
with no help. I have copy and pasted the piece in and out of it
with no results. Even if I try and define a variable as new Date it
wont fly. I am outta options. Do you have any thoughts?
Thanks for your response.
Jon
Similar Messages
-
DataProvider for each DataGridColumn
Hi, all
How can I give a dataProvider for each DataGridColumn?
Because I have an arrayCollection with arrays and each array will
be assigned to one dataGridColumn. But the problem is the value of
dataField are the same for all columns, so at the end I only got
the values from the last array for the whole dataGrid. By the way
the number of columns depends on the length of the arrayCollection
and it is dynamic.
How can I write a custom DataGridColumn for it?
Anybody got any ideas?
Thank you very much.I'm pasting the code I used. That's the best I can do for
you.
First is the main application:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
private function mouseIn( event:MouseEvent ) : void
trace("In: target="+event.target+";
current="+event.currentTarget+"; related="+event.relatedObject);
if( event.relatedObject == box.parent ) {
b1.visible = true;
b2.visible = true;
private function mouseOut( event:MouseEvent ) : void
trace("out: target="+event.target+";
current="+event.currentTarget+"; related="+event.relatedObject);
if( event.relatedObject == box.parent ) {
b1.visible = false;
b2.visible = false;
[Bindable] private var dp:ArrayCollection = new
ArrayCollection(
[ [1,2,3,4], [10,20,30,40], [100,200,300,400] ]);
]]>
</mx:Script>
<mx:VBox id="box" x="43" y="45" width="300" height="185"
horizontalAlign="center"
mouseOver="mouseIn(event)"
mouseOut="mouseOut(event)"
backgroundColor="#804040" verticalAlign="middle">
<mx:Button width="127" height="97" />
<mx:Button label="Button 1" id="b1" visible="false"/>
<mx:Button label="Button 2" id="b2" visible="false"/>
</mx:VBox>
<mx:DateChooser
selectableRange="{{rangeStart : new Date(2000,0,1),rangeEnd
: new Date()}}"
id="dateChoose" showToday="false"/>
<mx:DataGrid x="163" y="292" height="179" width="326"
dataProvider="{dp}">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="col1"
itemRenderer="components.forums.ArrayItemRenderer"/>
<mx:DataGridColumn headerText="Column 2" dataField="col2"
itemRenderer="components.forums.ArrayItemRenderer"/>
<mx:DataGridColumn headerText="Column 3" dataField="col3"
itemRenderer="components.forums.ArrayItemRenderer"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
This is the item renderer code:
package components.forums
import mx.controls.Text;
import mx.collections.ArrayCollection;
import mx.controls.DataGrid;
public class ArrayItemRenderer extends Text
public function ArrayItemRenderer()
super();
override protected function
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
super.updateDisplayList(unscaledWidth, unscaledHeight);
if( data )
var dp:ArrayCollection = (listData.owner as
DataGrid).dataProvider as ArrayCollection;
var colIndex:int = listData.columnIndex;
var rowIndex:int = listData.rowIndex;
var colArray:Array = dp.getItemAt(colIndex) as Array;
text = String(colArray[rowIndex-1]);
else text = "";
---------------------------- -
Setting selectableRange in DataChooser
problem in setting selectableRange, 1st selected date is
unselected after selecting another date, i dont know the reason
why it is happening and in this array
arrSelectedDates selected dates are adding properly but
dateRanges its showing wrong data.
1st selected value is disappearing and adding last selected
date 2 times @ 0th position (index) and @last position.
Can anyone tell me whats wrong in my code, and i want to to
deselect when i click on selectedDate and remove from
arrSelectedDates
and
dateRanges, check the code in debug mode.
main.mxml
[code]
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns:ns2="myComponents.*">
<ns2:CalendarDemo width="214" height="228">
</ns2:CalendarDemo>
</mx:Application>
[/code]
CalendarDemo.mxml
[code]
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
width="192" height="198">
<mx:Script>
<![CDATA[
import mx.formatters.DateFormatter;
private var dateRanges:Array = [];
private var arrSelectedDates:Array = new Array();
private function SetSelectableRange():void
var startDate:Date = new Date();
dcHoliday.selectableRange = {rangeStart:new Date(startDate),
rangeEnd:new Date((startDate.fullYear+1), startDate.month,
startDate.date)};
private function dcHolidayChange():void
if(dcHoliday.selectedDate != null)
var selDate:Date = new Date( dcHoliday.selectedDate );
var sDateObject:Object = { rangeStart:selDate,
rangeEnd:selDate };
dateRanges.push( sDateObject );
dcHoliday.selectedRanges = dateRanges;
var tempDate:String = myDateFormat(
dcHoliday.selectedDate,"YYYY-MM-DD" );
if(arrSelectedDates.length == 0)
arrSelectedDates.push(tempDate);
else
var cnt:int = 0;
for(var i:int = 0; i < arrSelectedDates.length; i++)
if( arrSelectedDates
== tempDate)
cnt = cnt + 1;
if(cnt <= 0)
arrSelectedDates.push(tempDate);
private function
myDateFormat(date:Date,strDateFormat:String):String
var fDate:String;
var mydf:DateFormatter = new DateFormatter();
mydf.formatString = strDateFormat;
return fDate = mydf.format(date);
]]>
</mx:Script>
<mx:DateChooser id="dcHoliday" x="10" y="10"
cornerRadius="2" visible="true"
change="dcHolidayChange();"
creationComplete="SetSelectableRange();"/>
</mx:Canvas>
[/code]
Thanks in advancein ur autoexec.bat file write the following
set PATH=C:\jdk1.5.0_04\bin;%PATH%
set JAVA_HOME=C:\jdk1.5.0_04
set
CLASSPATH=.;C:\jakarta-tomcat-5.5.9\common\lib\servlet
-api.jar;C:\jakarta-tomcat-5.5.9\common\lib\jsp-api.ja
r;C:\Servlets+JSP;..;..\..;C:\jakarta-struts-1.2.4\lib
\struts.jarThis response is meaningless. Principally because the OP specifically mentioned the use of LINUX. Not Windows.
I've taken the advice of other forum users by avoiding a system level classpath variable. I define the classpath each time I compile and run. Working on Linux I tend to use command line argument files ( http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html#commandlineargfile ) which eliminates the need to redefine the classpath each time I compile or run my classes and apps. But others may do things differently.
Here is a website you might want to check out which pertains to setting the classpath on Solaris and Linux.
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html -
Selectable ranges in datechooser from database
Hi guys!
I got a problem, I'm trying to set ranges in a datechooser. The code I use is this:
<mx:DateChooser horizontalCenter="0" bottom="0" top="0" width="75%" id="calendario_desde" creationComplete="fecha_desde_inicio()"/>
protected function fecha_desde_inicio():void
fecha_desde.token = database.fecha_desde();
anio= fecha_desde.lastResult.valor1;
mes = fecha_desde.lastResult.valor2;
dia = fecha_desde.lastResult.valor3;
dRanges.push({rangeStart:new Date(anio,mes,dia), rangeEnd: new Date (2011,2,1)});
calendario_desde.selectableRange = dRanges;
Could you tell me what's wrong?
ThanksDateChooser.selectableRange accepts an object having startRange and endRange properties. In your version, you give it an array! containing an object containing the 2 properties
try this:
protected function fecha_desde_inicio():void
fecha_desde.token = database.fecha_desde();
anio= fecha_desde.lastResult.valor1;
mes = fecha_desde.lastResult.valor2;
dia = fecha_desde.lastResult.valor3;
var range:Object = new Object();
range.rangeStart = new Date(anio,mes,dia);
range.rangeEnd = new Date (2011,2,1);
calendario_desde.selectableRange = range;
or this :
protected function fecha_desde_inicio():void
fecha_desde.token = database.fecha_desde();
anio= fecha_desde.lastResult.valor1;
mes = fecha_desde.lastResult.valor2;
dia = fecha_desde.lastResult.valor3;
calendario_desde.selectableRange = {rangeStart : new Date(anio,mes,dia), rangeEnd : new Date(2011,2,1)}; -
How to set background color for selected days in DateChooser
How to set background color for selected days. I created
checkbox for each day [Son,Mon,Tue,Wed,Thu,Fri,Sat] and a
DateChooser, I want to change the background color for the selected
day when i click on a button after selecting the desired checkboxs
[ monthly wise/yearly wise]
Thanks in advanceThere is no button involved in the following code, but it may
be of use to you:
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:Script>
<![CDATA[
private var origColor:uint;
private function init():void {
origColor = dc.getStyle("selectionColor");
public function setBackGrdColors(newColor:uint):void {
dc.setStyle("selectionColor", origColor);
if(dc.selectedDate){
var dayOfWeek:Number = dc.selectedDate.day;
else{
return;
switch(dayOfWeek) {
case 0:
if(sun.selected)
dc.setStyle("selectionColor", newColor);
break;
case 1:
if(mon.selected)
dc.setStyle("selectionColor", newColor);
break;
case 2:
if(tue.selected)
dc.setStyle("selectionColor", newColor);
break;
case 3:
if(wed.selected)
dc.setStyle("selectionColor", newColor);
break;
case 4:
if(thu.selected)
dc.setStyle("selectionColor", newColor);
break;
case 5:
if(fri.selected)
dc.setStyle("selectionColor", newColor);
break;
case 6:
if(sat.selected)
dc.setStyle("selectionColor", newColor);
break;
default:
break;
]]>
</mx:Script>
<mx:VBox horizontalAlign="center" verticalGap="20">
<mx:DateChooser id="dc" textAlign="left"
change="setBackGrdColors(cellColor.selectedColor)"/>
<mx:HBox width="100%" horizontalAlign="center">
<mx:CheckBox id="sun" label="Sun"/>
<mx:CheckBox id="mon" label="Mon"/>
<mx:CheckBox id="tue" label="Tue"/>
<mx:CheckBox id="wed" label="Wed"/>
</mx:HBox>
<mx:HBox width="100%" horizontalAlign="center">
<mx:CheckBox id="thu" label="Thu"/>
<mx:CheckBox id="fri" label="Fri"/>
<mx:CheckBox id="sat" label="Sat"/>
</mx:HBox>
<mx:HBox width="300" horizontalAlign="center">
<mx:Label text="Background Color" />
<mx:ColorPicker id="cellColor"
selectedColor="#FF00FF"/>
</mx:HBox>
</mx:VBox>
</mx:Application> -
Hi,
I am facing problem while using datechooser in flex.
I have an array which contains five dates.I am using this array in a function and this function will call when i click the buttons,previous button and next button.I just want to change the fontFamily or underline a particular date in datechooser for the correponding date which comes in the array while clicking the buttons.
please help meHi,
I am facing problem while using datechooser in flex.
I have an array which contains five dates.I am using this array in a function and this function will call when i click the buttons,previous button and next button.I just want to change the fontFamily or underline a particular date in datechooser for the correponding date which comes in the array while clicking the buttons.
please help me -
Does anybody know how to get the DateChooser in Flex to read
from an XML file containing all my events for a particular date.
Seems no body has a clue.. I'm so tired of looking. Can anybody
help me. I am new to flex, but I like the calendar function, it
simple and it's 50% completed. I just need to know how to get my
data connected to it..
Thanks to anyone who cna help.........hi again, here is an example:
<mx:application>
<mx:Script>
<![CDATA[
// Event handler function to write the selected
// date to the Label control.
private function displayDate(date:Date):void {
if (date == null)
selection.text = "Date selected: ";
else
selection.text = "Date selected: " +
date.getFullYear().toString() +
'/' + (date.getMonth()+1).toString() + '/' + date.getDate();
Alert.show(myxml.myevent.@date=date.selection.text);
]]>
</mx:Script>
<mx:XML id="myxml">
<agenda>
<myevent date="17/08/2007" Task="Programming Flex"
></myevent>
<myevent date= "18/08/2007" Task="Deliver Flex
Application"></myevent>
</agenda>
</mx:XML>
</mx:application>
this should do it, don't forget to point to this function o n
change event of the datechooser. -
Im a beginner with Flex.
How do I connect an external xml to a DateChooser so every
time a date is picked a value/or text (different for different
dates) from the xml is passed into a textArea.
In this case I want a value of "50" to be passed to the the
textArea for every day of the week exept for saturdays surtain
months when the value is "80".
Please show with whole code since I'm rather new to this.
Thanks in advance!Hope he following sample helps !
quote:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="vertical">
<mx:XMLList id="statusData" >
<day name="Saturday" value="10" />
<day name="Sunday" value="20" />
<day name="Monday" value="30" />
<day name="Tuesday" value="40" />
<day name="Wednesday" value="50" />
<day name="Thursday" value="60" />
<day name="Friday" value="70" />
</mx:XMLList>
<mx:Script>
<![CDATA[
private var weekDayNames =
[ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday" ];
]]>
</mx:Script>
<mx:DateChooser id="dateChooser" />
<mx:TextInput id="status"
text="{statusData.(@name ==
weekDayNames[dateChooser.selectedDate.getDay()]).attribute('value').toString()}"/>
</mx:Application> -
DateChooser Component for Flash CS3, AS3.0
Where and how do I get the datechooser for Flash CS3, AS3.0?
which version of flash cs3 do you have?
-
Can you customise DateChooser to select a week, instead of day?
hey guys, so quick weird question, im trying to create a calender type thing for my application where if the user clicks on a given day it selects that week, and then changes that given panel to have a group of information?
so i basically need to change the "DateChooser" to when you hover over a date, the entire week highlights, and if you click on that week it gives you an array of the days in the week.
any ideas??
thank you in advanceahh, i went through your blog, thank you
i actually started out with the following code, it seems to be working... i basically have the week highlited... i was wondering if there is a way i could possibly animate the dateChooser, where if the user selects the week, everything gets minimised and the week kinda floats to the top of the app, and then the user would be able to click on each date individually, at which time i would display a form right below the week...
i hope im making sense... its going ot be sort of like a scheduler, but for a different purpose
thanks you alex for the quick response
<s:HGroup height="100%" width="100%">
<s:Group height="100%" width="100%">
<mx:DateChooser width="100%" height="100%" change="selectWeek(DateChooser(event.target))" />
</s:Group>
</s:HGroup>
public function selectWeek(calendar:DateChooser) :void
var sd:Date = calendar.selectedDate
var dayUTC:Number = 86400000;
// check if sunday (first day of civil week)
var sd_sun:Date = sd;
if (sd.day != 0)
sd_sun = new Date(sd.valueOf() - sd.day * dayUTC);
var sd_sat:Date = new Date(sd_sun.valueOf() + 6 * dayUTC);
calendar.selectedRanges = [{rangeStart: sd_sun, rangeEnd: sd_sat}]; -
Using today's date in selectableRange of dateField
i'm having issues with the dateField component. i would like
to dynamically specify today's date as the rangeEnd of the
selectableRange, but i can't seem to get it to work.
can someone show me how to create a dateField component that
does not allow you to select a date in the future?It was working for me before. I didn't create the instance
using the UIObject method - it was just in the authoring
environment.
Don't ask me why this is necessary, but I think it will do
what you want. You may want to take away the +1 if you just want it
to be today. At the moment it includes tomorrow. -
mx:DateChooser Setting StartRange and EndRange
Hello,
I have <mx:DateChooser and I need to set a start range and
end range for my date chooser, how can I set this?
I have the starting range and ending range in string
variables, but I am not sure how to pass this to the
<mx:DateChooser
Any help is highly appreciable.
ThanksHi,
That example didn't help my query
http://blog.flexexamples.com/2008/07/24/toggling-year-navigation-on-a-datechooser-control- in-flex/
Someone could help?
Thanks -
Flash DateChooser - Changing the days the component pulls from
I am using the DateChooser component.
What I want is for the dateChooser to build itself based on
the SERVER date, not the user's computer date.
For example, if the date on the user's computer is May 19,
2006, the DateChooser automatically sets the current date.
I have successfully made the DateChooser choose the selected
date based on the server using a little PHP and a Flash Remoting
Service called amfphp, but now I have another prediciment: What
about the actual day of the week, and the days in that month?
The DateChooser in Flash knows it's a leap year or not based
on the user's computer time. But my software needs the date to be
perfect - there can't be any mistakes.
I guess what I'm getting to is I wish the DateChooser had
something like a "source date info" property - where you could push
all the months, and number of days in each month, etc... to it.
Unfortunetly, I am going to have to build a whole component
to tackle this issue.
Anyone built a good one already?I am using the DateChooser component.
What I want is for the dateChooser to build itself based on
the SERVER date, not the user's computer date.
For example, if the date on the user's computer is May 19,
2006, the DateChooser automatically sets the current date.
I have successfully made the DateChooser choose the selected
date based on the server using a little PHP and a Flash Remoting
Service called amfphp, but now I have another prediciment: What
about the actual day of the week, and the days in that month?
The DateChooser in Flash knows it's a leap year or not based
on the user's computer time. But my software needs the date to be
perfect - there can't be any mistakes.
I guess what I'm getting to is I wish the DateChooser had
something like a "source date info" property - where you could push
all the months, and number of days in each month, etc... to it.
Unfortunetly, I am going to have to build a whole component
to tackle this issue.
Anyone built a good one already? -
DateChooser with multiple highlight dates
Hi
I have some problem with DateChooser in Flex 4. I override mx.DateChooser class like in this example: http://flexpearls.blogspot.com/2008/03/ … -for.html, but now i can't see month and year navigation buttons. They are there but i can't see them.
This is mine class:
http://www.sendspace.pl/file/be2b9bed89ea2126733c0f6
Have you any ideas what i'm doing wrong or why it doesn't work?I burned the disk using the Burn button in iPhoto as you described. But I couldn't import into my iMac because the iMac is running 4.0.3 -- an older version of iPhoto than that on the PowerBook (5.something).
I don't have the install CDs for the newer version (the powerbook is a work computer and my employer's IS department had installed that version on that machine). So short of buying my own upgrade of iLife, is there another way to deal with these 20 or so rolls?
-Paul
I have burned
all of those photos & folders from the PowerBook onto
a CD
How did you burn the disk? If you used the Burn
button in iPhoto you should be able to mount the CD
on the destination disk, launch iPhoto and have the
disk show up in the Source window directly under the
Library icon. Then just expand the CD icon, select
the roll(s) and drag onto the Library icon. That
will copy those rolls, and all associated info into
the library. Here's what it should look like.
If you didn't use the Burn button you might try
re-burning the disks with the Burn button. Another
option is two use the paid version of iPhoto Library Manager, connect the
two computer together and merge/copy the rolls from
one library to the other.
G4 DP-1G, 1G RAM, 22 Display, 2-80G
HD, QT 7.0.3P Mac OS X (10.4.3) Canon
S400, i850 & LIDE 50, Epson R200, 2G Nano
iMac G4 Mac OS X (10.4.2) -
Showing 2 months in a DateChooser control?
I am working on an e-reservation application and need to be
able to span 2 months with a selection. The industry standard way
of being able to do this is to make 2 months at a time visible to
the user. See
https://reservations.ihotelier.com/istay.cfm?hotelid=6921 for an
example of how other developers have done it.
My question is , is there any possible way to do this with
the DateChooser control or do i need to write something from
scratch in as3?
Thanks!The DateChooser does not allow showing more than one month.
Your example was custom-coded.
Maybe you are looking for
-
Hi can anyone help me! I'm unable to see my mail. Next to the inbox account name it shows i have new mail but i'm not able to see them. When i try i just get the spinning sign for a while and then the sign goes away that tells me i have mail. Also i
-
I have an Apple ID with a single e mail address. I want to set multiple addresses in the same ID. Can I? If so how?
-
8.1.1 mail doesn't work anymore
Hello All ! I did the ios 8.1.1 update yesterday evening on my iPad Air-2. I configured my Exchange Mail the same way as my iPad Air. Now, I can't receive any mail. I have the same problem for Outlook and Gmail. Only my iCloud is working. Do you know
-
(Camera icon)
-
How to define function within for loop pls help?????
Hi this is the problem i have a class, and within that class there is an actionPerformed function, in this class i also create an instance of another class, this other class also contains an actionPerformed function, which wis executed if a jButton h