Hi Jens,
On 2014-05-07, 1:59 AM, "Dipl.-Ing. Jens Lünstedt" wrote:
Hello,
for my AjaxGrid I have two questions. (I'm not very familiar with _javascript_)
How to define a single row selection? (At the moment I can select and deselect multiple rows).
You mean that you want to prevent the user from selecting more than one row? It does not support that. You probably could in _javascript_, but this is probably the wrong UI for what you are doing.
How can I react on the selection and deselection event in my Java Class? The setSelectedObjects method is not called.
You can’t directly, AjaxGrid does that.
I think what you want is to have a link or button in each row that does something when activated. Otherwise you are trying to bend AjaxGrid to do something it was not intended for. Neither you nor your users are likely to be happy.
First you need a grid configuration like this:
* {
* title = "Actions";
* keyPath = ""; // Missing or empty keypath results in the current object itself being passed to component
* component = "EmployeeActions"; // Name of WOComponent to be displayed in this column. Gets passed two bindings: value (Object),
* // and grid (AjaxGrid) so that any other needed data can be accessed
* cssClass = "alignCenter";
* }
Then in the component some simple HTML like:
<span style="float:middle"><WEBOBJECT
NAME="Remove"/></span>
Then use a regular link or an Ajax one, depending on what you want to happen:
Remove: WOHyperlink {
action = remove;
string =
"Remove";
}
And implement the action method to do what you want.
Chuck
I can't find a description / example in the web.
Thanks
Jens
UPDATE: I found a solution in checking the change of selectedObjects in public WODisplayGroup displayGroup()
I don't know if that is a good solution but it works.
|