0% found this document useful (0 votes)
490 views19 pages

Elements - Fabrik

The document provides information on how to manage elements in Fabrik, including how to select, edit, publish, and configure element settings and properties. Key element settings include name, label, group, type, publishing options, list view settings, and more. Images can replace element values in lists and tooltips can provide additional guidance to users.

Uploaded by

AhmadEsty Tohir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
490 views19 pages

Elements - Fabrik

The document provides information on how to manage elements in Fabrik, including how to select, edit, publish, and configure element settings and properties. Key element settings include name, label, group, type, publishing options, list view settings, and more. Images can replace element values in lists and tooltips can provide additional guidance to users.

Uploaded by

AhmadEsty Tohir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

1/28/2016

Elements | Fabrik

Eachelementcanbeselectedwiththecheckboxtotheleftofitsname.Onceselecteditcanbealteredby
clickingonthebuttonsinthetoprighthandcorner:
NewCreatesanewelement
EditEditstheelement(notethatyoucanalsoedittheelementbyclickingonitsname)
CopyCopiestheelement
PublishSetsthestateoftheelementtopublished.Notethatotherelementpublishingoptionsmake
effecthowtheelementisdisplayed
UnpublishSetstheelement'sstatetounpublished
ShowinlistMakestheelementappearasacolumnwhenviewedinalist
RemovefromlistHidestheelementwhenviewingalist
CheckInChecksintheelement
TrashTrashestheelement
OptionsIsthegeneralFabrikOptionsarea
HelplinkstotherelatedFabrikwikiarticle
Note:ThestandardJoomlaorderwidgetdefinestheorderinwhichtheelementsappearwithintheirgroups.Also
notethatgroupordering,however,ishandledbyeditingtheform,selectingthegroupstabandreorderingthe
group'sinthelist.
Theelementlistcanquicklybecomequitelong.Youcanusethefiltersabovetheelementlisttoshowonlythe
elementsyouareworkingon.
The"Fullelementname"fieldshowsthetextthatyoushouldusetoaccesstheelementwhenusing
placeholdersi.e.
Code(Text):

http://fabrikar.com/forums/index.php?wiki/elements/

4/24

1/28/2016

Elements | Fabrik

{myprefix_mynewlist___elementname}

DetailsTab (top)

IdThisistheelementsidnumberasrecordedinthedatabasetable.
NameTheelement'sname,thisisusedinternallytorepresenttheelement.Ifyouaresavingtheformto
adatabasetablethisnameisusedtodefinethecolumnnamethatcorrelatestotheelement.Nowhite
spaceornonalphanumericcharactersareallowedinthename(exceptfor""and"_",butNOTatthe
beginorendofthestring).
Youcan'tuseFabrikreservedwordsaselementnames("task","view","layout","option","formid",
"submit","ul_max_file_size","ul_file_types","ul_directory","listid",'rowid','itemid','adddropdownvalue',
'adddropdownlabel','ul_end_dir')
NEVERrenameanelementifyouarenot100%surethatthenameisnotusedanywhere,e.g.asPK
element,injoins,dbjoin/CDDelements,linkedelements,customcode,placeholders...
LabelThisisthetextthatappearsnexttotheelementintheform.Inadditionitisthedefaulttextthat
appearsatthetopoftheelement'scolumninthelistviewthiscanbeoverriddenbyenteringa'Heading
label'foundunderthe'Listsettings'tab.
GroupThisisrequired,youneedtospecifyagroupthattheelementbelongsto.
Hint:ifyouareenteringaseriesofelementsintothesamegroup,filtertheelementlistbysaidgroup
andwhenyoucometoaddanewelementthisdropdownwilldefaulttothegroupyoufilteredon.
OrderIfcreatinganewelementthentheelementisautomaticallyaddedtothebottomoftheselected
group.Ifeditingtheelementthenthisisadropdownwhereyoucanselecttheorderthattheelement
appearswithinthegroup.
ElementtypeSelecttheelement'splugin.Theoptionssubsectionwillbefilledwiththeselectedplug
insoptions.
Options

(top)

