Hello, I would like to know how to insert a line break in a list of strings for each element shown, so that how you can see in the image for each semicolon, I would like to put a line break to be shown:A1004A1008A1010...orA1004;A1008;A1010;...I don't care about the semicolon, I just want to know how to insert a line break for each element.
this is my interface:
this is my code:
a!localVariables( local!selectedValue : null, local!NombrePedidoName, a!sectionLayout( label:"Lista pedidos por estado", contents: { a!dropdownField( label: "Estado del pedido", labelPosition: "ABOVE", placeholderLabel: "--- Selecciona un estado del pedido ---", choiceLabels: {"pago pendiente", "recibido", "enviado", "procesando", "completado", "cancelado", "cerrado"}, choiceValues: {"pago pendiente", "recibido", "enviado", "procesando", "completado", "cancelado", "cerrado"}, value : local!selectedValue, saveInto: { local!selectedValue, a!save( local!NombrePedidoName, if( isnull(save!value), {}, rule!GP_GetListaPedidosPorEstadoQuery(estadopedido: save!value) ) ) }, validations: {} ), a!richTextDisplayField( label: "lista pedidos", value:a!richTextItem( text: striphtml(local!NombrePedidoName & "<br/>") ) ), a!textField( label: "Lista pedidos", labelPosition: "ABOVE", value : local!NombrePedidoName & "<br/>", saveInto: {}, refreshAfter: "UNFOCUS", readOnly: true, validations: {} ) } ) )
and this is the query what I use
a!localVariables( local!myDictionary: ( a!queryEntity( entity: cons!GP_Pedido_Entity, query: a!query( selection: a!querySelection( columns: { a!queryColumn( field: "nombrepedido" ) } ), logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "estadopedido", operator: "=", value: ri!estadopedido ) }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1 ) ), fetchTotalCount: false ).data ), fn!index( local!myDictionary, "nombrepedido", null ) )
Discussion posts and replies are publicly visible
striphtml(local!NombrePedidoName & "<br/>") -> joinarray(local!NombrePedidoName, char(10))
Thank you very much, it worked!
a!textField( label: "Lista pedidos", labelPosition: "ABOVE", value : joinarray(local!NombrePedidoName, char(10)), saveInto: {}, refreshAfter: "UNFOCUS", readOnly: true, validations: {} )
But when resetting the interface it failed: Interface Definition: Expression evaluation error at function 'joinarray' [line 37]: A null parameter has been passed as parameter 1. How could I solve it? Sorry for my ignorance I am an intern, thanks
joinarray is not null-save. Either put it into an if() checking whether that local is null (isnull()) or only show the fields if there is something you want to display (showWhen)
Thanks it worked.