facebook

Alert new line (\n) Not Working

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #338779 Reply

    Why is it on the “OnClick” Popup Alert box the new line \n does not work? It does not give a new line or line feed.

    Example:

    alert(‘Hello user.\n Today is a great day.’);

    It displays as:

    Hello user.\n Today is a great day.

    #338811 Reply

    Hi Rob,

    Thanks for reporting the issue. I assume that you are having this problem in Test Center, after running some tests we found that this is a bug in iPhone personality. In iPad/Android personalities it works fine. I’ve already reported to de dev team to track the bug. Thanks again for your feedback.

    #338813 Reply

    Yes it’s in the test center.

    It worked fine before the update you recently did like 3 weeks ago. since that update this became an issue.

    #344908 Reply

    KariSolamaki
    Member

    @rob@volleyhollix.com wrote:

    Why is it on the “OnClick” Popup Alert box the new line \n does not work? It does not give a new line or line feed.
    Example: alert(‘Hello user.\n Today is a great day.’);
    It displays as: Hello user.\n Today is a great day.

    As examininig the .js file I found that there is \\n instead of \n and that is the reason why the new line control doesn’t work in popup windows! There is a bug in .js code generation, is it?
    Also textarea word wrapping in Mobile Web Simulator doesn’t work, in Test Center it works! Is this also a bug in .js code generation?

    Best regards,

    Einotes Team

    #344923 Reply

    support-vadim
    Participant

    Hi Rob,

    Thank you for reporting this issue. It actually appears to be broken since 2.3.2 release, and only for iPhone4 and iPhone5 devices in TestCenter. We’ve just fixed it, the fix will be available in next Mobione version.

    Hi Einotes Team,

    I tried to reproduce the problem with textarea, but had no success with that. Could you please give us steps to reproduce it, or, ideally, send us mobi-file that looks different in Web Sim and Test Center?

    Best regards,
    Vadim Ridosh

    #344924 Reply

    KariSolamaki
    Member

    Hi Einotes Team,
    I tried to reproduce the problem with textarea, but had no success with that. Could you please give us steps to reproduce it, or, ideally, send us mobi-file that looks different in Web Sim and Test Center?
    Best regards,
    Vadim Ridosh

    I am just evaluating the environment and it seems quite good.

    Regars ET

    Attachments:
    You must be logged in to view attached files.
    #344934 Reply

    support-vadim
    Participant

    Hi Einotes Team,

    Thank you for your help, we are able to reproduce the problem now (it was specific to text areas located inside list items – that’s why it wasn’t easy for us to reproduce it).
    The fix for the problem will be included in next Mobione release.

    Regards,
    Vadim Ridosh

    #344936 Reply

    KariSolamaki
    Member

    Thank you for such quick replies! When will the update take place?
    This 15 days trial is quite short to get whole picture about the environment, but I see it very promising for my purposes 😉

    The very best wishes, ET

    #344937 Reply

    Hi,

    You can ask to our sales team for an extension license, to contact them send an email to sales at genuitec dot com.

    #344954 Reply

    KariSolamaki
    Member

    @support-vadim wrote:

    Hi Einotes Team,
    Thank you for your help, we are able to reproduce the problem now (it was specific to text areas located inside list items – that’s why it wasn’t easy for us to reproduce it). The fix for the problem will be included in next Mobione release.
    Regards, Vadim Ridosh

    As using the example file generated html in my iPhone 4 safari browser there is a slight problem. If I try to scroll by keeping finger on the text rea the whole screen scrolls. The top bar should stay visible. If I keep finger on top of images the scrolling behave correctly, strange, isn’t it?

    Best regards, ET

    #344957 Reply

    support-vadim
    Participant

    Hi,

    That’s a known Mobile Safari limitation. Double-finger scrolling is intended to scroll text areas, single-finger scrolling scrolls the whole design area. Unfortunately, it’s impossible to switch these scrolling modes on and off separately. So, if we prohibit scrolling of the whole design it will prohibit textarea’s content scrolling as well.

    Regards,

    Vadim Ridosh

    #345074 Reply

    KariSolamaki
    Member

    @Einotes Team wrote:

    @rob@volleyhollix.com wrote:

    Why is it on the “OnClick” Popup Alert box the new line \n does not work? It does not give a new line or line feed.
    Example: alert(‘Hello user.\n Today is a great day.’);
    It displays as: Hello user.\n Today is a great day.

    As examininig the .js file I found that there is \\n instead of \n and that is the reason why the new line control doesn’t work in popup windows! There is a bug in .js code generation, is it?
    Also textarea word wrapping in Mobile Web Simulator doesn’t work, in Test Center it works! Is this also a bug in .js code generation?
    Best regards, Einotes Team

    I found out that if I make a javascript function into _custom.js as follows:
    function popupGreatDay() {alert(“Hello user.\n Today is a great day.”);}
    the line feed works fine.
    Br, ET

    #345104 Reply

    Hi,

    Thanks for the info. We are working on a Mobione 2.6 update to be available by the end of this week with a fix for the newline issue.

    #345106 Reply

    KariSolamaki
    Member

    In my mind the ‘Run JavaScript’ with custom function is more useful than ‘Popup Alert’ at least easier to maintain when writing long messages into alert boxes. I use dual screen system and in left screen I have _custom.js file open in editor (Notepad++) and right screen I have MobiOne Design Center. Works like a charm!

    Br, ET

    #345109 Reply

    DaveClark
    Participant

    the newline \n seems to be working in mobione 2.5 in the simulator, not in test center, I have been doing this and calling it from a on button click

    function Help()
    {
    var message = “Decimial points are dots ….not commas\n\n” +
    “The formulas have typical values entered as an example, change any or all to suit your needs\n\n” +

    “If you have a clutch use 100 for the efficiency, a torque converter will be anywhere from 85 to 95 percent “;

    var title = “UnderDrive Help\n\n”;
    phoneui.alert(message, ”,title,”);
    }

    the newlines are working now. I never could get this to work in test center. in an native app whatever you use in the “title” variable is displayed in the alert box

Viewing 15 posts - 1 through 15 (of 15 total)
Reply To: Alert new line (\n) Not Working

You must be logged in to post in the forum log in