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

setValue not really working

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

  • #16
    Re: setValue not really working

    Good Morning Selwyn,

    that makes sense. I should have known or at least tried something else out. I am learning something new each day and that is actually really fun. The textbox works for me just as well.
    So thanks a million for your help!

    Comment


    • #17
      Re: setValue not really working

      Based on this thread, we have decided to make the following change to .getValue() when it is used on a Label.

      This will be in the next update:


      Dialog .getValue() on a Label Control - Would always return the original value of the label (even if the label's value had been previously changed using the .setValue() method. This is now fixed so that .getValue() will always read the label value from the control itself.

      The reason that .getValue() previously worked they way it did was that, generically, the .getValue() method returns the control value from the .originalValues[] array in the Dialog Object if the control is NOT dirty, but reads the control value from the control itself if the control is dirty. When you use .setValue() on a Label, the control does NOT go dirty (because a Label control has no concept of being 'dirty' since it is not an input control).

      Comment


      • #18
        Re: setValue not really working

        Thank you for the update!

        Comment


        • #19
          Re: setValue not really working

          Originally posted by gamma View Post
          Hi Selwyn,

          I have another question concerning your post #9.
          After clicking on the submit button I process the insert and updates in the server side Event "afterDialogValidate". I want that after the event is finished all data now is in e.oldDataSubmitted. so when the user enters some more data and clicks submit again I only find the fields dirty the user changed since the first submit.
          I tried adding
          Code:
          {dialog.object}.refreshClientSideComputations();
          in the client side event "afterValidate" but that did not help. In
          Code:
          e.repeatingSectionInfo["CONTAINER_1"].dirtyFieldsInSection
          I always find all fields dirty the user has changed since the first time he opend the Window. is there anything similar to "{dialog.object}.refreshClientSideComputations();" I can use in XBASIC in the afterDialogValidate Server side event in order to achieve the same thing?
          Thank you!!
          Hi Selwyn,

          do you by any chance have an anser to my issue in The post #12 (quote above)?
          Thank you very very very much!

          Comment


          • #20
            Re: setValue not really working

            What I think you are asking is how to set the Dialog state in the afterValidate event so that the NEXT time it is submitted, the values from the PREVIOUS submission are in the e.oldDataSubmitted object.
            If that is indeed your question, then this video might help you understand more about the issue.


            http://www.ajaxvideotutorials.com/V1...idateEvent.swf

            I am also not sure what you were hoping to achieve by calling the .refreshClientSideComputations() method. This method simply causes the client side calculations (calc fields, show/hide expression, enable expressions, summary value calculations) to be recomputed. It would have no bearing on set dirty fields, or initial field values.

            Comment


            • #21
              Re: setValue not really working

              Thank you Selwyn! That was exactly what I was looking for!
              Your videos always are great!

              I have another issue with populating the repeating section.
              So the first time a user opens the dialog the Repeating Section has a defined amount of rows , let's say 8. When he clicks the back button the number of rows can change and with it the data of the repeating Section.

              So when the dialog is initialized Following JavaScript code is executed:
              Code:
              {dialog.Object}._setRepeatingSectionRowCount('CONTAINER_1', 8,true,false);
              var _d= {};
              _d['project:1'] = 12;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE1').title = '12';
              _d['project:2'] = 23;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE2').title = '23';
              _d['project:3'] = 31;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE3').title = '31';
              _d['project:4'] = 26;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE4').title = '26';
              _d['project:5'] = 27;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE5').title = '27';
              _d['project:6'] = 29;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE6').title = '29'';
              _d['project:7'] = 30;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE7').title = '30';
              _d['project:8'] = 28;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE8').title = '28';
                {dialog.object}.populate(_d);
                {dialog.object}.prepare();
              The first column (project) populates correctly. So the user clicks the back button the following code is fired
              Code:
              {dialog.Object}._setRepeatingSectionRowCount('CONTAINER_1', 10,true,false);
              var _d= {};
              _d['project:1'] = 12;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE1').title = '12';
              _d['project:2'] = 23;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE2').title = '23';
              _d['project:3'] = 31;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE3').title = '31';
              _d['project:4'] = 24;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE4').title = '24';
              _d['project:5'] = 25;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE5').title = '25';
              _d['project:6'] = 26;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE6').title = '26';
              _d['project:7'] = 27;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE7').title = '27';
              _d['project:8'] = 29;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE8').title = '29';
              _d['project:9'] = 30;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE9').title = '30';
              _d['project:10'] = 28;
              $('{dialog.componentName}.V.R1.PROJECT_A5INSTANCE10').title = '28';
                {dialog.object}.populate(_d);
                {dialog.object}.prepare();
              In the beginning I had this column as a dropdown Box in order to give it the Id and let it show the corresponding text instead. So I thought that might be the problem and changed it to a textbox in order to see the IDs. Here is what I see:
              A5_populateProjectRS.jpg

              It seems like any position/row containing already a value, does not change and just the tow new Rows are populated correctly. The titles/tooltips on the other hand work as intended. In this case the tooltip shows the correct value but the textbox does not. What did I do wrong here?
              The second code block is generated by an Ajax Callback.
              Thanks again!

              Comment


              • #22
                Re: setValue not really working

                it is really difficult (actually impossible for me) to answer a question like this without having a test component that demonstrates the issue.
                if i have a test component i can run it, duplicate the issue, and suggest a solution.

                thanks.

                Comment


                • #23
                  Re: setValue not really working

                  Hi Selwyn,

                  of course your right. So I created a test component, as you are missing the database backend, and it worked. It took me a while to figure out why. It had to be something in my original component that was not in the test component, that was causing the problem. And I just found it. It was an error on my side. I was missing a variable declaration in JS
                  Code:
                  	var _d = {};
                  So the populate method called afterwards did no longer do what I wanted.
                  Sorry about the confusion, but my current save issues do lead to loss of code.

                  So thank you for your help. From now on I will always build a test component if I have a problem and if that does not work then I will ask.
                  Have good start into the new week!
                  Last edited by gamma; 01-30-2012, 06:11 AM. Reason: Not the case after all

                  Comment


                  • #24
                    Re: setValue not really working

                    Sorry if I hitch hike on this related thread, but I need the Dialog2 equivalent to these two Grid functions:

                    {grid.object}._setDetailViewState(true);
                    {grid.object}._setRowState(1,true);

                    I need to use an external js command to set the Dialog2 dirty (enable the Submit button) without setting values on the form. But I want it to start out with the Submit button disabled as normal. My method works for the Grid using the two functions above.
                    Steve Wood
                    Join the ALPHA DEVELOPERS NETWORK
                    There is no Cloud. It's just someone else's computer.
                    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
                    AlphaToGo | IADN (100% Alpha Anywhere Websites)

                    Comment


                    • #25
                      Re: setValue not really working

                      the submit button on a dialog is just a standard button that comes with a pre-defined client-side enable expression. if you want the button to be enabled regardless of the dialog state then just remove the client side enable expression.

                      if you don't want to do that then just set some control to a new value and then set it back to its original value.

                      e.g.

                      var x = {dialog.object).getValue('FIELD1');
                      {dialog.object}.setValue('FIELD1','JUNK');
                      {dialog.object}.setValue('FIELD1',x);

                      Comment


                      • #26
                        Re: setValue not really working

                        Thank you. I will add a dummy filed to the dialog and use method 2.
                        Steve Wood
                        Join the ALPHA DEVELOPERS NETWORK
                        There is no Cloud. It's just someone else's computer.
                        Web - Mobile - Hosting - Products - Frameworks - Developer Resources
                        AlphaToGo | IADN (100% Alpha Anywhere Websites)

                        Comment


                        • #27
                          Re: setValue not really working

                          of course, you could hide the dummy field so that it is not visible.

                          Comment

                          Working...
                          X