This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

automatic calculation of values

automatic calculation of values from fields in the form
I would like to create a part of the form, where I enter, for example, values into 3 fields and in the TOTAL field it automatically calculates the total amount while entering.
For example:
I have 4 fields - I enter the area for apartment 1 apartment 2 apartment 3 and in the fourth field the value Total area of all apartments is updated.
Is it possible to see the Total value in the Entry View Definition (or in the Folder View report)?

As a total number?

jv

  • Verified Answer

    0  

    No, I think there is no feature to solve your problem with Vibe. You can set, increment and decrement values - but only for single data fields.

    You have to solve this with java code "outside" of Vibe by using custom jsps (https://devsup.novell.de/documentation/vibe4/vibe4_devel/data/bf26399.html#bf26399)


    Use "Verified Answers" if your problem/issue has been solved!

  • 0

    Rimser is right.

     

    You'll need a jsp on the field. It will probably take 4 hours to do one. But let us know if this is something you are interested in. My thought is to do it with parameters so that you have some control yourself over the algorithme. 

     

    Best regards

    Vinni Lyhne Bjerg, Zispa, Denmark

  • 0 in reply to 

    Hi Diethmar, Hi Vinni,

    ok - I understand - it will be exactly through JSP.
    Thank you.
    I have simple functional source code, I still have to switch it to JSP and implement it.
    I think it is quite a good function - it can be used, for example, when registering contracts - it recalculates the area and after completion it can also be used to record the amount for rent - it will perform a checksum when registering the form:

    <!DOCTYPE html>
    <title> calc
    </title>
    <script type="text/javascript">function update() {
    var form = document.forms[0];
    var sum = eval(form.x.value) eval(form.y.value) eval(form.z.value);
    form.sum.value = isNaN(sum) ? "": sum;
    }
    </script>
    <body>
    <form name="form1" onsubmit="false">
    <table>
    <tr><td>
    <label for="f1">apt 1:
    </label></td><td>
    <input id="f1" name="x" type="number" onchange="update()"></td>
    </tr>
    <tr><td>
    <label for="f2">apt 2:
    </label></td><td>
    <input id="f2" name="y" type="number" onchange="update()"></td>
    </tr>
    <tr><td>
    <label for="f3">apt 3:
    </label></td><td>
    <input id="f3" name="z" type="number" onchange="update()"></td>
    </tr>
    <tr><td>
    <label for="f4">total:
    </label></td><td>
    <input id="f4" name="sum" readonly="readonly"></td>
    </tr>
    </table>
    </form>
    </body>