Integrated Application Platform › Forums › General › [SVD]How to access current row selection on a browse control › Re: Re: How to access current row selection on a browse control
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.