bildwelt
E2E FORUM
E2E Bridge E2E Commerce

Reply To: Pitfalls

E2E Forum User Interfaces Pitfalls Reply To: Pitfalls

#395

Christof
Blocked

I stumbled over a pitfall that cost me some valuable time during a proof of concept:

Scenario:
A comma-separated file is processed within the E2E Bridge. If any error happens during validation or processing, an operator may edit the file within an E2E User Interface.

Solution:
The full file content is displayed in a text area. The operator can edit and submit the content.

Pitfall:
When submitting, the browser removes any linefeeds in the file – the content arriving on server side is all in one single line, thus the flat file adapter has troubles parsing it into a useful structure.

Solution (proposed by Marcel – thanks again):
Preprocess the text area content before submission using JavaScript – replace linefeeds by a special string (in my case “EOL”):
this.editedPayload = $("#ID::textArea").val().replace(/r?n|r/g,"EOL");
Postprocess the content before feeding the flatfile adapter using an ActionScript:
local lineFeedsRedone= editedPayload.replace("EOL", text("n"));