ThesearespecifictotheselectedElementtype,seebelowforadetaileddescriptionofeachelement.
Notethatthe"Hidden"optionthatmostelementshavecannotbeusedinconjunctionwiththeJavascript
show/hideevents.Selecting"Hidden"meansthattheelementisneverrenderedfordisplay,ratheritisappended
asasimplehiddeninputontheform.Ifyouneedtobeabletoshowanelementwhichishiddenonpageload,
butcansubsequentlybeshownviaJavaScripteventsonanotherelement,you'llneedtoadda'load'JavaScript
eventtotheelementyouusetocontrolvisibility.
http://fabrikar.com/forums/index.php?wiki/elements/

5/24

1/28/2016

Elements | Fabrik

PublishingTab (top)

Publishing

(top)

StatusStateiftheelementispublishedornot,thiseffectsifitisshownintheformandlist.
AddtopagetitleIfyesselectedthentheelement'sdatawillbeappendedtothebrowser'stitle.
RSS

(top)

Theseoptionsareonlyapplicableiftheelement'stablehasbeensetuptocreateaRSSfeedofitsdata
ShowinRSSfeedSelecting'yes'willaddthiselement'sdatatothefeeditems.
IncludelabelIf"showinRSSfeed"issetto'yes'thenselecting'yes'herewilladdtheelement'slabel
beforetheelement'sdataintheRSSfeed.
Useaspseudokey
Tips

(top)

http://fabrikar.com/forums/index.php?wiki/elements/

6/24

1/28/2016

Elements | Fabrik

Tipsarenotesthatappearwhenyouhoverovertheelement,theyareusedtoprovideextrainformationtothe
userfillingintheform,generallyexplainingwhattypeofinformationisexpected.
TiptextEntersometextherethatwillbeusedasthehovertipcontentwhichisshownwhenthemouse
hoversovertheelement'slabelintheformview.
EvalEvaluatethetipasaPHPexpression,thePHPshouldreturnthedesiredtiptext.
TipsoverelementIfnoselectedthenthetiponlyappearswhenyouhoverovertheelementlabel.Ifyes
selectedthenthetipappearswhenyouhoveroverthelabelortheelement.
LocationThelocationofthetooltipinrelationtotheelementlabelor,if'Tipsoverelement'isselected,
thelabelandelement.
ShowtipsindetailviewShowthetipwheninthedetailedview.Notethattipsarealwaysappliedinthe
formview.
ShowtipsinlistviewShowtipsinlistviewusefulifyoumakethetiptextaplacholder.
CommentAninternalmemowhichallowsyoutostatethepurposeoftheelement.Thisisnotvisibleto
thepeoplefillingintheform.

AccessTab (top)

http://fabrikar.com/forums/index.php?wiki/elements/

7/24

1/28/2016

Elements | Fabrik

EditableTheviewingaccesslevelrequiredtoviewtheeditableversionoftheelement.
ViewableTheviewingaccesslevelrequiredtoviewthenoneditableversionoftheelement.
EncryptdataUsesmySQL'sAES_ENCRYPTtoencrypttheform'sdata.Note:forsecuresubmissionof
thedatatotheserverSSLisrequired.Note:onlysupportedbyfieldandtextareaelements.Note:
encrypteddataisnotsearchablebythetable's'advancedsearchall'option.

ListviewsettingsTab (top)
Theseoptionsdefinehowtheelementshouldbehavewheninthelistview.

http://fabrikar.com/forums/index.php?wiki/elements/

8/24

1/28/2016

Elements | Fabrik

ListSettings

(top)

ShowinlistSelectthisoptiontodisplaytheelementinthelistview.
LinktodetailsSelectthisoptiontoenabletheelementlabeltoprovidealinkinthelistviewtothe
detailedorformview.Thelinkisgoingtotheformiftheuserhaseditaccess.Ifyouwanttogotothe
detailsviewinanycaseyouhavetodefineacustomlink(seeCustomlinkexamples).
AlloworderingTurnsthelist'sheadingsintoalink,clickingonthislinkwillreorderthedatabythe
valuesinthiselement'sfields.
HeadinglabelOverridetheuseoftheelement'slabelasthiselement'scolumnheadinginthelistview.
Staticiconfile(no.ext!)Insertafilenamewhichyouwanttoshowinlistviewinsteadofvalueorlabel
text.ThefilenamemustbeWITHOUTEXTENSIONandthefilemustlocatedintheJoomla'images'folder
orinoneofitssubfolders!
Example1:youuseanelementthatlinkstosomeotherwebsite(alwaysthesame)andyouwantto
showthiswebsite'slogoinsteadoflinktext.AssumingthesiteisWikipediaandtheneededfileis
wikipedia.pngyouwritejust:wikipedia(or:subfolder/path/wikipedia)
Example2:youusethelistplugin"Order".Insomecasesyouperhapsdon'twanttoshownumbers
intheorderfieldthatyouneedinlistviewjustasadraghandle.Soyoucanpointite.gtosomeup
http://fabrikar.com/forums/index.php?wiki/elements/

