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

code in a5w pages

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

    code in a5w pages

    i am just starting with code on a5w pages and am a bit stuck.

    i have an image on a page which has a hyperlink attached. i want to ammend the hyperlink to send the user to a page based upon the value of a field. i have this code so far

    Code:
    <%A5
    
    if stage= "lead"
    ? "<A HREF=\"lead_client1.a5w">"
    
    else
    
    if stage<> "lead"
    ? "<A HREF=\"client1.a5w">"
    end if
    %>
    i right click on the image, insert xbasic. but i cant see where this code has been inserted or if it is attached to the image.

    apologies for my dumbness, im not even sure if i am on the right track.

    #2
    Re: code in a5w pages

    Far as I can tell from testing, if you right-click on an image and select Inset A5W Code, nothing happens, no code is applied anywhere.

    Your syntax when done, should look like this:

    HTML Code:
    <%a5
    if stage= "lead"
     ?"<a href=\"mypage.a5w\"><img src=\"images/myimage.jpg\" ></a>"
    else
     ?"<a href=\"myotherpage.a5w\"><img src=\"images/myimage.jpg\" ></a>"
    end if
    %>
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: code in a5w pages

      steve,

      thanks once again for your help.

      when its put in front of me like that it looks so easy.

      thanks

      richard

      Comment


        #4
        Re: code in a5w pages

        ok, not as easy as i thought...

        got the code in the page ok, but am getting an error

        500 Internal Server Error
        "Script Error
        Error:Script: /mort_mngr/summary.a5w line:92
        if stage= "lead"
        Variable "stage" not found."
        i tried to define the variable on the page, just inside the first <%a5 in the head.

        Code:
        dim session.stage as c = ""
        the field 'stage' i have put inside a grid on the page.

        tried looking at the help files but not getting much success. don't know where to go from here.

        Comment


          #5
          Re: code in a5w pages

          stage and session.stage are two different variables. Either dim stage or use session.stage in your if condition.

          Lenny Forziati
          Vice President, Internet Products and Technical Services
          Alpha Software Corporation

          Comment


            #6
            Re: code in a5w pages

            thanks lenny,

            ill give that a try.

            Comment


              #7
              Re: code in a5w pages

              still struggling im afraid.

              i no longer have the error '500 internal script', but the code is not working.

              on the test record, the field 'stage' is set at a value of 'lead' but when i click the link i am being taken to the incorrect page. here is the full page code, i have highlighted red the code in question.

              the field 'stage' is in a web component which is inserted on this page.

              Code:
              <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd">
              <html>
              <head>
              
              <%a5
              
              [COLOR="darkred"]dim stage as c = ""[/COLOR]
              
              Delete tmpl_case_name
              DIM tmpl_case_name as P
              tmpl_case_name = a5w_load_component("case_name")
              'Following code allows you to override settings in the saved component, and specify the component alias (componentName property).
              'Tip: Keep the componentName property short because this name is used in page URLs, and it will help keep the URLs short.
              'Each component on a page must have a unique alias (componentName property).
              with tmpl_case_name
              	componentName = "case_name"
              end with 
              '=======================================compute the HTML for the Component=======================================
              delete x_case_name
              dim x_case_name as p
              x_case_name = a5w_run_Component(tmpl_case_name)
              '=============================================================================================================
              if x_case_name.RedirectURL <> "" then 
              	response.redirect(x_case_name.redirectURL)
              	end
              end if 
              ?x_case_name.Output.Head.JavaScript
              ?x_case_name.Output.Head.CSS_Link
              %>
              <!--Alpha Five Temporary Code Start - Will be automatically removed when page is published -->
              <!--CSS for tmpl_case_name -->
              <link rel="stylesheet" type="text/css" href="file://///Server01/Company/Mortgage Manager/Mortgage Manager.WebProjects/Default.WebProject/css/mortmanager/style.css">
              <!--Alpha Five Temporary Code End -->
              
              <meta http-equiv="content-type" content="text/html; charset=utf-8">
              <title>Direct Mortgage Centre :: Track</title>
              <meta name="Description" content="Direct mortgage centre specialise in helping people who require cash, re-mortgage, no proof of income, 
               past credit problems. Call us today. ">
              <meta name="keywords" content=" direct mortgage centre, mortgage, mortgages, dmc, ccj's, poor credit, debt, self employed, re-mortgage, , no upfront fees, low payments, loan, loans, lenders, re mortgage, no proof of income, require cash">
              <link href="default.css" rel="stylesheet" type="text/css">
              <style type="text/css">
              .style2 {
              	text-align: center;
              }
              </style>
              </head>
              <body>
              <table width="739" border="0" align="center" cellpadding="0" cellspacing="0" id="wrapper">
              	<tr>
              		<td>
                          <table width="739" border="0" align="center" cellpadding="0" cellspacing="0">
                              <tr valign="top">
                                  <td width="191" align="left"><img height=121 alt="" src="images/homepage02.jpg" width=191></td>
                                  <td width="548" id="menu">
                                      <ul>
                                          <li class="first"><a href="http://www.directmortgagecentre.com/index.html">Home</a></li>
                                          <li><a href="summary.a5w"><font color="#012e6d"><u>Summary</u></font></a></li>
                                          <li><a href="client1.a5w">My Details</a></li>
                                          <li><a href="track.a5w">My Track</a></li>
                                          <li><a href="http://www.directmortgagecentre.com/contact.html">Contact&nbsp;</a></li>
                                          <li><a href="logout.a5w">Log Out</a></li>                        </ul>
                                  </td>
                              </tr>
                          </table>
              			<table width="739" border="0" align="center" cellpadding="0" cellspacing="0" id="inside_page">
              			  <tr>
                              <td valign="top">
                                  <table width="548" border="0" cellpadding="0" cellspacing="0" id="search" align="right">
                                      <tr valign="top">
                                          <td><form name="form1" method="post" action="">
                                                  <ul>
                                                      <li>
                                                          <label for="text3">Search our site:</label>
                                                          <input name="text3" id="text3" class="text" >
                                                          <input type="image" name="button2" id="button2" src="images/homepage07.gif" width="20" height="19" >
                                                      </li>
                                                  </ul>
                                              </form></td>
                                      </tr>
                                  </table>                </td>
                            </tr>
              			  <tr>
              			    <td valign="top">
                              	<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
                                    <tr>
                                      <td valign="top">
                                      <h1>my Track<%A5 ?x_case_name.Output.Body.Grid_HTML %>  <br></h1><br>
              							
              							<div class="style2">
              							
              							<h3>Welcome to Track,</h3> your personalised home page.  View and edit your details, 'Track' the 
              								progress of your applications
              							and manage your profile and settings.<br><br>
              							
              							
              [COLOR="DarkRed"]<%a5 
              if stage= "lead"
               ?"<a href=\"lead_client1.a5w\"><img src=\"images/mydetails.jpg\" ></a>"
              else
               ?"<a href=\"client1.a5w\"><img src=\"images/mydetails.jpg\" ></a>"
              end if
              %>[/COLOR]
              								<a href="track.a5w"><img src="images/my_track.jpg">
              								
              								
              								
              								</div></a></td>	
              							
                                    </tr>
                                  </table>
                              </td>
              		      </tr>
              			</table>
              <table width="739" border="0" align="center" cellpadding="0" cellspacing="0">
              				<tr>
              					<td valign="top" id="links"><p><a href="http://www.directmortgagecentre.com/terms.html">Terms of Use</a> &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp; <a href="http://www.directmortgagecentre.com/legal.html">Legal Information</a> &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp; <a href="http://www.directmortgagecentre.com/privacy.html">Privacy Policy</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp; <a href="http://www.directmortgagecentre.com/jobs.html">Jobs</a></p></td>
              				</tr>
              			</table></td>
              	</tr>
              </table>
              <table width="739" border="0" align="center" cellpadding="0" cellspacing="0" id="footer">
              	<tr>
              		<td valign="top"><p>Copyright (c) 2008 Direct Mortgage Centre. All rights reserved. 
                      | Design by <a href="http://www.designplusweb.co.uk">Design+</a></p></td>
              	</tr>
              </table>
              </body>
              </html>
              thanks

              richard

              Comment


                #8
                Re: code in a5w pages

                i have been trying to fix this, what i have concluded through trial and error is that in the code

                Code:
                <%a5 
                if stage= "Lead"
                 ?"<a href=\"lead_client1.a5w\"><img src=\"images/mydetails.jpg\" ></a>"
                else
                 ?"<a href=\"client1.a5w\"><img src=\"images/mydetails.jpg\" ></a>"
                end if
                %>
                regardless of the value of the field 'stage', the first link is being ignored and the WAS is processing the second instruction (the else code).

                hope this helps towards a solution.

                Comment


                  #9
                  Re: code in a5w pages

                  I see what you are doing. You have a component (a Grid) on your page which (you think) is setting the value of 'stage', and then a link on the same page made up with this xbasic.

                  As you suspect by now, ain't going to work. Your A5W page has no idea what you have done in the component until you click Submit. To make it worse, since you are using a Grid, the field named "Stage" is not named stage at the page level, it would be "V.R1.Stage" or similar. But that doesn't matter since it won't work anyway.

                  What are you trying to accomplish? Do you need to gather some information including the value of Stage, and then take them to a new page based on that? You need to put this in a Dialog if that is the case (or, its easier if you do). Then you would take them to the appropriate page using CurrentForm.RedirectTarget = "mypage.a5w", but of course using an expression to choose the correct page based on 'stage'.
                  Steve Wood
                  See my profile on IADN

                  Comment


                    #10
                    Re: code in a5w pages

                    steve,

                    thanks, i would have been on this for days.

                    i am trying to achieve this.

                    a client logs on (using security and a filter and argument in the grid)
                    they are taken to a page 'summary.a5w' (their personal home page)
                    then dependent on the value of their field stage, then need to be redirected to one of 2 pages. i ideally would like to keep this code attached to an image.

                    there is no other data at this point thats needs collecting and the client can not set the value of the field 'stage'.

                    ill give this a go with page.redirect.

                    Comment


                      #11
                      Re: code in a5w pages

                      Then on your summary page, add a simple Dialog component that asks Stage, and then uses the CurrentForm.RedirectTarget command on the AfterValidate to direct them to the proper page when they click Submit. If you really want this on an image, you have to figure out how to replace the Submit button with an image. (Which probably isn't too difficult.)
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: code in a5w pages

                        steve,

                        the field stage is already set and the client can not change its value.

                        the other solution to this is to progmatically change the users security group based upon the value of the field' stage' being changed by a user on the desktop. then i can just set the permission in the component. i have had a good look but not sure if i can and how to do this, which is why i went down the route of 2 lots of pages, one read only and the other updateable.

                        Comment

                        Working...
                        X