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

Calling xbasic from image event

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

    Calling xbasic from image event

    Is it possible to call an xbaic funciton from the onclick event locatten on an image in a tabbed ui builder
    <img src="United-Kingdom-Flag.png" style="width:px;height:px" onclick="alert('changing to English')">

    #2
    Re: Calling xbasic from image event

    sure, do an ajax callback (let the action js builder generate the code for you) What exactly is it you want to do ?
    Frank

    Tell me and I'll forget; show me and I may remember; involve me and I'll understand

    Comment


      #3
      Re: Calling xbasic from image event

      Hi Frank,

      I am having a Tabbed UI builder where I have placed two images in the footer section one with a Danish flag and one with an English flag and when the user is pressing the flag I want the JavaScript to call an xbasic function to change the active language, if i use the action builder i am getting this suggestion
      {grid.Object}.ajaxCallback(part,rowNum,xbasicFunction [,callbackURL [,additionalData]]);
      and I don't really know JavaScript, but in the help it is saying that the part should be 'G', 'S', 'D' for search grid or detail, but I am using the footer of the tabbed UI so what should i Use, i am including the definitions I have done in the builder
      uikonfig.pnguiedit.pnguifooter.pnguiresult.pngsetlang.png

      Comment


        #4
        Re: Calling xbasic from image event

        I'm not completely sure about this but I'm wondering is the standard method of using an Ajax Callback is not available in a Tabbed UI.

        If it is then... nevermind.

        However... here's another way of getting this done easily.

        http://www.youtube.com/watch?v=ZGpacC0pKiQ

        Here's the Header text I'm using...

        Code:
        <h1>Reservations</h1> Current language is : <span id="currLang"></span>
        I've got a span tag in there to show the language I've selected.

        Here's the Footer text I'm using...

        Code:
        Select your language by clicking the flag <img src="denmark.png" style="width:px; height:px; cursor:pointer;" onclick="setCurrLang('DK');">  <img src="canada.png" style="width:px; height:px;cursor:pointer;" onclick="setCurrLang('CA');">
        I'm using one javascript function with the language set as a parameter.

        The javascript function is...

        Code:
        function setCurrLang(lang){
        
        
        $('currLang').innerHTML = lang;
        
        A5.ajax.callback('setCurrLang.ajax.a5w','currLang=' + lang + '');
        
        
        }
        This function puts the selected language into the header and then does an A5.ajax.callback to an a5w page. The a5w page sets the session variables.

        This is the code in the setCurrLang.ajax.a5w page

        Code:
        <%a5
        
        	dim currLang as c = default "no language set"
        	session.__protected__activelanguage = currLang
        	session.mylanguage = session.__protected__activelanguage
        
        %>
        So... now there's an indication on the tabbed ui of which language is selected and the session vars are set.

        Comment


          #5
          Re: Calling xbasic from image event

          Thanks David, that is exactly what I wanted, and I think you are right that a normal Ajax callback wont Work in the Tabbed UI.

          Comment


            #6
            Re: Calling xbasic from image event

            Well there's no action js to create ajax callbacks in a tabbed ui but you can do it. See this article: http://wiki.alphasoftware.com/~alpha...+in+Alpha+Five
            Frank

            Tell me and I'll forget; show me and I may remember; involve me and I'll understand

            Comment


              #7
              Re: Calling xbasic from image event

              David,
              Could you please show code placed in the function OnTitlesRender mentioned in the video, I have tried to check debug and see what "e" contains and can't see the value that was set in the a5w page.

              There is also mention of below in the functions comments not sure if they apply.
              'Session - The Session object. Should be used instead of the older e.session construct
              ' - To set a session variable: Session.myNewSessionVariable = "Alpha"
              Regards,

              Kotin Karwak
              Developer Edition
              Version 12.3 Build 2684
              System Addins: Build 4438
              Build machine Windows Vista
              Skype: mateso08

              Comment


                #8
                Re: Calling xbasic from image event

                Kotin,

                Because the a5w page is setting a session variable... e.g.

                session.__protected__activelanguage = currLang

                Then that session variable is available from any of the server-side events of the grid I was calling.
                Depending on what you want to do, that session variable can also be made available to javascript through "publishing session variables".

                Specifically, in the onTitlesRender Server-side event, I only need to reference that session variable.

                Dim mylang as c = session.__protected__activelanguage

                Is this what you wanted?

                Comment


                  #9
                  Re: Calling xbasic from image event

                  I think I have messed up something in this test project.
                  Created the a5w file, created the code as shown, published all files but now getting this double error, when try and run.

                  exists a5w file but error shown when running app.jpg

                  live preview error, despite uploading all files

                  livepreview error.jpg
                  Regards,

                  Kotin Karwak
                  Developer Edition
                  Version 12.3 Build 2684
                  System Addins: Build 4438
                  Build machine Windows Vista
                  Skype: mateso08

                  Comment


                    #10
                    Re: Calling xbasic from image event

                    It looks like your session variable cannot be found in onTitlesRender because the A5W page that is establishing that session variable cannot be found and therefore is not run. You have to make sure your a5w page is available (published) to livepreview as well. Open it and run it in live preview... even though it might generate errors... at least it will be published to LivePreview.

                    Comment


                      #11
                      Re: Calling xbasic from image event

                      David,
                      Thanks for checking.
                      I think it is "user" error on my part but for the now can't still understand what I have done wrong.
                      Have gone through publishing each item on its own, first time round din't work. went back to the a5w file, open for edit, selected wsywig tab, it filled in html stuff around the a5w code, published, this time worked but did generate an error (assume this is fine).
                      Will retrace my steps to nail the publish requirements.
                      Regards,

                      Kotin Karwak
                      Developer Edition
                      Version 12.3 Build 2684
                      System Addins: Build 4438
                      Build machine Windows Vista
                      Skype: mateso08

                      Comment


                        #12
                        Re: Calling xbasic from image event

                        Hey Kotin,

                        I don't know what you're developing... for whom, etc... but... noticing your signature area... if you're not locked into Build 1856 for any reason I'd move on to the pre-release builds. There's some amazing stuff in there. Go to Help, View Release Notes to get a link to the pre-release builds.

                        I'd also move off Vista. At least make the move to Windows 7... if not Windows 8. I can't say 8.1 because I didn't make that move... seems too dangerous. But 7 or 8 is excellent.

                        Comment


                          #13
                          Re: Calling xbasic from image event

                          Will eventually upgrade but cautious in that I am more familiar in Vista Professional.
                          On the license, I am doubly cautious since I know that you only allowed to install two instances of the application. I already have one on yet another vista box and reading on the process of activation, I need to know for sure that I can "transfer" my install to any other machine, provided Alpha company can provide me a mechanism of declaringt o them that I need to "demote" an installation to be a trial version and move the license to another machine all together.
                          On the version I am running, I purchased the proficiency package that was for developer, server and runtime. Believe has a 1 year license in that I should be able to upgrade all releases with the said year.
                          When I go to check version, the app tells me that I am upto date, been meaning to ask how I upgrade the indeterminate releases...
                          Regards,

                          Kotin Karwak
                          Developer Edition
                          Version 12.3 Build 2684
                          System Addins: Build 4438
                          Build machine Windows Vista
                          Skype: mateso08

                          Comment


                            #14
                            Re: Calling xbasic from image event

                            Check version will always compare against the Official Release. For the pre-releases... Help, View Release Notes, click the link under The 'Pre-Release' Build. Select the install you want (I ususally do full_patch and appserver_patch). Make sure you install into wherever you have V12 installed. Help, About will then show you the current pre-release you have installed. It is 'pre-release' though... so... take that into consideration.

                            Comment


                              #15
                              Re: Calling xbasic from image event

                              Thanks, Had seen new videos in the blog section of alphasoftware and wondered when I would get hold of that release. Thanks for pointing me to this, hope other will also find this useful.
                              Regards,

                              Kotin Karwak
                              Developer Edition
                              Version 12.3 Build 2684
                              System Addins: Build 4438
                              Build machine Windows Vista
                              Skype: mateso08

                              Comment

                              Working...
                              X