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

get the value of a control in to the xbasic functions

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

    get the value of a control in to the xbasic functions

    my dialog sends a templated email to a customer, i thought it would be a good idea to allow the user to make any changes to the email before it is sent.

    Im sure there is a better way but so far this is what i have.
    • in the dialogs OnDialogInitiliaze event, i populate a text area control with the templated text.
    • the user can make any changes they want in the text area control.
    • a button on the dialog runs an xBasicFunction to send an email - this button does not submit the dialog


    i am trying to read the value of the control (which is not being submitted.)

    pm.message = e.control.email_template

    but the xBasicFunction can not find the e.contol.email_template, so how can i get access to the data on the control?

    i hope this makes sense.

    #2
    Re: get the value of a control in to the xbasic functions

    Try
    e.dataSubmitted.YOURCONTROLNAME
    or
    e._currentRowDataNew.YOURCONTROLNAME

    putting a debug(1) in your exbasic and exploring the e object helps a lot in these situations also. Seems I'm always digging around in there for stuff (alpha gold) haha.

    If you are using an Ajax callback it shouldn't matter if fields are bound or updateable. It still goes into the dataSubmitted part of the e object as near as I can tell. I just tested it by unbinding and setting a field to not updateable and it still put it in there.
    Last edited by -Jinx-; 03-13-2013, 01:21 PM. Reason: capitalize

    Comment


      #3
      Re: get the value of a control in to the xbasic functions

      thanks Jinx, e._currentRowDataNew.YOURCONTROLNAME worked fine.

      I had tried e.datasubmitted with no success.

      Comment


        #4
        Re: get the value of a control in to the xbasic functions

        ok, now i need to set the value of the control.email_template based upon the value of a field in the dialog.

        how do i get access to the value in the field 'Lead_Stage'?

        e.control - doesn't work
        e.datasubmitted - doesn't work
        e._currentrowdatanew - doesn't work

        this is in the onDialogInitialise event.

        thanks

        Comment


          #5
          Re: get the value of a control in to the xbasic functions

          Is "Lead_Stage" being populated from a table? If so, the table would need to be populated before you could set the value to the other control. You'll see that when you enter:
          e.control.email_template = "Fred"
          Into your oninitialize event it will work. If you don't have a value yet for the other field though, how can you set your email template to it?

          So, if you populate in your oninitialize event It MAY work to set this in your ondialogexecute event:
          e.control.email_template = e.rtc.control.lead_stage

          Or you could just do it with javascript on the client side.
          Last edited by -Jinx-; 03-13-2013, 05:08 PM.

          Comment


            #6
            Re: get the value of a control in to the xbasic functions

            the field lead_stage is already populated from a table when the dialog is loaded.

            I need access to this field but I keep getting a message that the sub element cant be found.

            my ondialoginitialise event needs to look like

            Code:
            if e.control.lead_stage = "New Lead" then
            e.control.email_template = "template here"
            end if

            Comment


              #7
              Re: get the value of a control in to the xbasic functions

              Richard,
              What I'm saying is: Isn't your populate action script in your initialize event?
              If so, maybe your control doesn't exist at that point. That's why I saiad to try the code in the other event.

              Otherwise, if you are calling this dialog from a grid or something and the options in the calling action are correct, what you're looking for might be in e._rtc. At least I think that's the name.

              I'll look when I get to work.

              Comment


                #8
                Re: get the value of a control in to the xbasic functions

                Really appreciate your help.

                it must be that the control I am trying to read 'Lead_Stage' isn't available when I initialize the grid, I also tried onDialogExecute. DialogValidate and AfterDialogValidate are no good for me as im not submitting the dialog at the time I need the script to run.


                Anyway I think I have a solution prompted by your comments.

                I had a hyperlink to show hide the control 'email_template' so I moved my script to an xBasic function and run this function with the same hyperlink as the show/hide which populates the control as expected.

                one small issue with this but I can live with it, when the hyperlink is pressed it shows and then immediately hides the control, maybe this is because it is also running the xBasic function, so the use has to press the hyperlink twice.

                Comment


                  #9
                  Re: get the value of a control in to the xbasic functions

                  With the link solution it may be a simple timing issue. You could add a timeout to make the show link part of the code wait until after the callback.

                  Ill still look for the .rtc variable when I get to work.

                  If you could attach a picture of your calling event that calls the dialog and your oninitialize event in your dialog, that would help.

                  Comment


                    #10
                    Re: get the value of a control in to the xbasic functions

                    I checked out one of my dialogs today.
                    If you have the button that calls the dialog action set to “Open Dialog Component to Edit the Current Record in a Grid Component or Enter a new record” your data should be under:

                    e.rtc._data

                    In the ondialoginitialize event.

                    So, this would "probably" work in there:
                    Code:
                    if e.rtc._data.lead_stage = "New Lead" then
                    e.control.email_template = "template here"
                    end if
                    This all depends on how you're calling the dialog though. If you can't do it the way I indicated above you could also pass an argument instead.

                    Comment


                      #11
                      Re: get the value of a control in to the xbasic functions

                      thanks, ill work on that.

                      the timeout worked great which I also needed for another post of mine you answered.

                      thanks for your help, this is a great little feature for our application, email templates are great but the users really wanted something they could amend and this gives us that.

                      Comment


                        #12
                        Re: get the value of a control in to the xbasic functions

                        No Problem,
                        I sent you a PM as well that should help you find variables in the future.

                        Comment

                        Working...
                        X