No, you can't use WOSwitchComponent directly in your plist.  You MUST create 
your own WOComponent and use it in the plist.  The WOSwitchComponent is then 
used your WOComponent that is in the plist.  The job of this component is to 
tell the WOSwitchComponent which component class name and bindings to use at 
runtime.

Chuck


On Jun 14, 2011, at 2:27 PM, <[email protected]> wrote:

> Hi Chuck,
> 
> If I want to use WoSwitchComponent in my plist. I code it like that ?
> 
>> in .plist file : 
>> ..
>> {
>>   title = "HETIC";           
>>   keyPath = "col1";          //Here is data  
>>  },
>>  {
>>   title = "% de financement"; // Here is component referenced
>>   component = WoSwitchComponentName
>>   }
> 
> 
> In my java Method
> 
>> public WOActionResults addDataToGrid() {
>> WoSwitchComponentName componentSw = new WoSwitchComponentName(ctxt);//
>> NSMutableArray dataDico = null;
> 
>    ...
>    posteDico0.takeValueForKey(data1, "col1");
>    componentSw.WOComponentName = "myOwnComponentName";
>> posteDico = new NSMutableArray(posteDico0);
>    ...
> 
> This code in my java addData method can work? 
> Thanks
> 
> ========================================
> 
> Message du : 14/06/2011
> De : "Chuck Hill " <[email protected]>
> A : [email protected]
> Copie à : [email protected]
> Sujet : Re: Add a WOComponent in AjaxGrid via a method
> 
> 
> Hi Raymond,
> 
> AjaxGrid does not support doing it like that.  You will need to make your own 
> WOComponent to put in the cell.  There is no other option.  Inside that 
> component, you can use a WOSwitchComponent and determine the actual component 
> name at runtime based on the row.
> 
> WOSwitchComponent
> 
> 
> Chuck
> 
> 
> On Jun 14, 2011, at 5:43 AM, [email protected] wrote:
> 
>> Hi All,
>> 
>> I would like to add a WOComponent to a ajaxGrid without necessarily going 
>> through a . plist file, but adds the component that goes well with the data 
>> it 
>> will reference via a method. The problem is that is WOComponent not show but 
>> instead it displays the class and subclass of the component. And when I put 
>> a reference component in my. plist file and the "name" of component will be 
>> given when adding to the data, WO gives me an exception because AjaxGrid 
>> does not find the component. In Indeed, this name does not match anything, I 
>> take it like a variable.
>> 
>> i.e :  in WOD 
>> 
>> addData : WOSubmitButton {
>>       action = addDataToGrid;
>>       value = "Add";
>>       updateContainerID = "dataAjaxGridContainer"; //Update the ajaxGrid
>> }
>> 
>> in .plist file : 
>> ..
>> {
>>   title = "HETIC";           
>>   keyPath = "col1";          //Here is data  
>>  },
>>  {
>>   title = "% de financement"; // Here is component referenced
>>   keyPath = "col2"; //keyPath I choosed to add a component
>>   *component = variable // get an exception because the Grid want a 
>> component real name not an variable
>>   }
>> ..
>> 
>> in Java :
>> public WOActionResults addDataToGrid() {
>> AjaxGridPopFormInput formInput = new AjaxGridPopFormInput(ctxt);//a WOInput 
>> component
>> NSMutableArray dataDico = null;
>> 
>> 
>> ...
>> posteDico0.takeValueForKey(data1, "col1");
>> posteDico0.takeValueForKey(formInput, "col2"); //This is my component
>> posteDico = new NSMutableArray(posteDico0);
>> ...          
>> 
>> Resulat : 
>> 
>> dataLabel                          dataComponent
>> 
>> Hello                                  
>> <projet.rec.utt.server.components.AjaxGridPopFormInput name: 
>> projet.rec.utt.server.components.AjaxGridPopFormInput subcomponents: null >
>> 
>> 
>> My Problem is How to display the component correctly?
>> 
>> Thanks for all
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
>> 
>> This email sent to [email protected]
> 
> -- 
> Chuck Hill             Senior Consultant / VP Development
> 
> Come to WOWODC this July for unparalleled WO learning opportunities and real 
> peer to peer problem solving!  Network, socialize, and enjoy a great 
> cosmopolitan city.  See you there!  http://www.wocommunity.org/wowodc11/
> 
> 

-- 
Chuck Hill             Senior Consultant / VP Development

Come to WOWODC this July for unparalleled WO learning opportunities and real 
peer to peer problem solving!  Network, socialize, and enjoy a great 
cosmopolitan city.  See you there!  http://www.wocommunity.org/wowodc11/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to