0

I am using the Bixby list-of navigation to show multiple tickets and select tickets to show details of that ticket using ordinal-selection-patterns. But if I have only a single ticket and I want to show the detail page of that ticket directly. But I am unable to show. So, is it possible to call two different actions in the result view.

Result View

result-view {
 match: TicketConfirmation(item) 
 message{
  if(exists(item.errorData)){
   template("#{value(item.errorData)}")
  }
}
render {
if (exists(item.Total) && item.Total >= 1) {
  list-of (item) {
    navigation-mode {
      if ($handsFree) {
        read-many {
          page-size (6)
          page-content (page) {
            page-marker {
              if(exists(item.customMessage)){
                template("") 
              }
            }
            underflow-statement (This is the first item.)
            overflow-statement (Those are all the items.)             
          }
        }
      }
    }
    where-each (item) {
      layout-macro (ticket-summary-card) {
        param (single_item) {
          expression (item)
        }
      }
    }
  }
}
}
}

Layout:

layout-macro-def(ticket-summary-card) {
 params {
  param (single_item) {
   type (TicketConfirmation)
   min (Required)
   max (One)
  }
 }
 content {
  compound-card {
    content {
      if (exists(single_item.Name)){
        paragraph{
          value("#{value(single_item.Name)}")
          style(Detail_L)
        }
      }  
    }
  }
 }
}

Navigation support:

navigation-support {
 match: TicketConfirmation (this) 
  ordinal-selection-patterns {
   pattern ("(first)[v:viv.core.OrdinalSelector]")
   pattern ("(first)[v:viv.core.OrdinalSelector] one")
   pattern ("that (first)[v:viv.core.OrdinalSelector] one")
 }
}
Rahul Gupta
  • 972
  • 11
  • 29

1 Answers1

0

It seems there are two questions here. I will go with the easy question first:

"is it possible to call two different actions in the result view"? NO, normally there is only one goal. It is possible that the goal ActionA requires ActionB first and planer handles that with proper training, but developer cannot specify goalA, then goalB like function calls in intent. It is possible to explore the possibility to trigger multiple actions to fulfill a single structure's value by using intent->goal-set. However, a single action to fulfill the value of structure is usually easier and more nature.

Now the more difficult question: "I am using the Bixby list-of navigation to show multiple tickets and select tickets to show details of that ticket using ordinal-selection-patterns. But if I have only a single ticket and I want to show the detail page of that ticket directly. But I am unable to show. "

  1. In runtime-version(7), override with both allow-dialogs-on-detail-pages (true) and no-fallback-dialog-in-views (false)
  2. list-of and where-each should automatically handle the situation you described. You may want have separate render content for ==1 condition. In your code item.Total >= 1, normal practice is do summary in >1 and detail in ==1 condition.
  3. Try to see if there is any difference between HEF and non-HEF, it is unclear from your question whether non-HEF works as desired or not.
  4. "I am unable to show", do you mean you see nothing rendered, or if you see a list view with only 1 item, which requires user to do one more selection step. I will update this answer once learned more.

Updated. I would say just call the detail page directly as the following:

result-view {
  match: StructPerson(this)
  message: template ("There are #{size(this)} items") 
  render {
    if (size(this)==1) {
      // this is the detail view
      layout-macro (detail-person) {
        param (person) { expression (this) }
      }
    }
    else-if (size(this<1)) {
      // this is 0 result view
    }
    else {
      // this is the list view
      if ($handsFree) {
        // do list navigation here
      }
      else {
        list-of (this) {
          where-each (item) {
            layout-macro (summary-person) {
              param (person)  { expression (item)}
            }
          }
        }
      }
    }
  }
}
  • I can see a list view with only 1 item for which I need to do one more step to see the detail of that item and "select one" (hands-free navigation) doesn't work for that. So, either I want to call the detail page directly or I want (hands-free navigation) to work to select that item. – Rahul Gupta Aug 10 '20 at 07:23
  • The detail page is having different actions and structures. Calling detail page results in multiple ticket pages throwing error as "illegal property in the expression". – Rahul Gupta Aug 11 '20 at 06:56
  • I am not following, normally the macro-summary and macro-detail should be rather similar in terms of params. Maybe you want to post error screenshot here, or submit a ticket using Bixby IDE -> Help -> Contact Support. Regarding the original question, do you think the sample code would be what you want if you are able to call macro-detail when size(this)==1? – BixbyDevSupport-Tokonyan Aug 11 '20 at 16:54