9/24

1/28/2016

Elements | Fabrik

downarrowimageinyourpreferredlocation.
CustomlinkIf"linktodetails"is'yes'thentheurlgivenhereoverwritesthestandardlinktothedetails
url.(seeCustomlinkexamples)
UseasrowclassIfsetto'row'theneachofthelistview'srowswillhavethiselementsvalueaddedasan
additionalclassname.Thisallowsyoutoformatrowsbasedonthelistview'sdata.Ifthevalueisnumeric
(orstartswithanumber)weprependtheelement's(short)nametotheclassname,likemyelement3
insteadofjust3,asCSSclassescannotstartwithanumber.
Icons

(top)

ReplacewithiconsIfsettoyesthenFabrikwilllookforimageswithcertainnames,inthestandard
imageoverridelocations.Iffoundthenthedataisreplacedwiththeimage.SeeImageoverridesforthe
folderlocations.Thefilenameswillbe"cleaned"(convertedtolowercaseandallnonalphanumericchars
replacedwith_)andsearchedforinthisorder:
ifasubdirectoryisdefined:myfolder/{value}.{ext}(since20140829fabrik3.2+)
{elementname}_{value}.{ext}(since28/28/2013fabrik3.0+)
{value}.{ext}(since22/28/213fabrik3.0+)
{label}.{ext}
Iconhovertext
Iconsubdirectory:Ifasubdirisset(e.g.myfolder/)thenFabrikwillfirstlookforiconsin[standardimage
overridelocations]/myfolder/(e.g.JOOMLAROOT/images/myfolder).
Staticiconfile:Insertafilenamewhichyouwanttoshowintableviewinsteadofvalueorlabeltext.The
filenamemustbeWITHOUTEXTENSIONandthefilemustlocatedintheJoomla'images'folderorinone
ofitssubfolders!Example:youuseanelementthatlinkstosomeotherwebsite(alwaysthesame)and
youwanttoshowthiswebsite'slogoinsteadoflinktext.AssumingthesiteisWikipediaandtheneeded
fileiswikipedia.pngyouwritejust:wikipedia(or:subfolder/path/wikipedia)
Filters

(top)

Filtersarecreatedaboveyourlistandallowyouruserstofilterthedatacontainedwithinyourlist.

http://fabrikar.com/forums/index.php?wiki/elements/

10/24

1/28/2016

Elements | Fabrik

FiltertypeDefineswhatfiltertouse.
NoneNofilterisassignedforthiselement.
FieldAfreeformtextfieldisdisplayedallowingtheusertosearchfordatawithinthiscolumn.
DropdownAdropdownlistofallofthelist'sdistinctvaluesforthiselement'sdata.Ifcreatingadrop
downfilterfromadatabasejoinelementthenthedropdowncontainsallthedatafoundinthejoined
table.
AutocompleteAfieldwhich,whentheuserstartstyping,updatesadropdownlistofpotential
matches.
RangeSearchfordatabetweentwogivenvalues,thisismostlyapplicabletodateelements,for
creatingarangeddatefilter.
ExactmatchIfyesselectedthenonlyexactmatchesarereturned,ifnoselectedpartialmatchesare
returned,e.g.ifyousearchedon'1'withexactmatchoffanyrecordscontainingthevalueof'1'wouldbe
returned,e.g.'1'or'10',or'91'.Turningexactmatchonwiththesamefiltervaluewouldonlyreturnthe
recordwiththevalueof'1'">
Example2:table<tt>x</tt>hasanelement<tt>name</tt>and3rowscontaining<tt>Rob</tt>,
<tt>Robert</tt>and<tt>Hugo</tt>asdata.Theuserselects<tt>Rob</tt>fromthe'name's'dropdown
filter.
http://fabrikar.com/forums/index.php?wiki/elements/

11/24

1/28/2016

Elements | Fabrik

