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

UX List Control - click field got to another page and set session variable

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

    UX List Control - click field got to another page and set session variable

    I have a list control and i have set one of the fields in the row to onClick. what i need to do is to set session variables first. in other components i have been using an xbasic function but i am unsure how i would achieve the same using a list control

    i did also look at adding a button to the list control but i am unsure how to set session variables and then redirect to another web page.

    from the list control
    Code:
    <div class="{dialog.style}ListItemLabelDetail" style="float: right;"><a href="crm.a5w" target="_self" onclick="$e.stopPropagation(event);" 
    		ontouchstart="$e.stopPropagation(event);">4 Tasks</a></div>
    i have used this in the past
    Code:
    function SetSessionVar as c (e as p)
    	
    	dim ds as p
    	ds = e.DataSubmitted
    	
    	dim session.caseparent as c = ds.CASE_PARENT_ID
    	dim session.clientfirstname as c = ds.CLIENTFIRSTNAME
    	dim session.clientsurname as c = ds.CLIENTSURNAME
    	dim session.clientname2 as c = ds.CLIENTFIRSTNAME2
    	dim session.clientsurname2 as c = ds.CLIENTSURNAME2
    	dim session.caseref as c = ds.CASEREF
    	dim session.clemail as c = ds.CLIENTEMAIL
    	dim	session.adviser as c = ds.ADVISER
    	dim	session.casemanager as c = ds.CASEMANAGER
    	dim session.casestage as c = ds.STAGE
    	dim	session.fileloc as c = alltrim(ds.FILELOCATION)+chr(92)+alltrim(session.clientsurname)+alltrim(session.caseref)
    	dim	session.UserType as c = "Staff"
    	
    	SetSessionVar = "location.href='crm.a5w';"
    
    end function

    #2
    Re: UX List Control - click field got to another page and set session variable

    i think i am on the right track

    List Control Click Event
    Code:
    var varCP= this.selectionData[0].Caseref;
    var varFN= this.selectionData[0].Clientfirstname; - [COLOR="#FF0000"]how can i get this second value in the call back below[/COLOR]
    {dialog.Object}.ajaxCallback('','','SetSessionVars','','__Caseref='+varCP);
    xbasic function
    Code:
    function SetSessionVars as c (e as p)
    	
    	session.caseref = e.__CASEREF
    '	session.caseparent = e.__CASE_PARENT_ID
    '	session.clientfirstname = e.__CLIENTFIRSTNAME
    '	session.clientsurname = e.__CLIENTSURNAME
    '	session.clientname2 = e.__CLIENTFIRSTNAME2
    '	session.clientsurname2 = e.__CLIENTSURNAME2
    '	session.clemail = e.__CLIENTEMAIL
    '	session.adviser = e.__ADVISER
    '	session.casemanager = e.__CASEMANAGER
    '	session.casestage = e.__STAGE
    '	session.fileloc = alltrim(e.__FILELOCATION)+chr(92)+alltrim(session.clientsurname)+alltrim(session.caseref)
    '	session.UserType = "Staff"
    
    	
    	SetSessionVars = "location.href='crm.a5w';"
    
    end function

    Comment


      #3
      Re: UX List Control - click field got to another page and set session variable

      Here you go...

      To add more variables you need a '&'

      Code:
      var varCP= this.selectionData[0].Caseref;
      var varFN= this.selectionData[0].Clientfirstname; - how can i get this second value in the call back below
      {dialog.Object}.ajaxCallback('','','SetSessionVars','','__Caseref='+varCP[COLOR="#FF0000"]+'&__Clientfirstname='+varFN[/COLOR]);
      Mike Brown - Contact Me
      Programmatic Technologies, LLC
      Programmatic-Technologies.com
      Independent Developer & Consultant​​

      Comment


        #4
        Re: UX List Control - click field got to another page and set session variable

        Thank you mike, that gets it working in the Rows OnClick event.

        What i really need is this to run from a button i have put in the row.

        I think i have set this up correctly (see pic) but it is returning an error that it cant find the values to be passed to the session variables. Does a button work differently to the row onclick?
        Attached Files

        Comment


          #5
          Re: UX List Control - click field got to another page and set session variable

          So it looks like instead of writing out the ajax callback by hand (like you did in post #2) you created an action javascript with an ajax callback to setsessionvars. But what I don't see is how are you then sending the variables?? In your viewCRM action JS you can switch it to text mode and then put the code from above in it.
          Mike Brown - Contact Me
          Programmatic Technologies, LLC
          Programmatic-Technologies.com
          Independent Developer & Consultant​​

          Comment


            #6
            Re: UX List Control - click field got to another page and set session variable

            i still have the code in xbasicfunctions as per post 2, i was able to refer to that from the Row OnClick Event and that worked fine but i didnt know how to do it from the button. i thought it would have been the same.

            Ill try this, appreciate the help.
            In your viewCRM action JS you can switch it to text mode and then put the code from above in it.

            Comment


              #7
              Re: UX List Control - click field got to another page and set session variable

              still can't get this to work, help please.

              In my xbasicfunction i have this
              Code:
              function SetSessionVars as c (e as p)
              	
              	session.caseref = e.__CASEREF
              	session.clientfirstname = e.__CLIENTFIRSTNAME
              	
              	SetSessionVars = "location.href='crm.a5w';"
              
              end function
              i have a button in a list control with this in the onclick event

              Code:
              var varCP= this.selectionData[0].Caseref;
              var varFN= this.selectionData[0].Clientfirstname;
              {dialog.Object}.ajaxCallback('','','SetSessionVars','','__Caseref='+varCP+'&__Clientfirstname='+varFN);

              Comment


                #8
                Re: UX List Control - click field got to another page and set session variable

                Here is a test component that I verified to be working...import it and run in working preview. I hope it is helpful.

                import_and_run_me.zip

                ScreenShot_2015.08.10_006_.png

                To debug your code try this...

                Code:
                var varCP= this.selectionData[0].Caseref;
                var varFN= this.selectionData[0].Clientfirstname;
                
                alert(varCP + varFN);
                
                {dialog.Object}.ajaxCallback('','','SetSessionVars','','__Caseref='+varCP+'&__Clientfirstname='+varFN);
                That should give you an alert with the list selection values. In your xbasic code place a debug in it and run the component in working preview to verify that the variables came over.

                EDIT: by the way I am running build 2999-4519. That shouldn't matter for this but just in case.
                Mike Brown - Contact Me
                Programmatic Technologies, LLC
                Programmatic-Technologies.com
                Independent Developer & Consultant​​

                Comment


                  #9
                  Re: UX List Control - click field got to another page and set session variable

                  mike, i really appreciate you taking the time to help. your list fires in the Row Select event, i am ok with this, where i am having the issue is trying to achieve the same from a button i have put in the list contol.

                  debugging with this returned no value
                  Code:
                  alert(varCP + varFN);
                  Attached Files

                  Comment


                    #10
                    Re: UX List Control - click field got to another page and set session variable

                    I missed the part about the button. We need to get a pointer to the list in this case.

                    Try this code in your list button..

                    Code:
                    var lstObj = {dialog.object}.getControl('[COLOR="#FF0000"]Your_List_Name_Here[/COLOR]');
                    
                    var varCP= [COLOR="#FF0000"] lstObj[/COLOR].selectionData[0].Caseref;
                    var varFN=  [COLOR="#FF0000"]lstObj[/COLOR].selectionData[0].Clientfirstname;
                    {dialog.Object}.ajaxCallback('','','SetSessionVars','','__Caseref='+varCP+'&__Clientfirstname='+varFN);
                    Mike Brown - Contact Me
                    Programmatic Technologies, LLC
                    Programmatic-Technologies.com
                    Independent Developer & Consultant​​

                    Comment


                      #11
                      Re: UX List Control - click field got to another page and set session variable

                      We need to get a pointer to the list in this case.
                      thanks mike, this makes sense now.

                      im sure this has done the trick, i just need to add in the other variables to test it.

                      Comment

                      Working...
                      X