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

selectTabPane method not working

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

    selectTabPane method not working

    I have a simple dialog2 form with a Tab control. The tab control is "based on" the ship-to address type in that each tab represents a different address type.
    The address type value associated with the currently selected tab is shown beside the title. As the user selects the different tabs, the corresponding tab value
    is shown in the text box. In the example below, the user has selected the 3rd tab for "freeform input" and the tab number 3 is shown in the text box.

    selectTabPane dialog2.jpg

    When the user presses the "Save Selection" button, the calling dialog is updated with the ship-to address type value and the associated address information. This works correctly.
    If the user then re-opens this dialog to make a different selection, I would like this dialog to open to the correct tab pane - i.e. the user selected
    FreeForm last time and wants to change his/her mind so the form should open with the current selection of 3 / FreeForm showing.

    However, this is where my problem lies. As you can see below, the correct ship-to type (3) is showing in the text box but the first tab is in view, not the 3rd (FreeForm).

    selectTabPane dialog.jpg

    I have the following code in the onRenderComplete client side event and have also tried it in the onInitializeComplete event.

    Code:
    function setInitialTabPane()
    {
    	//Get the current value in 'ShipToTypeID'
    	var curShipToTypeID = {dialog.object}.getValue('ShipToTypeID');
    
    	//Set the current pane number
    	if (curShipToTypeID == 0)
    	{
    	{dialog.object}.selectTabPane('TAB_1',4);
    	}
    	else
    	{
    	{dialog.object}.selectTabPane('TAB_1',curShipToTypeID);
    	}
    }
    At first thought, it would seem that the .selectTabPane is simply being ignored but I don't think so. I added 3 buttons to the dialog for testing, each one with a specific statement for selecting a tab pane and they all worked just fine.

    Code:
    {dialog.object}.selectTabPane('TAB_1',1);
    ...
    {dialog.object}.selectTabPane('TAB_1',2);
    ...
    {dialog.object}.selectTabPane('TAB_1',3);
    It would seem perhaps that I just have the code to select the initial tab pane in the wrong event to get the dialog to initialize properly or there is something a little off in my JavaScript (which would not be a bit surprise).

    Any suggestions would be very helpful. Likely something quite simple that I am overlooking.

    Thanks for your help,
    Peter

    #2
    Re: selectTabPane method not working

    Peter G.,

    I have not done this in a Dialog2 before, but I do have a grid and a linked grid with 4 comments tabs where I'm able to keep a particular tab selected as the user navigates records in the main grid. Maybe what I did for linked grids will give some ideas on how to do this in a Dialog2.

    In the linked grid client-side events for "OnGridInitializeComplete" event I put this:

    // Select the tab we really want, instead of the one Alpha selected for us.
    TryShowPrefCmntTab();
    And in the "AfterAjaxCallbackComplete" event I put this:

    if( e.ajaxEvent == 'SynchronizeGridInWindow' ) {
    // Select the tab we really want, instead of the one Alpha selected for us.
    TryShowPrefCmntTab();
    }
    You would have to figure-out what to put in place of "'SynchronizeGridInWindow' ".

    My Javascript for "TryShowPrefCmntTab()" looks like this:

    function TryShowPrefCmntTab () {

    // If tab control not created yet then exit.
    ctl_id = '{Grid.ComponentName}' + '_' + 'DVTAB_CMNTS' + 'R_1';
    obj = $(ctl_id);
    if ( obj == false ) return;

    var tb = {grid.Object}.getSessionVariable('SWPDRCMNTTAB'); // Replace with desired var
    // Exit if preferred comment Tab not set or out of range.
    if( tb == false || tb < "1" || tb > "4") return;
    // See if the chosen comment Tab is allowed for this record
    var hasCmntFldId = 'DRHAS_ROLE' + tb + '_COMMENT_NY';
    var hasCmntYN = {grid.Object}.getValue('G', hasCmntFldId, 1); // always using just row # 1 here
    if( hasCmntYN == 'Y' ) {
    // Replace 'CMTEXT' ID prefix with control ID prefix on the desired tab
    // Replace 'G' with 'D' if on detail view.
    // Replace 1 with current row number of grid, if allow more than 1 record row.
    {grid.Object}.activateControlContainer('ROLE' + tb,'G',1);
    }
    }
    Ignore the stuff in the above code that applies to security checking - "hasCmntYN" and "hasCmntFldId ". Some users don't get to see all the possible tabs.

    In the above code the line that would be of interest to you is:

    {grid.Object}.activateControlContainer('ROLE' + tb,'G',1);

    You'd need to replace the {grid.Object} placeholder with the one used for dialogs. And you would replace 'ROLE' with the control name prefix you have on your tabs. And tb would be replaced with the tab number you want to show. In the above code I track the desired tab number by putting it into a session variable:
    'SWPDRCMNTTAB'.

    However, the session variable is not the best place to store this info. If the user opens more than one instance of my browse form then both instances would probably use the same default tab number. Which they may or may not want. But in my case, it is very unlikely a user will ever open two instances. I think videos M43 and M45 present another way of passing data between components.
    -Rich

    Comment

    Working...
    X