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

Access Freeform layout value in dialog events

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

    Access Freeform layout value in dialog events

    Hi all,

    in my dialog i have a textbox in free form layout.
    how can i acces the value of textbox in form validate events?

    tried currentform.controls and textbox name directly.nothing turned up.

    Any one knows the syntax to access freeform layout controls value in dialog validate events?
    Thanks & Regards,
    RR


    Wonder rather than doubt is the root of all knowledge

    #2
    Re: Access Freeform layout value in dialog events

    How is the textbox defined? If it's just in HTML then I don't think you can access them in xbasic in the same way you can access normal dialog controls. However if you have defined the textbox as a control that is hidden, and then used the control with the {controlname} reference in the freeform layout, you should be able to reference it just fine. (e.g. currentform.controls.controlname)

    (And you can also set validation rules for the text control without having to write code in the event!)

    I have attached a sample of an edited dialog from the web app samples, with a hidden textbox control inside a freeform label control. In the Initialize event I can set the value of the textbox just fine :)

    Comment


      #3
      Re: Access Freeform layout value in dialog events

      Thanks andrea,

      I have gone through the attachment. really appreciate your effort .
      But In my case, its totally different. i have gone through the grid eg (customergridwithradiobutton) demo in web_application_demo . which is similat to your attachment.

      My situation is i have a dropdownlist(multiselect) and once the user select customers in DDL, im dynamically creating datetime picker based on their selection.
      eg, if i select three customers and click a button , i want to dynamically generate 3 datetime picker along with few more controls.so im using free form layout and dynamically creating HTMl controls based on number of selection..
      am succeed until here, now i want to submit the value entered by user in free form layout to database.
      am stucked up here.

      so i jus wonder is it possible to get free form layout values in form events?
      Thanks & Regards,
      RR


      Wonder rather than doubt is the root of all knowledge

      Comment


        #4
        Re: Access Freeform layout value in dialog events

        One thing to try is to put a few hidden controls into the dialog, check what they end up getting called in the HTML, and then add some Javascript to your dynamically generated HTML controls. Either that or just capture the values in the a5w page you submit to, much more flexible than trying to fit everything into a dialog. You should be able to reference page and session variables in the xbasic... However NOT in the validate event as I don't think the form is actually posted (so HTML control values won't be available to the SERVER) until it validates successfully...

        Another option would be to put in a button or link so they can add the values for each item selected (e.g. what you currently generate dynamically) in there, then you can use a dialog, grid, whatever you choose, and don't have to try and mix client side values & events (dynamic Javascript & HTML) with server side coding (xbasic).

        Comment


          #5
          Re: Access Freeform layout value in dialog events

          Originally posted by NoeticCC View Post
          One thing to try is to put a few hidden controls into the dialog,
          i dont think its possible coz user selection is multiple.so will be difficult to create hidden controls.

          may be i have to redesign my form completely in a5w page without using any component.or once the form is filled and saved must redirect and force user to fill grid that have the selected customers.(its wont satisfy the end user)

          Redesigning whole form in A5w page is gonna be a hectic job for me.

          Thanks again for the support .

          Sorry for diverting this qns to another topic.
          just curious to know that in grid while using freeformlayout or custom control.how to access the value of the data in their corresponding row.

          eg.i have 5 rows with 3 columnS( EMPNAME,DETAILS,FREEFORM(FILEUPLOAD CONTROL)) each row has fileupload option.when i upload file i want to upload the filename with EMPNAME in each row.

          but eventhough i use data.empname its taking value of 5th row(lastrow) for all the rows.

          can it be avoided?
          Thanks & Regards,
          RR


          Wonder rather than doubt is the root of all knowledge

          Comment


            #6
            Re: Access Freeform layout value in dialog events

            Originally posted by DOntquIT View Post
            i dont think its possible coz user selection is multiple.so will be difficult to create hidden controls.
            Just one hidden field would do the trick - as long as it is populated by each dynamic control's value with "|" separating the entries. You can then parse the entries in Xbasic at your comfort, although I am not convinced that the whole setup is anywhere near the most logical or straightforward solution.

            E.g. in the onchange event of each dynamic control, you fire Javascript that rattles through all dynamic fields and sets the value of a hidden control in that dialog to "FieldID=Value" for each control it finds, with | separating the entries.

            So for 3 fields you might get: "123=Blah1|234=Blah2|345=Blah3" as the value for the hidden field.

            Then in aftervalidate, put something like:

            Code:
            Dim ValueList as c
            ValueList = stritran(Currentform.Controls.hiddencontrol.value,"|",crlf())
            
            if ValueList <> "" Then
             *for_each(Entry,doHandleEntries(word(Entry,1,"="),word(Entry,2,"=")),ValueList)
            End If
            
            function doHandleEntries as c (ID as n, value as c)
             'Update record for ID# 'ID' with value 'value'
             '(Code obviously depends on whether it's SQL, DBF, what field types etc)
            end function
            Last edited by NoeticCC; 09-04-2008, 06:44 AM.

            Comment


              #7
              Re: Access Freeform layout value in dialog events

              Originally posted by NoeticCC View Post
              Just one text field would do the trick - as long as it is populated by each dynamic control's value with "|" separating the entries.
              how can i get the value of dynamic created textbox eg(txtname)
              in my hidden control?
              Thanks & Regards,
              RR


              Wonder rather than doubt is the root of all knowledge

              Comment


                #8
                Re: Access Freeform layout value in dialog events

                Originally posted by DOntquIT View Post
                how can i get the value of dynamic created textbox eg(txtname)
                in my hidden control?
                Javascript in the onchange event for the dynamic textbox - the same as you would in a plain HTML page...

                You can't directly access dynamically created content in Xbasic because the content is generated on the client and Xbasic runs on the server, but with a bit of Javascript you can at least populate a hidden dialog control OR look into AJAX calls...

                It does sound though like you should either look into dialog-only solutions, or put all the code and form elements into an a5w page (look at some of the AJAX examples that ship with Alpha5V9 here: http://afas.alphasoftware.com/SamplePagesV9/#whatsnew) if you *must* include such complex non-dialog elements as dynamic HTML areas.

                Comment


                  #9
                  Re: Access Freeform layout value in dialog events

                  will go through the examples and come up with some designs

                  Thanks again andrea
                  Thanks & Regards,
                  RR


                  Wonder rather than doubt is the root of all knowledge

                  Comment


                    #10
                    Re: Access Freeform layout value in dialog events

                    Originally posted by DOntquIT View Post
                    will go through the examples and come up with some designs

                    Thanks again andrea
                    You're welcome, it sounds like you are having similar problems as I had when I first started with alpha5 - I was trying to use dialogs and grids (rather than the more flexible a5w pages) but at the same time I kept reverting to the more elaborate methods of web coding that I had been using in PHP and Javascript/HTML only pages in the past.

                    Eventually I learnt to gauge better which types of tasks are easier to solve in a5w pages + AJAX and which are easier to sort in dialogs and grids :)

                    -------------

                    As for the file upload, have a look at how this is done on this forum - with a popup window, so you don't have to submit the whole form to upload a single file.

                    Comment


                      #11
                      Re: Access Freeform layout value in dialog events

                      Originally posted by NoeticCC View Post
                      You're welcome, it sounds like you are having similar problems as I had when I first started with alpha5 - I was trying to use dialogs and grids (rather than the more flexible a5w pages) but at the same time I kept reverting to the more elaborate methods of web coding that I had been using in PHP and Javascript/HTML only pages in the past.

                      Eventually I learnt to gauge better which types of tasks are easier to solve in a5w pages + AJAX and which are easier to sort in dialogs and grids :)

                      -------------

                      As for the file upload, have a look at how this is done on this forum - with a popup window, so you don't have to submit the whole form to upload a single file.
                      yes.im more comfortable using a5w page for designs. i designed a form completely on a5w page along with xbasic code for backend activities and java script for validations.that is mere perfect and im very much comfortable with that form.

                      but for some reason i cant re-design this form in a5w page now.Might as well i break form into two pages and settle this issue.haven't step in to AJAX yet..curious as well to see the features..
                      Thanks & Regards,
                      RR


                      Wonder rather than doubt is the root of all knowledge

                      Comment

                      Working...
                      X