Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: How to write any file type into a blob with javascript

  1. #11
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    335
    Sorry, it doesn't work: in Desk not orderly *) and in Web not at all.

    Should I program an example? Or send the package (with a deskription) ?

    *) The entry is only made and shown when I press "save changes"
    Last edited by gcjm; 2025-03-18 at 10:18.

  2. #12
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,930
    Hi Georg,

    Do you have 'Enable when editing' set on the Canvas section?

    Are you still updating the text on the screen, or just updating the cursor?

    Regards,

    Yvonne

  3. #13
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    335
    >> Do you have 'Enable when editing' set on the Canvas section? <<
    Yes I did.

    >> Are you still updating the text on the screen, or just updating the cursor? <<

    I did (as you wrote) >> cursor.update(); <<
    But how I had to write?

  4. #14
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,930
    Hi Georg,

    The cursor.update() was to be used if you did not have 'Enable when editing' set on the Canvas section.

    You should be setting the text or value of the textbox to update the UI and using cursor.setData() to update the cursor. If this is not causing the new value to be retained when saving, check the Web inspector (Ctrl + shift + i) in the browser for Console errors/messages.

    Regards,

    Yvonne

  5. #15
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    335
    "cursor.update()" causes an error in the web app.

    I now have:
    var cursor = Lianja.getCursor("ereignis");
    cursor.setData("betreff",auswahl);
    // cursor.update();
    var oItem1 = Lianja.getElementByID("page1.section1.field2");
    oItem1.refresh();
    This works as intended in the AppBuilder, but not in the web app. The value of "field2" only is displayed when saving.

    I won't be working on the app any more at the moment:
    It's here:
    https://www.gcjm-software.de/apps/ereignisse/index.html
    Should I send the login somewhere?

    The second problem:
    It (usually) doesn't work to save file types other than picts to the blob (event.photo).
    Saving PDF files: It seems to depend on the individual pdf file whether it is saved (more than 0 bytes)
    and sometimes a strange effect occurs that nonsensical characters are entered into the text field (ereignis.beschreibung) of the NEXT data record.
    (It tested it with record 2 and I'm seeing the strange characters in rec 3)

    Thank you for all the help!
    Georg

  6. #16
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,930
    Hi Georg,

    Y: The cursor.update() was to be used if you did not have 'Enable when editing' set on the Canvas section.
    So do not include it if you do have 'Enable when editing' set on the Canvas section.

    G: a) I select text using a combobox and use a click function to write the text into a text box connected to a field in a data table. This change isn't saved with the "Save Changes" button, but only if I manually add something to the text box, e.g., add a space.
    Y: Change the data in the cursor too, e.g.

    Code:
    ca = Lianja.getCursor('name-of-table');
    ca.setData('name-of-field','new-value');
    Y: You should be setting the text or value of the textbox to update the UI and using cursor.setData() to update the cursor.
    So update the text in the UI and the cursor.

    The second problem:
    It sounds like your upload code needs further checking/testing.

    Regards,

    Yvonne

  7. #17
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    335
    Hi Yvonne,
    I did everything as you described (and later checked), but the refresh still doesn't work in the web app.
    By the way "cursor.setData()" is ok for the Desk but not for Web, there comes an error from an worker js.
    I could write a short test example for this later.
    The same applies to filling the blob with PDF or MP3 files.
    (I'm not feeling well at the moment.)
    Regards, Georg
    Last edited by gcjm; 2025-03-24 at 04:45.

  8. #18
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,930
    Hi Georg,

    Sure, submit tickets with reproducible examples when you are ready and we can look into it in more detail.

    Regards,

    Yvonne

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us