Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

[SVD]How to access current row selection on a browse control

Integrated Application Platform › Forums › General › [SVD]How to access current row selection on a browse control

  • This topic has 3 replies, 2 voices, and was last updated 8 years, 7 months ago by jaska_lee.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • August 19, 2014 at 1:19 am #783
    jaska_lee
    Participant

    This has been asked few times but I dont seem to able to find the answer from previous posts.

    I have a browse control on an access control and they have a master-detail relationship which is working fine. I would like to display one field value from current selected browse row on the access control.

    Following some of the previous discussions, I tried to create a Rule_ with .browse_data to return the value. But .browse_data is an object which is a list of records in the browse, how could I access the current selected row from there? Is there any other way of doing this?

    Thanks a lot.

    August 20, 2014 at 2:36 pm #1080
    jaska_lee
    Participant

    ok, adding the method List_Selection(selection) into controller seems to do the trick. Whenever a row is clicked on the browse control, this method will be triggered automatically. The selection parameter is passed in as a single element object that points to the index of current row that is clicked, e.g: #(0),#(1)..

    But in this case, i avoided using row index to access browse row. Instead,
    1) I created a reference to the browse control and another reference to the browse field control by using .FindControl method.

    2) I also created a separate Field_ definition to handle heading and format stuff.

    3) After that I put following code under List_Selection(selection) method,

    	List_Selection(selection) {
    if (selection isnt false)
    {
    .browse = .FindControl('browse_name') //a reference to the browse control
    .newfield = .FindControl('newfield_name') //a reference to the new field i would like to show on access
    .newfield.Set(.browse.GetField('browsefield_name')) //using .browse.GetField and control .Set to assign value
    }

    }
    }

    I think it will be a good practice to have all those essential methods added into controller for both access and browse, regardless if we are going to use it. That could save a lot of time to figure out what is what and what does it do.

    August 20, 2014 at 8:48 pm #1081
    amckinlay
    Keymaster

    Glad you figured it out.

    I am not sure what you mean by “methods added into controller for both access and browse”?

    August 21, 2014 at 2:07 am #1082
    jaska_lee
    Participant

    Hi Andrew,

    It is just my idea and may not be necessary for others. Here it is,

    When defining an Access/Browse control inside of a controller, normally the developers would need triggers such as
    On_Insert, On_Delete, On_Modify on the record level to interact with user actions to perform data validation and other type of business logic. Furthermore, the developers would also need triggers such as On_Validate on a field level to interact with users to do similar tasks.

    Mostly of the similar triggers are already provided in suneido controls, but require additional actions to be added into controller. Sometimes, it takes a lot of time and effort to figure out how they should be defined or if they exist at all. So my idea is that, it would be a good practice to add them into the controller as a standard step when defining controller.

    When I look at them later, I can see immediately what triggers are available and use them accordingly. It is also easier for other developers to do continuous support and modification.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language