I have enabled single-click Edit from my web listview on an object that also has the State Machine enabled using the following in a ViewController<ListView>.
C#ListViewProcessCurrentObjectController controller = Frame.GetController<ListViewProcessCurrentObjectController>();
if (controller != null)
{
if (BlackList.Contains(View.Id) == true || Frame.Template is ILookupPopupFrameTemplate)
{
// Disable the single click edit.
controller.ProcessCurrentObjectAction.Enabled[EnabledKeyShowDetailView] = false;
}
else
{
controller.ProcessCurrentObjectAction.Enabled[EnabledKeyShowDetailView] = true;
}
}
However, when the web detail view is displayed with the state machine buttons, it displays both Active and Inactive state machine transition buttons (see attached). If I simply show another detail view from a nested listview or click the validate action, the state machine buttons are rendered correctly.
Hello Brian.
I'm afraid the information you provided is insufficient to diagnose this issue. My attempts to replicate it were unsuccessful. Attached is a sample project that uses your code and works fine. Please modify it to replicate the issue and attach it to your next post.
Michael,
I found the culprit, but I am not sure how to address it. I failed to provide part of my code which involves forcing the detail view to Edit using the following controller.
public class SwitchToEditModeDetailViewController : ViewController<DetailView>
{
protected override void OnActivated()
{
base.OnActivated();
if (View.ViewEditMode == ViewEditMode.View)
{
View.ViewEditMode = ViewEditMode.Edit;
}
}
}
If you add this to your solution, it will demonstrate the problem. The idea is to simply single-click a list view row and display detail view in Edit mode.
Thoughts?
Thanks,
Brian
Thank you for the clarification. I have reproduced the issue. We need additional time to research it. We will inform you once a solution is found. Currently, you can hide action buttons by returning False from the ExpandActionsInDetailView property of your state machine and use the single choice action, available in the toolbar, to change the state.
Michael,
Understood. In the meantime, I have removed the setting of the ViewEditMode and forced user to click the Edit button on the row. Please keep me posted.