Re: [flexcoders] Re: Data Binding Issue

2007-03-26 Thread Tom Chiverton
On Friday 23 Mar 2007, madhukiranm wrote:
mx:Tile  id=chkTile  
mx:Repeater id=chkRepeater dataProvider={dataItems}
  mx:CheckBox id=chkCheckBox
 selected=selectedItems.contains(chkRepeater.currentItem)

Not
selected={ selectedItems.contains(chkRepeater.currentItem) }
?

-- 
Tom Chiverton
Helping to advantageously seize frictionless materials
On: http://thefalken.livejournal.com



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 


[flexcoders] Re: Data Binding Issue

2007-03-26 Thread madhukiranm

Hi,

My Requirement is the developer can either pass a list of selected items
or not. If he does, then I need to select the check boxes after it's
creation. That's the reason I have the code:

  selected={ selectedItems.contains(chkRepeater.currentItem) }

which will select the checkboxes if there were any in the
selectedItems

Hope this helps..

Thanks,

Madhu


--- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED]
wrote:

 On Friday 23 Mar 2007, madhukiranm wrote:
  mx:Tile id=chkTile 
  mx:Repeater id=chkRepeater dataProvider={dataItems}
  mx:CheckBox id=chkCheckBox
  selected=selectedItems.contains(chkRepeater.currentItem)

 Not
 selected={ selectedItems.contains(chkRepeater.currentItem) }
 ?

 --
 Tom Chiverton
 Helping to advantageously seize frictionless materials
 On: http://thefalken.livejournal.com

 

 This email is sent for and on behalf of Halliwells LLP.

 Halliwells LLP is a limited liability partnership registered in
England and Wales under registered number OC307980 whose registered
office address is at St James's Court Brown Street Manchester M2 2JF. A
list of members is available for inspection at the registered office.
Any reference to a partner in relation to Halliwells LLP means a member
of Halliwells LLP. Regulated by the Law Society.

 CONFIDENTIALITY

 This email is intended only for the use of the addressee named above
and may be confidential or legally privileged. If you are not the
addressee you must not read it and must not use any information
contained in nor copy it nor inform any person other than Halliwells LLP
or the addressee of its existence or contents. If you have received this
email in error please delete it and notify Halliwells LLP IT Department
on 0870 365 8008.

 For more information about Halliwells LLP visit www.halliwells.com.





Re: [flexcoders] Re: Data Binding Issue

2007-03-23 Thread Tom Chiverton
On Friday 23 Mar 2007, madhukiranm wrote:
 Thanks for the replyI tried the one you suggested, but binding
 doesn't seem to work.

Guess you'll have to post your code then :-)


-- 
Tom Chiverton
Helping to administratively entrench interactive convergence
On: http://thefalken.livejournal.com



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 


[flexcoders] Re: Data Binding Issue

2007-03-23 Thread madhukiranm

Hi Tom,

Here is the code for the custom component. It contains two arraylists.
dataItems and selectedItems. dataItems is the complete set of list for
which the check boxes should be generated. selectedItems is the list
which has the items (checkboxes) to be selected. The user will send a
list of completeList of items (dataItems) and a selected list of items
from the main MXML.

//Code for the Custom Component

?xml version=1.0 encoding=utf-8?
mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml
http://www.adobe.com/2006/mxml  width=100% autoLayout=false
horizontalScrollPolicy=off verticalScrollPolicy=off
creationComplete=initComp() 

  mx:Script
   ![CDATA[
import mx.collections.ArrayCollection= new ArrayCollection();


[Bindable]
public var dataItems:ArrayCollection = new ArrayCollection();

[Bindable]
public var selectedItems:ArrayCollection;


   ]]
  /mx:Script
   mx:Tile  id=chkTile  
   mx:Repeater id=chkRepeater dataProvider={dataItems}
 mx:CheckBox id=chkCheckBox
selected=selectedItems.contains(chkRepeater.currentItem)
  label={chkRepeater.currentItem.label} styleName=glass 
