+1 vote

Hi everyone,

just for telling if someone have the same issue.
I got some error of editHandle in following the tutorial to display fields in consult inside category with the category form responsive because of a multivalue and lookup inside consult.

I've send a mail to kristof, to let it know : but i've wrote a litle code to overcome this mistake, it's maybe not the best, but it's working till waiting to a better solution from Kristoph :).

Just add this code inside FormFieldsEditCustom.txt. It should work. :)

/**
* Rewrite field for displaying fields inside category for comp
*/
field.MULTIVALUE {[
<%If("%%GetArgument('page', context=ATTR)", value="pages/desktop/Consult.htm",  then=|<textarea id="a-CATEGORY-$CATG$-$FIELD$" readonly><%GetField('$FIELD$', type="MULTIVALUE", separator=", ", context="TEXT")%></textarea>|,else=|
<%GetEdit('$FIELD$',
data-ajax-url='dialog?_macro=JsonMultiValueList&_macrofile=MacroAjax&edithandle=<%GetEditHandle()%>&field=$FIELD$&detail=<%GetArgument("DETAIL",context=ATTR)%>&detailkey=<%GetArgument("DETAILKEY",context=ATTR)%>',
data-json='{<%GetField("$FIELD$", type="MULTIVALUE", json=T, context=ATTR)%>}')%>
|)%>
]}
field.CATG_MULTIVALUE {[
<%If("%%GetArgument('page', context=ATTR)", value="pages/desktop/Consult.htm",  then=|<textarea id="b-CATEGORY-$CATG$-$FIELD$" readonly><%GetField('$FIELD$', category="$CATG$", type="MULTIVALUE", separator=", ", context="TEXT")%></textarea>|,else=|
<%GetEdit('$FIELD$', category="$CATG$",
        data-ajax-url='dialog?_macro=JsonMultiValueList&_macrofile=MacroAjax&edithandle=<%GetEditHandle()%>&field=CATEGORY-$CATG$-$FIELD$&detail=<%GetArgument("DETAIL",context=ATTR)%>&detailkey=<%GetArgument("DETAILKEY",context=ATTR)%>',
        data-json='{<%GetField("$FIELD$", category="$CATG$", type="MULTIVALUE", json=T, context=ATTR)%>}')%>
        |)%>
]}
field.LOOKUP {[
<%If("%%GetArgument('page', context=ATTR)", value="pages/desktop/Consult.htm",  then=|<textarea id="c-CATEGORY-$CATG$-$FIELD$" readonly><%GetField("R_$FIELD$", context=TEXT)%></textarea>|,else=|
<%GetEdit("$FIELD$", type="LOOKUP", data-placeholder="<%GetLabel('Select Value')%>...")%>
|)%> ]}

Have a nice working day :).

asked in Efficy/ Client side by (130 points)

1 Answer

0 votes

Hey Gaetan, that's a good way to solve this issue. I'll try to include that in the tutorial. Thanks for reporting

answered by (6.9k points)
1,169 questions
1,427 answers
1,718 comments
325 users