0 votes

Hi all!

I'm new with Efficy customization and i wanted to train with macros by adding 2 widgets to the dashboard like this:

\customs\training\macros\MacroWidgetsCustom.txt

WidgetTemplate100 {[<%Macro("$MACRO$", $KEY$=100, $KIND$="Macro", $TITLE$="Top 10 Clients", 
        $ICON$="i-Comp", $COLLAPSED$="$COLLAPSE$", $SENTITY$="Comp",
        $CONFIG$=|{url:"dialog?entity=Comp&_MACRO=First10Customers&_MACROFILE=MacroWidgets.txt",pollSecs:1800}|)%>]}

First10Customers#Comp {[
        <%RunQuery(id="First10CustomersQuery", store=1000, SQL="select TOP 10 K_COMPANY, NAME from R_COMPANIES where KIND = 12 order by K_COMPANY desc")%>
        <%GetDataGrid(query="First10CustomersQuery", count=-1, noheader="true", norecords="Aucune fiche", columndefs="GridColumns.txt", entity="Comp", columns="NAME{COMPANY}")%>
    ]}

WidgetTemplate101 {[<p>Second Widget is Here!</p>]}

The first one works, but I can not display the second

I tried to custom \dialog\WidgetsTodayCustom.htm but it's like if Efficy ignore this custom file... (these 2 lines do the same things: The first widget works but the second don't show up...)

<%Macros('WidgetTemplate7;WidgetTemplate8;WidgetTemplate9;WidgetTemplate12;WidgetTemplate17;WidgetTemplate18',$MACRO$='TodayWidgetLibraryTitle')%>
<%Macros('WidgetTemplate7;WidgetTemplate8;WidgetTemplate9;WidgetTemplate12;WidgetTemplate17;WidgetTemplate18;WidgetTemplate100;WidgetTemplate101',$MACRO$='TodayWidgetLibraryTitle')%>

Are there other places where it's defined ?

Thanks a lot!

asked in Efficy/ Client side by (245 points)

1 Answer

+2 votes
Best answer

Hi try to add this :

WidgetTemplate101 {[<%Macro("$MACRO$", $KEY$=101, $KIND$="Macro", $TITLE$="Top 10 Clients", 
    $ICON$="i-Comp", $COLLAPSED$="$COLLAPSE$", $SENTITY$="Comp",
    $CONFIG$=|{url:"dialog?entity=Comp&_MACRO=SecondWidget&_MACROFILE=MacroWidgets.txt",pollSecs:1800}|)%>]}

and then your custom snd widget with no datagrid :

SecondWidget{[
    Second Widget is Here!
    ]}

The widgetTemplateMacro needs all the parameters to work properly the fact that your widget will display or not a Runquery / dataGrid has nothing to do with the fact that severals parameters need to be filled.

Basically the WidgetTemplateMacro parameters will allow you to set the widget container behavior (the border with the minimize button, the title, the colapse option, ...)

answered by (983 points)
selected by
1,166 questions
1,424 answers
1,716 comments
325 users