Ifthisoptionistickedthenonlyonerecordcontaining<tt>Rob</tt>willbedisplayed
ifthisoptionisnottickedthentworecordscontaining<tt>Rob</tt>and<tt>Robert</tt>willbe
displayed.
FilteraccessStateswhichusergroupisallowedtousethefilter.
FullwordmatchWhensearchingusingafieldfilterandwiththisoptionchecked,onlysearchtermswith
spaceseitherside(iecompletewords)willbereturned
RequiredIfyesisselectedthenthefiltermustbeusedinordertodisplaydatainthelist.
FilterdataDefinewhatdatatoshowinfilterswhenrenderedasadropdownorrange.
IfShowtabledataselectedthenonlyvaluesenteredinthiselement'scolumnwillbeshowninthe
filter.
IfShowallthenallpossibleoptionswillbeshown(appliesto'list'typeelementssuchas
checkboxes,radiobuttons,databasejoins).
Ifdefaultselectedthentheglobalconfigurationsettingwillbeused(foundintables&gtparameters
&gtFilterdata).
OrderbyOrderbylabelorvalue.
IncludeinsearchallDeterminesiftheelement'sdataissearchableviathetable'ssearchallfeature.
IncludeinadvancedsearchDeterminesiftheelementisselectableasanoptioninthetable's
advancedsearchfeature.
CSS

(top)

HeadingclassSpecifyaclassnamefortheelement'scolumnheadinge.g."myHeading"
HeadingCSSSpecifysomecssfortheelement'scolumnheadinge.g."fontcolor:red"
CellclassSpecifyaclassnamefortheelement'scolumne.g."important"
CellCSSSpecifysomecssnamefortheelement'scolumne.g."fontcolor:red"
Calculations

(top)

http://fabrikar.com/forums/index.php?wiki/elements/

12/24

1/28/2016

Elements | Fabrik

Calculationsareshownatthebottomofthetable,andcontainmathematicaloperationsperformedonthe
element'sdata.
Sum (top)

SumthecolumntotalIfyesselectthentheelementsdataisaddedup
SumlabelThelabelplacednexttothesumcalculation,leaveblanktodefaultto'Sum'
SumaccessDetermineswhichviewingaccesslevelcanviewthesum
SplitonSpecifyanelementtosplitthesumcalculationsinto.
Forexample,ifwehaveatable:
<tablewidth="200"cellspacing="1"cellpadding="1"border="1"><tr>
</tr><tr>
<td>Name
</td>
<td>Surname</td>
<td>Age</td>
</tr><tr>
<td>Rob</td>
<td>Clayburn</td>
<td>29</td>
</tr><tr>
<td>Alice</td>
<td>Bird</td>
http://fabrikar.com/forums/index.php?wiki/elements/

13/24

1/28/2016

Elements | Fabrik

<td>25</td>
</tr><tr>
<td>Stan</td>
<td>Clayburn</td>
<td>80</td>
</tr></table>
Andwechoosetosplitthesumcalculationonsurnamethenwewouldget2results:
sumClayburn=109
sumBird=25
Average(Mean) (top)

AveragethecolumntotalIfyesselectedthentheaveragevalueoftheelement'sdataiscalculated
AveragelabelThelabelplacednexttotheaveragecalculation,leaveblanktodefaultto'Average'
AverageaccessDetermineswhichusergroupcanseetheaverage
RoundIntegernumbertoroundtheaverageresultto
SplitonSameprincipalasthesumsplitonoption
Median (top)

ColumnmedianCalculatetheelement'sdata'smedianvalue
MedianlabelThelabelplacednexttothemediancalculation,leaveblanktodefaultto'Median'.
MedianaccessDetermineswhichusergroupcanseethemedian
SplitonSameprincipalasthesumsplitonoption
Count (top)

CountrecordsCountthetotalnumberofrecordsfound
CountlabelThelabelplacednexttothecountcalculation,leaveblanktodefaultto'Count'.
CountvalueOnlyrecord'swhoseelementdatamatchthevalueenteredherewillbeincludedinthe
counttotal
CountaccessDetermineswhichusergroupcanseethecount
SplitonSameprincipalasthesumsplitonoption
Custom Calculation (top)

