Eric,
I'm sorry but I don't understand your question.
Can you ask precisely what you want, with ONLY the important part of
your form file ?
Thanks,
Jean-Christophe
Trouvé Sébastien wrote:
Thanks for your answer, but can i create a code for my ThirdpartyAccount
class, which nominate a widget as a selection-list or as a simple field,
according to the form in use?
Le lundi 10 juillet 2006 à 12:03 +0200, Jean-Christophe Kermagoret a
écrit :
Sebastien,
happily, you can use your existing class.
Selection-list is just a query that concatenates data.
For example, in your case, if you want to reuse the data you entered
through your class, you just have to create a new widget (and not a new
class) with selection-list type :
<fd:multivaluefield id="activity.organizer">
<fd:datatype base="string"/>
<fd:selection-list
src="cocoon:/process-selection-list-specific?xpath=/document[meta/type='organisateur'][meta/doctype='ae_entity']&order=meta/name&value=$doc/docid&label=fn:string(fn:concat($doc/meta/name,%20'%20-%20',%20$doc/meta/city))"
dynamic="true"/>
</fd:multivaluefield>
The process-selection-list is the query that will build your
selection-list. It takes 4 arguments :
* xpath : the query to get the basic results
* order : the sort order to use
* value : the option value to use
* label : the option label to display
Jean-Christophe
Trouvé Sébastien wrote:
Hello,
I created a form to capture customer's features. This form contains a
class called ThirdpartyAccount, which capture the identity, the label
and the type of the thirdparty account (Customer or Supplier).
My class looks like:
/<?xml version="1.0" encoding="ISO-8859-1"?>/
/<!-- BX CPT -->/
/<fd:form/
/ xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"/
/ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"/
/ xmlns:filter="http://bluexml.org/filter/1.0">/
/ <fd:widgets>/
/ <fd:class id="ThirdpartyAccount">/
/ <fd:widgets>/
/ <fd:field id="AccountId" required="true">/
/ <fd:datatype base="string"/>/
/ </fd:field>/
/ <fd:field id="AccountLabel">/
/ <fd:datatype base="string"/>/
/ </fd:field>/
/ <fd:field id="AccountingType" required="true">/
/ <fd:datatype base="string"/>/
/ <fd:selection-list
src="cocoon://navigation/getNomenclature?field=thirdPartyAccountType&viewStyle=label"
dynamic="true"/>/
/ </fd:field>/
/ </fd:widgets>/
/ </fd:class>/
/ </fd:widgets>/
/</fd:form>/
And my repositoty like this:
/<fd:form/
/ xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"/
/ xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"/
/ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"/
/ xmlns:filter="http://bluexml.org/filter/1.0">/
/ <fd:widgets id="AccountingCustomer">/
/ <fd:new id="Base"/>/
/ <fd:new id="Authoring"/>/
/ <fd:new id="Identity"/>/
/ <fd:new id="ThirdpartyAccount"/>/
/ <fd:new id="AccountingInformation"/>/
/ <fd:new id="Classification"/>/
/ <fd:new id="CommunicationWork"/>/
/ <fd:new id="CommunicationHome"/>/
/ <fd:new id="Personality"/>/
/ <fd:new id="Marketing"/>/
/ <fd:new id="Credential"/>/
/ <fd:new id="Security"/> /
/ <fd:new id="Company"/>/
/ <fd:new id="Address"/>/
/ <fd:new id="Date"/>/
/ <fd:new id="NewVersion"/>/
/<!-- /
/ <fd:new id="NewVersionWithoutAttachment"/>/
/-->/
/ <fd:new id="Versions"/> /
/ </fd:widgets>/
/</fd:form>/
I called my ThirdpartyAccount class
Now , i want to create a new form, where my class ThirdpartyAccount is
here, but used as a selection-list.
How could i do this?
- Do i create a new class to build my selection list?
- or can i use my present class?
Thanks for your help
------------------------------------------------------------------------
_______________________________________________
User mailing list
User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx
<mailto:User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx>
http://mlm.triglyphe.com/mailman/listinfo/user
------------------------------------------------------------------------
_______________________________________________
User mailing list
User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx
http://mlm.triglyphe.com/mailman/listinfo/user
--
Jean-Christophe Kermagoret
jck-v3FNGYKZ9cyNvCAlj6F9uA@xxxxxxxxxxxxxxxx
|