uid={chkRepeater.currentItem.value} /
   /mx:Repeater
  /mx:Tile
/mx:Canvas

//Code for the Main MXML

?xml version=1.0 encoding=utf-8?

mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute creationComplete=initComp() xmlns:view=view.*

mx:Script

![CDATA[

import mx.collections.ArrayCollection;

[Bindable]

private var completeList:ArrayCollection = new ArrayCollection();



[Bindable]

private var selectedList:ArrayCollection;



private function initComp(){

//Assume that I will get a list of Items (checkBoxes in this case) to be
created

completeList = ..

}

]]

/mx:Script

view:MultipleOptionsCheckBoxView dataItems={completeList}
selectedItems={selectedList}/

/mx:Application

I am binding completeList to dataItems and selectedList to
selectedItems. My ultimate goal is, if the developer passes a list of
selectedList then the checkboxes should be selected (after creation)
based on the items the developer passed. If the developer doesn't pass
anything, then when ever a user selects a list of items, they should be
available to the developer in the local variable selectedList (as there
is a binding). I think you understoood my requirement. Everything works
fine for me except when the selectedList (local variable in the
Main.mxml) is not initialized. If I initialize this local variable, then
the binding works fine (both sides). If I have a list of selectedList,
then also the binding works. The only problem is when the selectedList
is null. If I initialize the variable in the custom component (when it
is null) the binding fails. I dont want to use mx:Binding tag (which
also works fine in all situations)...

Let me know if I miss anythingor confused you a lot..

Once again, thanks for your help

Madhu
--- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED]
wrote:

 On Friday 23 Mar 2007, madhukiranm wrote:
  Thanks for the replyI tried the one you suggested, but binding
  doesn't seem to work.

 Guess you'll have to post your code then :-)


 --
 Tom Chiverton
 Helping to administratively entrench interactive convergence
 On: http://thefalken.livejournal.com

 

 This email is sent for and on behalf of Halliwells LLP.

 Halliwells LLP is a limited liability partnership registered in
England and Wales under registered number OC307980 whose registered
office address is at St James's Court Brown Street Manchester M2 2JF. A
list of members is available for inspection at the registered office.
Any reference to a partner in relation to Halliwells LLP means a member
of Halliwells LLP. Regulated by the Law Society.

 CONFIDENTIALITY

 This email is intended only for the use of the addressee named above
and may be confidential or legally privileged. If you are not the
addressee you must not read it and must not use any information
contained in nor copy it nor inform any person other than Halliwells LLP
or the addressee of its existence or contents. If you have received this
email in error please delete it and notify Halliwells LLP IT Department
on 0870 365 8008.

 For more information about Halliwells LLP visit www.halliwells.com.





[flexcoders] Re: Data Binding Issue

2007-03-22 Thread madhukiranm
Thanks for the replyI tried the one you suggested, but binding 
doesn't seem to work.

Thanks,
Madhu

--- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] 
wrote:

 On Tuesday 20 Mar 2007, madhukiranm wrote:
  [Bindable] tag before the declaration of the variable (in both 
MXML
  and Custom Component). Everything works fine except when the 
variable
 
 In the custom component, have you given it a default value, eg:
 [Bindable]
 public var myCollection:ArrayCollection=new ArrayCollection() 
 
 -- 
 Tom Chiverton
 Helping to widespreadedly differentiate scalable platforms
 On: http://thefalken.livejournal.com
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in 
England and Wales under registered number OC307980 whose registered 
office address is at St James's Court Brown Street Manchester M2 
2JF.  A list of members is available for inspection at the 
registered office. Any reference to a partner in relation to 
Halliwells LLP means a member of Halliwells LLP. Regulated by the 
Law Society.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named 
above and may be confidential or legally privileged.  If you are not 
the addressee you must not read it and must not use any information 
contained in nor copy it nor inform any person other than Halliwells 
LLP or the addressee of its existence or contents.  If you have 
received this email in error please delete it and notify Halliwells 
LLP IT Department on 0870 365 8008.
 
 For more information about Halliwells LLP visit www.halliwells.com.