Alpha Video Training
Results 1 to 6 of 6

Thread: make dialog control disabled

  1. #1
    Member
    Real Name
    Olga
    Join Date
    Jun 2008
    Posts
    94

    Default make dialog control disabled

    Hi,

    If there is some possibility to make dialog control textarea field disabled on the fly?
    I.e. on the page where dialog is added I can change element style:

    Code:
    with Variable_Info[2]
    	.TextArea.InLineStyle = "display: block;"
    end with
    Can I do similar thing to make my element disabled/readonly?

    Thank you for your help,
    Olga

  2. #2
    Member
    Real Name
    Olga
    Join Date
    Jun 2008
    Posts
    94

    Default Re: make dialog control disabled

    Seems that there is no such a possibility...
    Did it with javascript finally.

  3. #3
    "Certified" Alphaholic NoeticCC's Avatar
    Real Name
    Andrea Gill
    Join Date
    Nov 2007
    Location
    Golcar, West Yorkshire, UK
    Posts
    2,069

    Default Re: make dialog control disabled

    Quote Originally Posted by moiola View Post
    Seems that there is no such a possibility...
    Did it with javascript finally.
    Well since you did it with Javascript obviously it IS possible.

    Check out the AJAX samples that come with Alpha5, AJAX uses Javascript but you can use Xbasic to code.

  4. #4
    Member
    Real Name
    Olga
    Join Date
    Jun 2008
    Posts
    94

    Default Re: make dialog control disabled

    Hi Andrea,

    Thank you for your reply... I was also thinking that this should be possible somehow, but I didn't find any clues both in help and demo. I may be wrong, but using ajax just to disable a field looks too heavy...

    Thanks,
    Olga

  5. #5
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: make dialog control disabled

    Olga,

    Is there any chance you can share your solution with this forum?

    Im sure it would be helpful to some Alpha 5 users, including me.

    Thanks,

    Denis

  6. #6
    Member
    Real Name
    Olga
    Join Date
    Jun 2008
    Posts
    94

    Default Re: make dialog control disabled

    Hi Denis,

    Sure, it is pretty straight forward, if you know a little bit of javascript. It would be difficult for me just to post my code, since the project is quite complex and it is difficult to extract the needed piece. However, the main idea is as follows:

    1) on a5w page change the <body> tag to be <body onload="disableEleements();"> to run javascript function disableElements() when page is loaded
    2) create disableElements() function text, it should be something like:
    <script>
    function disableElements(){
    var el = document.getElementById('my_textarea_id');
    if (el != null && el != disabled){
    el.disabled = true;
    }
    }
    </script>
    With xbasic you can change the text of javascript function as you like, i.e. to make it different depending on user permissions, etc.

    Please note, if element is disabled, its value is not transferred to the server.

    Hope that can help,
    Olga

Similar Threads

  1. Dialog Web Component control values
    By Garry Flanigan in forum Application Server Version 8
    Replies: 0
    Last Post: 07-04-2007, 06:55 AM
  2. Setting Focus to a Control on a Dialog
    By LMOTCOB in forum Application Server Version 8
    Replies: 4
    Last Post: 03-15-2007, 11:00 AM
  3. Stuck using radiobutton control in dialog component
    By walhoney in forum Web Application Server v7
    Replies: 2
    Last Post: 06-30-2006, 01:25 PM
  4. how to: control confirmation dialog box
    By fddizon in forum Alpha Five Version 6
    Replies: 2
    Last Post: 03-24-2006, 06:50 AM
  5. Dialog Control Format
    By Phil Rolf in forum Web Application Server v6
    Replies: 0
    Last Post: 10-31-2005, 07:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •