Multifield Assitance
hello,
i'm trying implement multifield dialog allows author enter text , url wrap standard <a> tag. tried follow using extjs example found here http://dev.day.com/docs/en/cq/current/developing/widgets.html; using extjs widgets (v01) package form package share not load multifield component correctly (clicking add item doesn't anything) in 5.5 update 1.
i can figure out how iterate through multifield; i'm little fuzzy
- how define 2 or more fields in multifield author can enter string , and url (using pathfield xtype)?
- how reference each fields individually in for loop? can see how when there's 1 item per multifield entry, not sure how 2 or more items (array???)
- which extjs files have include in components clientlibs folder, of them or else (multifield.js isn't part of training package)?
thanks assistance/demos can point me to.
ok -- start, seems if cq instance not able find custom widget (xtype of ejstcustom). recommend testing appending query string '?debug=console' cq page contains custom widgets component, , 'failed load resource'. because cq page unable find js / css libraries required -- in category of 'cq.extjstraining'. recommend inserting conditional block in cq template's jsp checks see if wcmmode active - , include clientlib. testing add line in template's jsp
<cq:includeclientlib categories="cq.extjstraining" />
i've found requirement implement multifield (textfield,pathfield,pathfield) pretty common requirement, there many ways - simple way create custom extjs based widget has xtypes manually defined - more complicated way create extensible 'multifield multifield' widget. i'll not go second option here (lotta js code)
ok - in 'using exjs' widgets example - constructor has 3 different components in it
1) hiddenfield (cq.ext.form.textfield)
2) allowfield (cq.ext.form.combobo
3) otherfield (cq.ext.form.textfield)
i recommend inserting dummy data in fields once page set up, , looking stores properties in /content/bla - respective page. can manipulate extjs based widget store propertiees either directly on resource path, or create children each item save.
i.e.
/content/app/page/jcr:content/mainpar/customwidgets/asdfasd
unfortunately, ootb multifield component supports saving results of these objects string[] property on component resource path itself. if want fancy , instead have them saved indexed child nodes have more extjs magic. in example provided, use '/' split operator each property on string array, , cast them / update fields. (see setvalue(), getrawvalue(), , processrecord() functions in customwidget.js
hope helpful!
More discussions in Archived Spaces
adobe
Comments
Post a Comment