What I’m trying to do:
Attempting to have a string returned from a server module, that grabs the text from a table, display in a rich text content field. New lines are showing up raw as “\n”, not as an actual new line
What I’ve tried and what’s not working:
Tried replacing it with <br>, messing with formats.
Tried converting to string
Code Sample:
Server Module:
@anvil.server.callable
def get_class_desc(classNameIn):
classDesc = [r['classDesc'] for r in app_tables.classes_info.search(className=classNameIn)]
classDescStr = classDesc
return classDescStr
Client side:
def drop_down_1_change(self, **event_args):
classDescDisplay = anvil.server.call('get_class_desc', self.classSelect.selected_value)
self.classDescTextDisplay.content = classDescDisplay
pass
Client side with string conversion:
def classSelect_show(self, **event_args):
classDescDisplay = str(anvil.server.call('get_class_desc', self.classSelect.selected_value))
classDescDisplay = classDescDisplay[2:-2]
self.classDescTextDisplay.content = classDescDisplay
pass