Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

Get Calculated Value from Session 19.11.2014 18:41

Just wondering how can i set a calculated value and use it in another form which is on the same page??

For example i calcualte with the matrix a value which will be passed to another field of another form. this is done with the

$session = JFactory::getSession();?

If so how exactly is this done??

Re: Get Calculated Value from Session 20.11.2014 09:44

Hi,
yes, you can use the session to store values and recover from any other point. Here you fill find the specific statements you can add to your code:

http://www.moonsoft.es/en/help/2-cbsupport/2107-re-overtake-calculation-sum-from-one-form-to-another



This can help you to use previous calculated values for the calculation of the second one. Some more tips:


-You can also use an inline field at the second one to show the recovered value at the second calculator. Create an inline field at the second one and assign the recovered value to it at the code.

-You could also fill an input text of the second calculator at the time the first calculator is executed using javascript. Print the result at the first calculator and use 'after calculate execution' section to copy the value to another field of the calculator below.

If you need more help with this, please place a ticket at the helpdesk, where we can share code without the forum restrictions.

Thanks, regards
Moonsoft Team
www.moonsoft.es

Re: Get Calculated Value from Session 20.11.2014 10:27

Thanks, yes i read that but where do i fill in the first script??

$session = JFactory::getSession();
$session->set( 'myresult', $VAR_WITH_MY_RESULT );

This will be filled in at the javascript events executed on loaded page or executed after calculating?

And for the second calculator it will be executed when loading?

Re: Get Calculated Value from Session 20.11.2014 11:56

Hi,
you have two different approaches:

- Storing the data in session when first calculator is executed, so data will be recovered when second calculator is executed, all the code should be placed at the end of the code section of each calculator, when you have finished your calculations, not at the javascript tabs. This option will work if your calculators are on different pages, because you can configure the second calculator to execute once when loading, so it will recover the stored data.


- Not store the data, just copy it from the result of your first calculator to one input field of your second calculator. This code doesn't affect sessions, it should be placed at the javascript tab 'after execution' and it will only be valid if both calculators are at the same page. If this is your preferred option, please place a ticket and we'll share with you some code tips.

Let us know if you need further help with any of the options.

Thanks, regards
Moonsoft Team
www.moonsoft.es

Re: Get Calculated Value from Session 20.11.2014 12:16




- Not store the data, just copy it from the result of your first calculator to one input field of your second calculator. This code doesn't affect sessions, it should be placed at the javascript tab 'after execution' and it will only be valid if both calculators are at the same page. If this is your preferred option, please place a ticket and we'll share with you some code tips


Thanks, yes this will be the one. It will have two calculators on the same page... I will send a ticket.

Re: Get Calculated Value from Session 28.11.2014 14:30

Thanks, with the sessions it worked perfect...

Greetings,


Richard
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect

Our clients' feedback