-
1 Attachment(s)
Coding error
Hello,
Could you help me, please? what is wrong with this coding? How do I learn this coding? Could you show me this reference?
namespace siakademik
//
// Lianja custom right sidebar gadget
//
define class page4_rightsidebarcustomgadge as gadget
proc refresh()
m_select = select()s
if select("kaskeluar_detail") > 0 and select("kaskeluar") > 0
select kaskeluar_detail
m_count = cntvalues(.t., kaskeluar->nodok)
else
m_count = 0
endif
if select("kaskeluar_detail") > 0 and m_count > 0
select kaskeluar_detail
m_total = sumvalues(kaskeluar_detail->rupkel)
m_total = currency(m_total)
m_min = minvalues(kaskeluar_detail->rupkel)
m_min = currency(m_min)
m_max = maxvalues(kaskeluar_detail->rupkel)
m_max = currency(m_max)
else
m_total = 0
m_min = 0
m_max = 0
endif
select &m_select
this.ui_webview.html = ;
'<body style="background-color:#f9f9f9;padding:0px; overflow:hidden;font-size:small;">';
+ '<div style="background-color:#f5f5f5;-webkit-border-radius:5px; border:1px solid lightgray; padding 0px; overflow:hidden;font-size:small;height:100%;">';
+ '<table border=0px cellpadding="0px" cellspacing="0px" width="165px" height="100%">';
+ '<tr style="font-size:small;">';
+ '<td style="text-align:center;">';
+ "<b><font color=darkgray>Total Orders</b></font><br/><font color=gray>&m_count</font><hr size=1px color=lightgray>";
+ "</td>";
+ "</tr>";
+ '<tr style="font-size:small;">';
+ '<td style="text-align:center;">';
+ "<b><font color=darkgray>Min Order Value</b></font><br/><font color=gray>&m_min</font><hr size=1px color=lightgray>";
+ "</td>";
+ "</tr>";
+ '<tr style="font-size:small;">';
+ '<td style="text-align:center;">';
+ "<b><font color=darkgray>Max Order Value</b></font><br/><font color=gray>&m_max</font><hr size=1px color=lightgray>";
+ "</td>";
+ "</tr>";
+ '<tr style="font-size:small;">';
+ '<td style="text-align:center;">';
+ "<b><font color=darkgray>Total Order Value</b></font><br/><font color=gray>&m_total</font><br/>";
+ "</td>";
+ "</tr>";
+ "</table>";
+ "</div>";
+ "</body>"
endproc
enddefine
proc page4_rightsidebarcustomgadge()
? "hello world"
gadget = createobject("page4_rightsidebarcustomgadge")
gadget.addObject("ui_webview", "webview")
return gadget
endproc
-
2 Attachment(s)
Hi venus,
The [...] button next to the 'Right Sidebar gadget' in the Page Builder Assistant and next to the 'Custom content gadget -> Gadget' in the Attributes default to creating a '.rsp' script file for generating the gadget. A '.rsp' Lianja/VFP Server Pages script can be used in the web client and on desktop.
The example code you have customized from the 'lianjademo' sample App is a LianjaScript/VFP '.prg' that can be used in desktop Apps. In this case, you need to specify the ".prg" file extension in the Attribute, e.g.
Page Builder Assistant:
Attachment 3119
App Inspector Attributes:
Attachment 3120
You also have an extra 's' at the end of this line:
Code:
m_select = select()s
See here for more on the Page Right Sidebar.
Regards,
Yvonne
-
Oke thanks Yvonne
I will try to understand it.