CustomcalcInthelistviewcreateacustomcalculation.
CountlabelThelabelplacednexttothecustomcalculation,leaveblanktodefaultto'Custom'.
CustomqueryQueryfragmenttogenerateresultusing%storepresentthefieldnameforthiselement
(doNOTusetheactualfieldname,youmustuse%s).Sotogeneratethepopulationstandarddeviationfor
thiselement,thiswouldbe&ampquotSTDDEV_POP(%s)&ampquot(noquotes).
CustomaccessWhocanseethecustomresult.
SplitonSameprincipalasthesumsplitonoption.
SplitPHPIfusingSplitfeature,youneedtoprovidethePHPcodewhichwillreturnyourcalculation,
givenasetofdatainthearray$data.Forexample,toreturnthestandarddevation(assumingyouhavethe
PECLstatslibraryinstalled)wouldbe&ampquotreturnstats_standard_deviation($data)&ampquot(no
quotes).Noplaceholderreplacementisdoneonthiscode.YoumayuseanyvalidPHP,whichoperateson
$dataandreturnsasingleresult.

ValidationsTab (top)

http://fabrikar.com/forums/index.php?wiki/elements/

14/24

1/28/2016

Elements | Fabrik

Validationsensurethatthedataenteredbyyourusersmatcheswhatyourequirefromthem.InFabrik,
validationsareplugins.
TheValidationPlugin'spagehasacompletelistofavailablepluginswithinformationabouteachplugin.
Actionthevalidationtoperform
Publishedisthevalidationpublished?
Showvalidationicon

JavaScriptTab (top)

http://fabrikar.com/forums/index.php?wiki/elements/

15/24

1/28/2016

Elements | Fabrik

TheJavascripttaballowsyoutoaddinfiniteJavaScriptactionstoyourelement.Foreachactionyouhavethe
choicebetweenmanuallyenteringsomeJavaScriptcode,orusingtheGUItocreatesimpleinteractions.
StatusistheJavaScriptactionpublished
EventTheJavaScripteventthatwilltriggerthecodeeitherspecifiedintheCodefieldorgeneratedfrom
theGUIoptions.
YoucantheneitherrunJavascriptcodethatyouprovideorusepredefinedactions.
JavascriptCode

(top)

JavascriptCodeTheJavascriptcodetorunwhenthespecifiedactionoccurs.Thevariable'this'refersto
theinstanceoftheelementpluginclassthathasbeenattachedtotheelementforexamplethecheck
boxclassisfoundinplugins/fabrik_element/checkbox/checkbox.js.
Note:Donotuse//stylecommentsinthiscode,asitisinlinecodefromwhichnewlinesarestripped,so
everythingafterthefirst//willbecomecommentedout.Use/*thisstylecommenting*/instead.
Ifyouputacommentonthefirstlineofthecode(asshownintheexample),thenthisisincludedinthe
headingforthisjavascriptelementwhichisusefulifyouhavealotofseparatejavascriptactionsonan
element.
http://fabrikar.com/forums/index.php?wiki/elements/

16/24

1/28/2016

Elements | Fabrik

YoucanalsotestforFabrik.debug(alsoshownabove)toissuedebugmessagestotheJavascriptconsole
whenDebugJSissetinFabrikoptions(whichyoumightdoduringdevelopmentofyourFabrik
application).
ForradioelementssettorenderasBootstrapbuttongroupschangeeventsmaynotfire,insteaduse
clickevents.
Alloftheseclassesinheritfromthebaseelementclasswhichislocatedin/media/com_fabrik/js/element.js
Predefinedactions

(top)

Ifthiselement:Thisdefinedthecomparisontobemadebetweenthevalueofthiselementandthatinthe
Valuefieldbelow.
ValueThevaluetobeusedforthecomparison.Aplaceholdercanbeusedheretosetthevaluebased
onthevalueofanotherelementwhentheformisfirstloaded.
ActionTheJavascriptactiontoperformontheelementselectedbelow.Thedescriptionofeachoptionis
selfexplanatory.
Elementtheelementorgrouptoperformtheactionupon.
Code(Text):

hidegroup1whenthis==1

willhidegrouponewhenthevalueoftheelementis1
Theinverseeventwouldbethis:
Code(Text):

showgroup1whenthis!=1

Javascriptexamples

(top)

Codeexam ple (top)

Let'ssaywewanttoaddthevaluesintwoelementstogether,element1andelement2andputtheresultsinan
elementcalled'total'.Thisshouldbeappliedeachtimetheuserleaveseitherofthetwofields.Firstofallwe
wanttocreateasum()functionwhichcanbeaccessedbythetwoelements:
CreateaXX.jsfileincomponents/com_fabrik/js,whereXXisyournumericformID,andputyourfunctionsin
there,thenjustcallthefunctionsfromyourelementJSactions.
Fabrik3.0
Code(Javascript):

