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

ajax tutorials - am i missing something

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

    #16
    Re: ajax tutorials - am i missing something

    Hi Andrea,

    just waiting for your bill to arrive on my doorstep for all of your time:p

    ok, im getting somewhere i think and would like a little more clarification.

    .ajax.a5w dimensions the fields to be used in the .a5w page and identifies the table????

    the .a5w page displays and manipulates the data stored in the ajax.a5w page?????

    i have looked at the cascading lookup pages and noticed that no web component exists. i have no issue with this as i prefer the look of the page.

    a question or two though,

    if i were to follow this method of not using components, would i need putting in to the same hospital as Hurley ('Lost' fan), for all of the additional work required?

    one thing in particular i am thinking of, if i dont use web components, is linking pages to the same record. would this be accomplished in xbasic in a similiar way to linking forms on the desktop.

    Comment


      #17
      Re: ajax tutorials - am i missing something

      Originally posted by richard2007 View Post
      Hi Andrea,

      just waiting for your bill to arrive on my doorstep for all of your time:p
      LOL no worries, I'm learning as I go along myself... others asking questions kind of helps me untangle things a bit!

      .ajax.a5w dimensions the fields to be used in the .a5w page and identifies the table????
      Even more.. it is just for the most part an a5w page with a few extra bits added on, it is the page where you lay out what is to be displayed to the user...

      the .a5w page displays and manipulates the data stored in the ajax.a5w page?????
      More that the ajax.a5w page manipulates the elements on the a5w page.

      i have looked at the cascading lookup pages and noticed that no web component exists. i have no issue with this as i prefer the look of the page.
      Yes none of the samples contain components for the AJAX elements. You can however address HTML form elements in components too - you just have to look at the HTML generated by the component to figure out the names of these components. (This is what I have done in the user admin sample I sent you)

      if i were to follow this method of not using components, would i need putting in to the same hospital as Hurley ('Lost' fan), for all of the additional work required?
      LOL I hope not - I haven't tried generating grids like this yet (it's fast enough for us right now without AJAX), but for simple smaller forms it's fairly easy to get the hang of, and in my case finally kicked me into starting to use Xbasic in web pages after a few months of pottering about.

      one thing in particular i am thinking of, if i dont use web components, is linking pages to the same record. would this be accomplished in xbasic in a similiar way to linking forms on the desktop.
      Look at the sample grid in the WAS Samples - you can generate and populate forms on the fly using various functions... you could also try out the custom elements in grids to generate links that use AJAX to display details for a record in a grid for example...

      Comment


        #18
        Re: ajax tutorials - am i missing something

        below is adapted codefrom the pages for the suggestionlist.

        code for .a5w page called contactdbf.a5w
        Code:
        <html>
        <head>
        
        <%a5
        Response.charset = "ISO-8859-1"	'set the charset of the response to ISO-8859-1
        %>
        
        
        
        <script type="text/javascript" src="javascript/core.js"></script>
        <script type="text/javascript" src="javascript/AjaxFormLibrary.js"></script>
        <script type="text/javascript" src="javascript/aui.js"></script>
        <script type="text/javascript" language="javascript">
        <!--
        //-->
        </script>
        
        
        
        <link rel="stylesheet" type="text/css" href="css/A5System/default/theme.css">
        <link rel="stylesheet" type="text/css" href="css/Corporate/style.css">
        <link rel="stylesheet" type="text/css" href="css/Corporate/components/a5SimpleForm/style.css">
        
        <style>
        td, p {font-family:Verdana,Arial,Helvetica,sans-serif;font-weight:normal;font-style:normal; font-size: 8pt}
        </style>
        
        
        <title>Dropdown Suggestion Lists</title>
        
        
        </head>
        
        
        <body class="CorporatePageBODY">
        
        
        <p>In this example, you can type into the lastname field. When you make a selection from the suggestions, the data in the other fields for the selected customer are filled in by making a second Ajax callback.</p>
        
        
        <table>
        <tr><td>Last name</td><td><input id="f_lastname" name="f_lastname" 
             ></td></tr>
        <tr><td>First name</td><td><input id="f_firstname" name="f_firstname" 
             ></td></tr>
        <tr><td>Address</td><td><input id="f_address" name="f_lastname" 
             ></td></tr>
        <tr><td>City</td><td><input id="f_city" name="f_city" 
           ></td></tr>
        <tr><td>State</td><td><input id="f_state" name="f_state" 
           ></td></tr>
        </table>
        
        <script type="text/javascript">
        var customerSuggest = new a5_AJAX_autoSuggest('f_lastname',{
        	url: 'contact.ajax.a5w',
        	data: 'action=getCustomerList', 
        	minimum:1, 
        	width:'', 
        	columns:['Lastname','Firstname'], 
        	className:'A5SuggestionList', 
        	item:
        		{ selectedClassName:
        		'A5SuggestionListEntrySelected', keyClassName:
        	'A5SuggestionListKey'
        	}, 
        	title:
        		{ className:
        		'A5SuggestionListColumnTitle', 
        		location:'none'
        	}, onSelect:function(val){
        		a5_AJAX_Callback('contact.ajax.a5w','action=FillInCustomer&caseref='+val[2]); //val[2] is the value from the 3rd column in the item selected. (0 based array)
        	}
        });
        </script>
        
        
        </body>
        </html>
        code for ajax.a5w page called contact.ajax.a5w
        Code:
        <%a5
        
        dim action as c = default ""
        
        
        
        dim dbf_folder as c 
        dbf_folder = _A5_Aliases.get("PathAlias.ADB_Path")
        DIM tableFilename as c 
        tableFilename = a5_removetrailingbackslash(dbf_folder) + chr(92) + "casefile.dbf"
        
        
        if action = "getFilteredClientList" then 	
        
        	dim clientName as c = default ""
        	dim clientfirstName as c = default ""
        	
        	if ClientName <> "" .and. clientfirstName <> "" then
        		dim tbl as p 
        		tbl = table.open(tableFilename)
        		dim itbl as p 
        		itbl = tbl.order("clientsurname","left(clientsurname," + len(clientName)+")=" + s_quote(clientName) + " .and. clientfirstname = " + quote(clientfirstname))
        		
        		result = tbl.record_content_get("alltrim(clientsurname) + '||||' + alltrim(clientfirstname)")
        		tbl.close()
        		'just take the first 15 entries in the list
        		result = word(result,1,crlf(),15)
        		result = alltrim(remove_blank_lines(result))
        		
        		'convert the |||| delimited string into a Javascript array of the form ['item1','item2']
        		result = *for_each(x,"['"+strtran(strtran(x,"'","\'"),"||||","','")+"']",result)
        		'convert the crlfs to commas so that we have a Javascript array of arrays.
        		result = "["+rtrim(strtran(result,crlf(),","),",")+"]"
        		?"clientNameFilteredSuggest.populateList("+result+");"
        	end if
        
        else if action = "FillInCustomer" then 
        
        	dim tbl as p 
        	dim tableCustomers as c 
        	tableCustomers =  a5_removetrailingbackslash(dbf_folder) + chr(92) + "casefile.dbf"
        	tbl = table.open(tableCustomers)
        	dim itbl as p 
        	dim customer_id as c = default ""
        	itbl = tbl.order("","caseref = " + s_quote(caseref))
        	if itbl.records_get() > 0 then 
        		dim result as c = ""
        		result = result +  "$('f_firstname').value = '" + jsescape(tbl.firstname) + "';"  + crlf()
        		result = result +  "$('f_address').value = '" + jsescape(tbl.housenumber) + "';"  + crlf()
        		result = result +  "$('f_city').value = '" + jsescape(tbl.address) + "';"  + crlf()
        		result = result +  "$('f_state').value = '" + jsescape(tbl.postcode) + "';"  + crlf()
        		?result
        	else
        		?"alert('customer not found: " + caseref + "');"
        	end if 
        	tbl.close()
        
        end if
        
        function jsEscape as c (txt as c)
        	jsEscape = stritran(txt,"'","\'")
        	jsEscape = stritran(jsEscape,crlf(),"\n")
        
        end function 
         
        
        %>
        the table this is based upon is called casefile, the fields in the table are called caseref, clientfirstname, clientsurname, housenumber, address and postcode.

        i am getting an error on the .a5w page
        a5_ajax_autosuggest is undefined
        the page loads but does not execute the function.

        any ideas?

        Comment


          #19
          Re: ajax tutorials - am i missing something

          ...page loads but does not execute the function.

          any ideas?
          Did you clear out the publishing history completely and re-publish? It looks like you have the right .js files linkes etc... but sometimes the Javascript doesn't get published...
          Also, if you publish the WAS samples to your own WAS or localhost, do they work as they should? Just checking cos it's very possible it didn't publish completely and there is nothing wrong with your code :)

          Comment


            #20
            Re: ajax tutorials - am i missing something

            i cleared the publishing history, i even deleted all files form the webroot relating to the app.

            re published and the ajax wont work in my app or in the validation or selection samples.

            i have downloaded the latest patch available tonight and that hasntchanged anything. i am running vista, could this be the problem.

            everytime i click on an .a5w page with ajax in it, in the web control panel i am getting quite a few errors.

            Comment


              #21
              Re: ajax tutorials - am i missing something

              errors are

              ajax_accordian undefined
              ajax_suggestion undefined

              object expected on some pages

              Comment


                #22
                Re: ajax tutorials - am i missing something

                Originally posted by richard2007 View Post
                i cleared the publishing history, i even deleted all files form the webroot relating to the app.

                re published and the ajax wont work in my app or in the validation or selection samples.

                i have downloaded the latest patch available tonight and that hasntchanged anything. i am running vista, could this be the problem.

                everytime i click on an .a5w page with ajax in it, in the web control panel i am getting quite a few errors.
                Do the samples at afas.alphasoftware.com work for you from the same browser?

                Comment


                  #23
                  Re: ajax tutorials - am i missing something

                  Originally posted by richard2007 View Post
                  errors are

                  ajax_accordian undefined
                  ajax_suggestion undefined

                  object expected on some pages
                  Which browser are you using? Also, while the AjaxForms javascript shouldn't be present in your Program Files/A5V9/Javascript directory, can you just check which .js files get published to the /Javascripts directory in the webroot of wherever you publish to?

                  Comment


                    #24
                    Re: ajax tutorials - am i missing something

                    the samples i am having errors with dont work at afas.alphasoftware.com.

                    using ie7. ill check the publised files tonight against those in the demo file and see if there is a difference.

                    Comment


                      #25
                      Re: ajax tutorials - am i missing something

                      Originally posted by richard2007 View Post
                      the samples i am having errors with dont work at afas.alphasoftware.com.
                      If they don't work on the afas site then the problem is likely to be in your browser, have you got Javascript enabled? I am running IE7 and only get a JS error on a couple of pages in Opera and Firefox, and even that only if I first open one of the "hidden" tutorial windows.

                      Comment


                        #26
                        Re: ajax tutorials - am i missing something

                        some of the java samples are working, its probably the javascript libraries not publishing. ill check and feedback.

                        Comment


                          #27
                          Re: ajax tutorials - am i missing something

                          Originally posted by richard2007 View Post
                          some of the java samples are working, its probably the javascript libraries not publishing. ill check and feedback.
                          OK thanks - still weird that the afas samples don't seem to be working for you either!

                          Comment


                            #28
                            Re: ajax tutorials - am i missing something

                            java is enabled on the web browser, i re published the entire web app demo and still getting the errors.

                            can alpha give me any help, maybe its a bug.

                            Comment


                              #29
                              Re: ajax tutorials - am i missing something

                              Originally posted by richard2007 View Post
                              java is enabled on the web browser, i re published the entire web app demo and still getting the errors.

                              can alpha give me any help, maybe its a bug.
                              If the pages here: http://afas.alphasoftware.com/SamplePagesV9/ give you the same errors too, as you seemed to suggest before, then it's unlikely to be a bug as they work fine for other users.

                              Did you check the published Javascript files?

                              Comment


                                #30
                                Re: ajax tutorials - am i missing something

                                re checked, the sample pages are working ok. i am still getting an error a5_ajax_autosuggest is undefined in my own project.

                                Comment

                                Working...
                                X