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

possible to change the focus to the SAVE button?

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

    possible to change the focus to the SAVE button?

    Hi,

    I have a grid with detailview which is updateble.
    It has the Cancel, Delete and Save buttons on the detailview part.

    Now, I noticed that when a user opens an occurence in the grid, and the user goes to one of the fields of the detailview with the cursor, then the default FOCUS is on the DELETE button. I use the Buttondown CSS

    It happened a couple of times that the user changes some data on the detailview and presses the keyboard ENTER button...

    With result that the record/occurence is deleted instead of the user's intention to SAVE...

    Is it possible to change the focus to the SAVE button? And if yes, how please.

    thanks, Ron
    Last edited by rleunis; 01-18-2006, 01:31 PM.

    #2
    Focus please

    Focus please. How to change from Delete Buttton to Save button...

    Comment


      #3
      Highlighting of DELETE button

      Hi,

      The lack of response maybe indicates that my wording of the problem was not in good English...(Sorry, from the Netherlands).

      I have attached a picture to clarify the problem further.

      When I enter Detail View mode and put the cursor in a field of the detailgrid, the DELETE button highlights (gets focus) automatically.

      Is there a way that I can change the focus (highlighting of a button) to the SAVE button?

      Regards, Ron

      Comment


        #4
        I don't think there's any problem with your english. I suspect nobody who has looked at it so far has an answer. I don't - sorry. We can only hope that somebody will pick up on it tomorrow and know what to do.

        Comment


          #5
          Changing the order of buttons

          The problem is not your english - it is fine. The problem is that there isn't a good solution.

          When you are working with browsers, html, and JavaScript, many actions are defined by common web standards. These standards result in behavior that may not fit every situation. Because they are standards that allow almost all browsers to work the same, they can't be changed and you have to work around them. This is just one example.

          Strictly speaking, there is no action in html to capture the "Enter" button action. Most browsers are "helpful" and highlight the first submit button in a form element when focus is placed on an object in the form. This is done to allow an "enter" button push to "push" a button. Since the Delete button is shown before the submit button, it has focus. This can not be changed.

          The best way to change this is to change the order of the buttons and place the submit button first. There is currently no method in the components to change the order of the buttons.

          However, there are a few solutions currently available to you. The easiest is to add a "Confirm before delete" action to the detail view properties. If the user accidentally "presses" the delete action, a confirmation message will pop up that should get their attention.

          The second method is more complex. You can change the html generated by the component after it has been created on the page. Html is just text. Therefore any character replacement functions will work. The trick is to find the text for the buttons, and "reverse" them. This is done by modifying the code using the source tab view for the page. Here is an example for a component name "grd_cust". The first 2 lines would already exist in the code when viewed on the source tab. The code below the line is added.

          HTML Code:
          x_grd_cust = a5w_run_Component(tmpl_grd_cust)
          '=============================================================================================================
          
          button1 = "value=\"Save\" name=\"grd_cust_DetailView_Save\""
          button2 = "value=\"Delete\" name=\"grd_cust_DetailView_Delete\""
          
          x_grd_cust.Output.Body.DetailView_HTML = stritran(x_grd_cust.Output.Body.DetailView_HTML,button1,button2)
          x_grd_cust.Output.Body.DetailView_HTML = stritran(x_grd_cust.Output.Body.DetailView_HTML,button2,button1,1,1)
          The text in "button1" matches the text in the generated html of the detail section for the "save" button.
          The text in "button2" matches the text in the generated html of the detail section for the "delete" button
          The text to replace will be found in the "DetailView_HTML" output from the component
          The first replacement changes the code for the "Save" button to the code for the "Delete" button. At this point, there will be 2 delete buttons
          The second replacement changes the code for only the first "delete" button to the code for the the "save" button.
          The Save button is now before the delete and will have focus.

          This same character replacement concept can be used to replace any gereated html with other html.

          Comment


            #6
            Jerry,

            Thanks for the clarification. I will add the confirmation question and will try the suggestions for the turnaround of the buttons.
            Regards, Ron

            Comment


              #7
              As an update, the order of the buttons will be changed in one of the next builds. The Save button will be placed before the Delete in the component design.

              Comment


                #8
                Thanks again.
                It would be nice if it would be possible to change the order of buttons in gridcomponents for this, like I think it is possible for dialog components as part of the genie.

                Ciao, Ron

                Comment


                  #9
                  Re: possible to change the focus to the SAVE button?

                  With javascript this will focus an element on a form:

                  Example:
                  this will put a focus on a element when the page is loaded.
                  Another more suitable solution is to disable the delete button when a user pushes the "add new record" . The delete button will gray-out.

                  onclick="document.form.deletebutton.disabled=true;"

                  <!-- Define the function giving the focus -->
                  <SCRIPT LANGUAGE="JavaScript">


                  function giveFocus(element)
                  ...{
                  if(document.formName.elementName!=null)
                  {
                  ......document.formName.elementName.focus();
                  ...}

                  }


                  </SCRIPT>
                  </HEAD>

                  <BODY ONLOAD="giveFocus(elementName);">
                  <FORM NAME="formName">
                  <INPUT TYPE="button" NAME="elementName" VALUE="save">
                  </FORM>
                  </BODY>
                  </HTML>
                  Last edited by B.B.Bongers; 07-01-2006, 06:15 AM.
                  Ing./bict Brendo Bongers
                  Software Engineer

                  http://www.brendobongers.nl

                  "There's more than one way to skin a cat."

                  Comment


                    #10
                    Re: possible to change the focus to the SAVE button?

                    Can I get the first fieild in my dialog component to have the focus in a similar manner even with other fields on the form? I have a form that have some enterable fields on it, but I want the user to go directly to the first field in the dialog component automatically.
                    Alan Sawyer

                    Comment


                      #11
                      Re: possible to change the focus to the SAVE button?

                      Hi Alan,

                      Yes you can.
                      You only have to know the name(html attribute name="yourelement") of the first field. What kind of element is it? A textfield?

                      Kind regards

                      Brendo
                      Ing./bict Brendo Bongers
                      Software Engineer

                      http://www.brendobongers.nl

                      "There's more than one way to skin a cat."

                      Comment


                        #12
                        Re: possible to change the focus to the SAVE button?

                        It is a text field called txtBusName
                        Does it still go in the main a5w page?? I'm still very new at WAS so I don't fully understand how it all works yet, but over the next couple of months I hope to learn much much more.
                        Thanks for any help.
                        Alan

                        Comment


                          #13
                          Re: possible to change the focus to the SAVE button?

                          You have place the javascript code on the page where the textfield resides..(the function between the hml head tags)

                          Javascript has nothing to do with WAS.
                          Javascript is clientside and operates on html/dom objects. I would say give it a try! Just "trial and error", best way to learn I think:)
                          You could take a look at www.deguru.com. They have a lot of basic but essential information about wellknown languages including javascript/html/css.

                          Kind regards
                          Ing./bict Brendo Bongers
                          Software Engineer

                          http://www.brendobongers.nl

                          "There's more than one way to skin a cat."

                          Comment


                            #14
                            Re: possible to change the focus to the SAVE button?

                            Rectification:
                            http://www.devguru.com/
                            Ing./bict Brendo Bongers
                            Software Engineer

                            http://www.brendobongers.nl

                            "There's more than one way to skin a cat."

                            Comment


                              #15
                              Re: Changing the order of buttons

                              Originally posted by JerryBrightbill View Post
                              The problem is not your english - it is fine. The problem is that there isn't a good solution.

                              When you are working with browsers, html, and JavaScript, many actions are defined by common web standards. These standards result in behavior that may not fit every situation. Because they are standards that allow almost all browsers to work the same, they can't be changed and you have to work around them. This is just one example.

                              Strictly speaking, there is no action in html to capture the "Enter" button action. Most browsers are "helpful" and highlight the first submit button in a form element when focus is placed on an object in the form. This is done to allow an "enter" button push to "push" a button. Since the Delete button is shown before the submit button, it has focus. This can not be changed.

                              The best way to change this is to change the order of the buttons and place the submit button first. There is currently no method in the components to change the order of the buttons.

                              However, there are a few solutions currently available to you. The easiest is to add a "Confirm before delete" action to the detail view properties. If the user accidentally "presses" the delete action, a confirmation message will pop up that should get their attention.

                              The second method is more complex. You can change the html generated by the component after it has been created on the page. Html is just text. Therefore any character replacement functions will work. The trick is to find the text for the buttons, and "reverse" them. This is done by modifying the code using the source tab view for the page. Here is an example for a component name "grd_cust". The first 2 lines would already exist in the code when viewed on the source tab. The code below the line is added.

                              HTML Code:
                              x_grd_cust = a5w_run_Component(tmpl_grd_cust)
                              '=============================================================================================================
                              
                              button1 = "value=\"Save\" name=\"grd_cust_DetailView_Save\""
                              button2 = "value=\"Delete\" name=\"grd_cust_DetailView_Delete\""
                              
                              x_grd_cust.Output.Body.DetailView_HTML = stritran(x_grd_cust.Output.Body.DetailView_HTML,button1,button2)
                              x_grd_cust.Output.Body.DetailView_HTML = stritran(x_grd_cust.Output.Body.DetailView_HTML,button2,button1,1,1)
                              The text in "button1" matches the text in the generated html of the detail section for the "save" button.
                              The text in "button2" matches the text in the generated html of the detail section for the "delete" button
                              The text to replace will be found in the "DetailView_HTML" output from the component
                              The first replacement changes the code for the "Save" button to the code for the "Delete" button. At this point, there will be 2 delete buttons
                              The second replacement changes the code for only the first "delete" button to the code for the the "save" button.
                              The Save button is now before the delete and will have focus.

                              This same character replacement concept can be used to replace any gereated html with other html.
                              Hi Jerry, suppose we apply this on the default alpha log in grid, how do i force the cursor to be on the "user ID" entry field.

                              i do not want to focus on submit or cancel.
                              any consideration of making it easier, instead of altering the java codes.
                              thanks
                              ken tjia

                              Comment

                              Working...
                              X