functionsum(){
varform=Fabrik.blocks.form_1
vartotal1=form.formElements.get('tablename___element1').get('value')
vartotal2=form.formElements.get('tablename___element2').get('value')
returntotal1.toInt()+total2.toInt()
}
Fabrik3.1
Code(Javascript):
http://fabrikar.com/forums/index.php?wiki/elements/

17/24

1/28/2016

Elements | Fabrik

functionsum(){
varform=Fabrik.getBlock('form_1')
vartotal1=form.elements.get('tablename___element1').get('value')
vartotal2=form.elements.get('tablename___element2').get('value')
returntotal1.toInt()+total2.toInt()
}
Noweditelement1,selectthejavascripttab,andaddanewevent.
Select'blur'fortheeventtypeandthenenterthisinthecodebox
Fabrik3.0
Code(Javascript):

varform=Fabrik.blocks.form_1
form.formElements.get('tablename___total').update(sum())

Fabrik3.1
Code(Javascript):

varform=Fabrik.getBlock('form_1')
form.elements.get('tablename___total').update(sum())

PredefinedExam ple (top)

Supposewehavean'caraccidentreport'form,thefirstgroup'details'containsthemaininformationaboutthe
accident.
Itslastelementisaradiobuttoncalled'add_location'andlabelled'Doyouwanttopinpointthelocationofthe
accident'.Ithastwooptions'yes'and'no'(whosevaluesare1and0)thiselementdefault'stothe'no'.
Ourform'ssecondgroupiscalled'location'andhasfurtherfieldstodefinetheaccident'slocation.Wewantto
hidethegroupwhentheformloads(as'add_location'defaultsto'no'),showitwhen'add_location'is'yes'and
hideitwhen'add_location'is'no'
So...enterthefollowingevents:
action:loadslideout'location'whenthis==0
action:clickslidein'locationwhenthis==1
action:clickslideout'location'whenthis==0
ImportantNoteonuseoftheJavascript'this'

(top)

Becarefulwiththeuseof"this"inyourjavascriptcode,forsomeelementeventse.gfieldsthiswillrefertothe
DOM<input>field,whereasforcheckbox,radiobuttonsetcitwillrefertotheFabrikobjectthatcontrolsthe
element.Ineithercaseyoucansafelyuse
Code(Javascript):

this.get('value')

http://fabrikar.com/forums/index.php?wiki/elements/

18/24

1/28/2016

Elements | Fabrik

togettheelement'svalue.
GettingElement'svalueswithJavaScript

(top)

Toconsistentlygetthevalueofanelementthefollowingcodecanbeused:
Fabrik3.0:
Code(Javascript):

Fabrik.blocks['form_1'].formElements.get('tablename___elementname').getValue

Replacethe'1'in'form_1'withyourform'sID.
Fabrik3.1+:
Code(Javascript):

Fabrik.getBlock('form_1').elements.get('tablename___elementname').getValue()

Replacethe'1'in'form_1'withyourform'sID.
Rememberthatforelementssuchascheckboxes,radiobuttonsanddropdownswillreturntheselectedsub
element'svaluesandnottheirlabels.
SettingElementValuesWithJavaScript

(top)

Toconsistentlysetthevalueofanelementthefollowingcodecanbeused:
Fabrik3.0:
Code(Javascript):

