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

set list detail view to dirty

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

    set list detail view to dirty

    I have a list with a detail view embedded on a UX, there are 4 fields in the list/detail one being the primary key. The other 3 are filled by using the default value javascript in the detail view properties for each field in the list properties with values from other fields/lists on the UX.

    This does not make the embedded UX dirty so the save button does not enable, anyone know how to set this dirty without typing something into a field?

    #2
    Re: set list detail view to dirty

    {dialog.object}.isDirty(true) will set the UX dirty.

    You may or may not need to flag individual fields as dirty if the UX doesn't save as you expect. If that's the case, you may need to use {dialog.object}.setControlDirty('CONTROL_NAME',true).
    Alpha Anywhere latest pre-release

    Comment


      #3
      Re: set list detail view to dirty

      Thanks Sarah, would love to know where to find all of the {dialog.object} methods!

      The {dialog.object}.isDirty(true) threw an error of Object doesn't support property or method 'isDirty'

      No error with {dialog.object}.setControlDirty('CONTROL_NAME',true), have tried the list name and each control and the save button will still not enable! The enable expression for the save button is (dialog.listDetailView.L2.isDirty = true) AND (dialog.listDetailView.L2.mode <> 'search') if that gives any clues. I also have tried {dialog.object}.setControlDirty('listDetailView.l2',true);

      Comment


        #4
        Re: set list detail view to dirty

        My bad. Typo. It's {dialog.object}.setDirty(true).

        There's a listing of methods in the Insert Method dialog. It includes the setDirty method in the listing.

        The rest is just running any UX component in the web browser and inspecting the methods available in the Console using FireBug (Firefox) or Chrome Debugger (Google Chrome) or whatever debugging tools are available for the browser you're using.
        Alpha Anywhere latest pre-release

        Comment


          #5
          Re: set list detail view to dirty

          Originally posted by Lance Gurd View Post
          No error with {dialog.object}.setControlDirty('CONTROL_NAME',true), have tried the list name and each control and the save button will still not enable! The enable expression for the save button is (dialog.listDetailView.L2.isDirty = true) AND (dialog.listDetailView.L2.mode <> 'search') if that gives any clues. I also have tried {dialog.object}.setControlDirty('listDetailView.l2',true);
          What is "listDetailView.l2"?
          Alpha Anywhere latest pre-release

          Comment


            #6
            Re: set list detail view to dirty

            Still no joy with {dialog.object}.setDirty(true)

            l2 is the name of my list that has a detail view on it, the (dialog.listDetailView.L2.isDirty = true) AND (dialog.listDetailView.L2.mode <> 'search') was generated by ALPHA from the list view buttons genie

            Comment


              #7
              Re: set list detail view to dirty

              Managed to make the embedded list and its detail view dirty by using the new record button.

              I added a getvalue and setvalue on one of the controls wrapped up in a setTimeout of 500 milliseconds. Dirty way of doing it but it works

              Comment


                #8
                Re: set list detail view to dirty

                I am in list dirty hell and hoping I can get some help.

                I have a list that I am appending records to using the following:

                var listObj = {dialog.object}.getControl('review');
                var _d = [
                {set_id: set_id, response_id: rid, response: rtext}
                ]
                listObj.appendRows(_d);

                It works fine but I can't get the list so show dirty and the sync functions will not fire if the list is not dirty.

                I have looked through the DOM on firefox for functions to use and tried the methods above with no luck.

                I'm not doing any updates on this list, just adding records that need to be uploaded to the server when a connection is available.

                Most of what I have seen above are tests to see if the list is dirty, i just need to set it dirty.

                Thanks
                Tom

                Comment


                  #9
                  Re: set list detail view to dirty

                  I found the answer to my problem. ListObj.appendRows(_d) will not set the row to dirty.

                  have to use addTableRow()

                  Contrast the .addTableRow() method with the List object's .appendRows() method.
                  The .addTableRow() method is the programmatic equivalent of the user entering some values into the List Detail view
                  controls and then clicking on the Save button to save their changes back to the List. When the user does this, the List becomes
                  dirty and the edits that have been made to the list can be synchronized with the server.
                  The .appendRows() method is a low level method that adds the data to the List, but this method does not add the
                  necessary information to the List to cause the List row that was added to become dirty. The new row cannot be synchronized
                  with the server.

                  Comment


                    #10
                    Re: set list detail view to dirty

                    Tom, please paste your code segment for this. I can't find addTableRow() function for the pointed to object listObj
                    Regards,

                    Kotin Karwak
                    Developer Edition
                    Version 12.3 Build 2684
                    System Addins: Build 4438
                    Build machine Windows Vista
                    Skype: mateso08

                    Comment


                      #11
                      Re: set list detail view to dirty

                      Kotin,

                      This is from the release notes
                      <listObj>.addTableRow(data [,options]) - Adds a new row of data to a List that has a Detail View. By default, the new row is added at the end of the List, but you can add the new row (i.e. insert the row) at any position by setting options.
                      Where:
                      data - an object with the values in the List that you want to set.
                      options - an object with optional settings.
                      The options object can contain these properties:
                      options.setFocusToTargetRow - true/false - If true, then focus will be given to the target row. The default for this property is false.
                      options.insertRow - true/false -- default false. Set to true if you want to insert at a specified position in the List rather than at the end. (Requires build 4444 or above)
                      options.insertPostion - if options.insertRow is true, specify where in the List the new row should be inserted. options.insertPostion can either be a number or a string. If it is a number, it represents a zero based row number in the List where the new record will be inserted. If it is a string it represents the List value where the new row will be inserted.

                      Example:

                      //create a data object with values for the columns in the List you want to edit
                      var data = {};
                      data.FIRSTNAME = 'Cecelia';
                      data.LASTNAME = 'Longwood';

                      //define optional settings
                      var ops = {};
                      ops.setFocusToTargetRow = true;

                      //get a pointer to the List control and then call the .addTableRow() method
                      var lObj = {dialog.object}.getControl('CUSTOMERLIST')
                      lObj.addTableRow(data,ops);

                      //insert the new row at position 3 (zero based)
                      var ops = {};
                      ops.setFocusToTargetRow = true;
                      ops.insertRow = true;
                      ops.insertPostion = 3;
                      lObj.addTableRow(data,ops);

                      Comment


                        #12
                        Re: set list detail view to dirty

                        Hi

                        Here's the snippet from my code.

                        keep in mind the fieldname after data.fieldname must match the case of field name on your UX


                        var listObj = {dialog.object}.getControl('review');
                        var ops ={} ;//options
                        ops.setFocusToTargetRow = true ;
                        var data = {};
                        data.set_id = set_id; ///the case of data.fieldname must match the case in the field in the list
                        data.orgid= orgid;
                        data.sid=sid;
                        data.qid=qid;
                        data.response_id= rid;
                        data.response= rtext;
                        data.respondent_id= rspd_id;
                        //response_date_time: response_date_time

                        listObj.addTableRow(data,ops);

                        Comment


                          #13
                          Re: set list detail view to dirty

                          Originally posted by TheSmitchell View Post
                          {dialog.object}.isDirty(true) will set the UX dirty.

                          You may or may not need to flag individual fields as dirty if the UX doesn't save as you expect. If that's the case, you may need to use {dialog.object}.setControlDirty('CONTROL_NAME',true).
                          This one worked for me with a similar issue. the setControlDirty function. Thanks!

                          Comment


                            #14
                            Re: set list detail view to dirty

                            Have any of you had problems using these techniques, but the list data doesn't commit to the SQL table?

                            My list is clearly populating when use both lObj.appendRows() and lObj.insertRows(). The list does not have a detail section. And I can't figure out why the data doesn't get committed to the table.

                            I'm using the examples Selwyn shows in the videos referenced here, the key part being:
                            Code:
                            		if (flagAppend) {
                            		lObj.appendRows(_d);
                            	} else {
                            		lObj.insertRows(row, _d);
                            	}
                            I do know there are no violations at the SQL level - everything's allowed a null, etc. etc. so there's something within the javascript or the list definition that I'm missing.

                            Thanks.
                            -Steve
                            sigpic

                            Comment


                              #15
                              Re: set list detail view to dirty

                              The methods you're using are for non-DetailView Lists. If you want to add data to a List with a DetailView and have that List sync'd then you'd use the .addTableRow() method. This method is referenced in the posts in this thread and more info can be found here... http://downloads.alphasoftware.com/A...DetailView.htm

                              Comment

                              Working...
                              X