Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Mixing javascript and Xbasic and other javascript questions ...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mixing javascript and Xbasic and other javascript questions ...

    Where can javascript be used? I know it can be used on pages, but:

    1. Where else can it be used? For example, are there places in components and dialogs where you can insert javascript?

    2. Within a page, can xbasic and javascript share values of variables. For example, can I run a procedure (anything here) with Xbasic and then mix in some javascript to display an alert box or confirm box. For example, would something like this work:

    if tbl.idnumber="231"
    <script text=javascript/text>
    alert("This is idnumber "+tbl.idnumber)
    </script>
    end if

    Gary
    Gary S. Traub, Ph.D.


    #2
    Re: Mixing javascript and Xbasic and other javascript questions ...

    Variables created with Javascript cannot be seen by XBasic and created by XBasic cannot be seen by Javascript. The only thing they both can see is html code variables like:
    <input type="text" name="custId" value="" >

    XBasic can reference variable custId only after the form or page has been submitted to server.
    and Javascript can reference variable custId only after the page has been loaded or with events (onclick, etc)

    Thing of it as this:
    Javascript is a client(browser)
    XBasic (a5w) is a server programming.
    Once you get around this concept you'll be ready to program web pages.


    hope this helps
    The Mexican

    Comment


      #3
      Re: Mixing javascript and Xbasic and other javascript questions ...

      Mario,

      Yes, that does help. It is beginning to sink in.

      Let me ask you a basic question then.

      Suppose I have a grid showing 10 records. I have added my own link called "Delete" so the user can delete a row if they wish. This link goes to an a5w page that contains Xbasic where I check to see if the record about to be deleted is used in any other tables, and if so, I prevent the deletion.

      Before, I actually delete the record thouh, I want the user to confirm that this is what they really want to do. On the desktop, this is easily donw with a ui_msg_box, or an xdialog, or even a form. On the web, I can do it within the page, and then display ac dertian part of the page to display whatever message I want. But it would be better if I could display a nice popup, that displays on top of the exisiting page. This is where I thought javascript would be of help. So for example, if the user tries to delete a charge, that has already been billed, I want a message to alert the user that the deletion cannot be done. How would you suggest I do this?

      Gary
      Gary S. Traub, Ph.D.

      Comment


        #4
        Re: Mixing javascript and Xbasic and other javascript questions ...

        There are different ways to do this:
        1) When the user clicks on the delete link the delete link calls the same page but adds in the url a delete flag with the user ID for example if the name of the page that you are displaying the records is "clients" then the delete link should look something like this: <a href='clients.a5w?id=24545&delete=yes' >Delete Client </a> have in mind that the id number is created autmatically with xbasic code. Then on the same page you use some code in the <head> section to see if the delete variable exists and if its value is 'yes':
        Code:
        if eval_valid("delete") then
         if delete='yes' then
            ' put some code that calls a function that checks to see if record
            ' is in use and if not delete.
         end if
        end if
        I don't see the reason for checking if somebody is using a record. The only time there would be a conflict it would be when an update and a delete to the same record is sent to th server at the same exact time, we are talking microseconds.

        2) create a transition page that has code that checks and deletes record and then Response.redirects back to the original page. link should look something like this: <a href='deletepage.a5w?id=24545' >Delete Client </a>
        When the page is loaded it checks to see if id exists and then delete:
        dim errormessage as C
        if eval_valid("id") then
        'open table and delete record
        response.redirect("clients.a5w")
        end
        else
        'set some error message in the page
        errormessage="Invalid id or doesn't exists"
        end if

        this is the page:
        <%a5 ? errormesasge %>

        I hope this helps.
        Last edited by Mario Prieto; 07-08-2008, 01:01 PM.
        The Mexican

        Comment


          #5
          Re: Mixing javascript and Xbasic and other javascript questions ...

          Mario,

          If I undersatnd what you wrote, that is what I do. I do use the extra page, do processing there, and then link to another page where I can display a message. But what is missing is the ability to display a nice, smaller message ON TOP of the page, like a ui_msg_box or an alert box. I guess we could do something like that with some java script to display the message page in a smaller window. But there are problems with that, like not being able to center the popup window, and the user being able to click outside the popup and then lose where they are.

          Thanks for your thoughts on this. Am I on the right track??

          Gary
          Gary S. Traub, Ph.D.

          Comment

          Working...
          X