Fabrik.blocks['form_1'].formElements.get('tablename___elementname').update('newvalu

Replacethe'1'in'form_1'withyourform'sID.
Fabrik3.1+:
Code(Javascript):

Fabrik.getBlock('form_1').elements.get('tablename___elementname').update('newvalue'

Replacethe'1'in'form_1'withyourform'sID.
Rememberthatforelementssuchascheckboxes,radiobuttonsanddropdowns'newvalue'referstothesub
element'svaluesandnottheirlabels.
Forcheckboxesandmultipleselectdropdown'syoucanassignmultipleselectionsseparatedwith'||',e.g.
Code(Javascript):

Fabrik.getBlock('form_1').elements.get('tablename___elementname').update('newvalue||an

Limitthenumberofresponses

(top)

http://fabrikar.com/forums/index.php?wiki/elements/

19/24

1/28/2016

Elements | Fabrik

Supposeyouhaveacheckboxelementwith8possibleboxestocheckbutyouwantyouruserstoonlychoose
amaximumof3responses.Toachievethat,youcanpastethefollowingcodeinthecodefieldoftheJavascript
tabofyourelement:
Code(Javascript):

if(this.numChecked()>Y){
alert('Message')
event.stop()
}
Replace:
the'Y'bythemaximumnumberofresponsesauthorised
the'Message'bythemessageyouwanttodisplayviaajavascriptalertwindow.
The"action"is"onClick".
Hereisanexamplein"reallife":
[
IMG]
Theelement'enquete___question6'intheform#2canacceptamaximumof3responses.Ifmore,themessage
'Vousnepouvezchoisirque3rponses'isdisplayedtotheuserandthefourthclickiscancelled.

ParentChildElements (top)
WhencreatinganewFabriklistwhosedatabasetablehasalreadybeenusedtocreateapreviousFabriklist,or
copyinganexistingtable,Fabrikappliesaconceptcalledparent/childelements.
Fabrikwillcreatethenewtable'selementswiththesamesettingsasthoseoftheoriginalFabriktable's
elements.
Thesenewelementsarecalledchildelementsandare'linked'totheoriginalparentelement.
Uponeditingandsavingtheparentelementallofitschildelement'swillbeupdatedwiththesamesettings.
Whenyoueditthechildelement,youwillnoticethattheusualeditelementformdoesnotappear.Insteadyou
seeanotificationabouttheelementbeinglinked,alinktoedittheparentelement,andacheckboxtounlink
thechildelement:

Todisabletheparent/childrelationshipclickonthe"unlink"checkbox.Theusualeditelementformwillfadein
http://fabrikar.com/forums/index.php?wiki/elements/

20/24

1/28/2016

Elements | Fabrik

andwhenyousavetheelement,itwillnolongerbelinkedtotheparentelement.Onceunlinkedthechild
elementcannotbelinkedbacktoitsparentelement.
Toedittheparentelement,clickonitsname.Intheexampleabovethat's"id"
Inthetableviewparentandchildelementsareindicatedwithaunlinkedchainicon(thefirsticonintheimage
below)oralinkedchainicon(thesecondiconintheimagebelow).Clickingonthelinkediconwillallowyouto
edittheparentelement.

ElementAccessControl (top)
[TOBECONFIRMEDIFFABRIK3ACCURATE]
Thistableshowsthevariousaccesssettingandhowtheyeffecttheelementrenderingwhenintheformview
anddetailsview:
<tablewidth="100%"cellspacing="1"cellpadding="1"border="1"summary="showshowelementaccess
settingseffectelementrenderinginformanddetailsview"><tr>
<td>+elementaccess</td>
</tr><tr>
<td>view</td>
<td>access</td>
<td>readonly</td>
<td>visible</td>
<td>editable</td>
</tr><tr>
<td>details</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
<td>no</td>
</tr><tr>
<td>details</td>
<td>yes</td>
<td>yes</td>
<td>yes</td>
<td>no</td>
</tr><tr>
<td>details</td>
<td>no</td>
<td>no</td>
<td>no</td>
<td>no</td>
</tr><tr>
<td>details</td>
http://fabrikar.com/forums/index.php?wiki/elements/

21/24

1/28/2016

Elements | Fabrik

<td>yes</td>
<td>no</td>
<td>no</td>
<td>no</td>
</tr><tr>
<td>form</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
<td>no</td>
</tr><tr>
<td>form</td>
<td>yes</td>
<td>yes</td>
<td>yes</td>
<td>yes</td>
</tr><tr>
<td>form</td>
<td>no</td>
<td>no</td>
<td>no</td>
<td>no</td>
</tr><tr>
<td>form</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr></table>

alexforte83likesthis.
LastModified:Nov5,2015at6:03AM(Cached)

(Like)(50175View s)

XenCartaPROJasonAxelrodfrom8WAYRUN.COM

Login
UsefulLinks
CreateaFabrikAccount
FabrikWiki
Fabrikongithub
MembersOnlineNow
thellie,automill
Total:68(members:2,guests:55,robots:11)

WikiNavigation
Elem ents
Elementcustomlinkexamples
Elementdefaultexamples
Elementdeleteconfirmation(+)
ElementJavascript
http://fabrikar.com/forums/index.php?wiki/elements/

22/24

You might also like