Message Boards Message Boards

Clear prior dynamic output prior to view new one?

This notebook works just fine. However, on sequential use of the "Submit" button the prior result remains and a new result is output below the old. How can I clear the prior output so that only the new output shows?

POSTED BY: Roger J Brown
5 Replies
Posted 2 years ago

Hi Roger,

Is there a reason for using Print to show the output? Why not render the output as part of the UI? e.g.

enter image description here

The attached file has the code. There is a bug in AccountingForm, it does correctly format Quantity objects so instead, used a light red background for negative NPV.

Attachments:
POSTED BY: Rohit Namjoshi

That would be just fine except it does not CloudDeploy. Is there a reason for this? I had not considered your method...

POSTED BY: Roger J Brown
Posted 2 years ago

Well, it does CloudDeploy, however, four of the InputField report an error

TypeError: Cannot read properties of undefined (reading 'forEach')

Observe that all of those fields have Real values, the ones that work have Integer values. This is most certainly a bug in InputField when type is Number. Change Number to Expression for those four and it works fine. You should probably add some error checking in case the user inputs a non-numeric value.

Deployed version.

POSTED BY: Rohit Namjoshi

Thanks for solving my problem!!

POSTED BY: Roger J Brown
Posted 2 years ago

You are welcome. BTW the URL to your website on your profile page is incorrect. It should be http://www.mathestate.com/

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract