Results 1 to 3 of 3

Thread: Coding error

  1. #1
    Junior Member
    Join Date
    Nov 2023
    Posts
    15

    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
    Attached Images Attached Images  

  2. #2
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    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:
    Name:  Assistant.png
Views: 35
Size:  17.4 KB

    App Inspector Attributes:
    Name:  AppInspector.png
Views: 37
Size:  25.4 KB

    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

  3. #3
    Junior Member
    Join Date
    Nov 2023
    Posts
    15
    Oke thanks Yvonne

    I will try to understand it.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us