Yep that works. I just found it under
http://jakarta.apache.org/tapestry/tapestry/hivedocs/config/tapestry.state.FactoryObjects.html,
before reading you email. Thanks.

James Carman wrote:
> Try this...
>
> <invoke-factory object="service:customerStateObjectFactory" />
>
>
> -----Original Message-----
> From: Stanczak Group [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, May 04, 2006 12:09 PM
> To: Tapestry users
> Subject: Re: Initialize a state object? StateObjectFactory
>
> I've crated a service that implements the interface StateObjectFactory.
> Then I added the invoke like so:
>
>    
>     <contribution configuration-id="tapestry.state.ApplicationObjects">
>         <state-object name="customer_session" scope="session">
>             <invoke-factory service-id="customerStateObjectFactory"/>
>         </state-object> 
>     </contribution>
>
> But I'm getting:
>
> Unable to construct configuration tapestry.state.ApplicationObjects:
> Element state-object/invoke-factory (at context:/WEB-INF/hivemodule.xml,
> line 182, column 70) contains errors: Attribute 'service-id' is not
> defined in the schema. Attribute 'object' is required but no value was
> provided.
>
> Where am I going wrong?
>
>
> Stanczak Group wrote:
>   
>> So do I just create a service using StateObjectFactory interface and
>> then put then invoke factory in place. Like so:
>>
>> <contribution configuration-id="tapestry.state.ApplicationObjects">
>>         <state-object name="customer_session" scope="session">
>>             <invoke-factory service-id="MyCustomerSessionFactory"/>
>>         </state-object> 
>>     </contribution>
>>
>>
>>
>>
>> Stanczak Group wrote:
>>   
>>     
>>> Should I just create a customer session factory service and use it?
>>>
>>> Stanczak Group wrote:
>>>   
>>>     
>>>       
>>>> Is <invoke-factory> the only method? or the best method?
>>>>
>>>> Stanczak Group wrote:
>>>>   
>>>>     
>>>>       
>>>>         
>>>>> I've create a customer state object. I want to initialize it with a
>>>>>           
> sale
>   
>>>>> rep. I have a sale rep repository that can do that. How do I go about
>>>>> using the sale rep repository to set the sale rep value?
>>>>>
>>>>> ####################################################
>>>>>
>>>>>     <contribution configuration-id="tapestry.state.ApplicationObjects">
>>>>>         <state-object name="customer_session" scope="session">
>>>>>             <create-instance class="com.carque.CustomerSession"/>
>>>>>         </state-object> 
>>>>>     </contribution>
>>>>>
>>>>> #########################################################
>>>>>
>>>>>     <service-point id="saleRepRepository"
>>>>> interface="com.carque.db.SaleRepRepository"/>
>>>>>
>>>>> Rep repository has method getNextSaleRep to set this. It returns a sale
>>>>> rep or null;
>>>>>
>>>>>   
>>>>>     
>>>>>       
>>>>>         
>>>>>           
>>>>   
>>>>     
>>>>       
>>>>         
>>>   
>>>     
>>>       
>>   
>>     
>
>   

-- 
Justin Stanczak
Stanczak Group
812-735-3600

"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke

..________...............__.................
./  _____/..____..._____/..|_..____...____....
/...\..____/.__.\./....\...__\/.._.\./._..\....
\....\_\..\..___/|...|..\..|.(..<_>.|.<_>..)....
.\______../\___.._\__|../__|..\____/.\____/......
........\/.....\/.....\/..........................


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to