5 Replies Latest reply: Feb 4, 2013 2:01 AM by user404 RSS

    ADF mobile: how to link task flow to a list view item

    Vik Kumar-Oracle
      Hi

      I am trying to build a mobile app in adf and i created a popup on the left button on the header. this popup has a list view showing few options.

      now the requirement is to click on the option and navigate to that feature (which is created as a task flow).

      so, i am not sure how do like the task flow to the link in the listView of the popup. Please advise
        • 1. Re: ADF mobile: how to link task flow to a list view item
          user404
          I suppose that taskflow is a part of another feature?
          If so, you can use goToFeature(String) from the ApplicationFeatures datacontrol.
          The param is the ID of that taskflow.
          • 2. Re: ADF mobile: how to link task flow to a list view item
            Vik Kumar-Oracle
            any documentation on this ?
            • 3. Re: ADF mobile: how to link task flow to a list view item
              user404
              Vik2 wrote:
              any documentation on this ?
              On what specific?
              Here is the official dev guide:
              http://docs.oracle.com/cd/E35521_01/doc.111230/e24475/toc.htm
              • 4. Re: ADF mobile: how to link task flow to a list view item
                Vik Kumar-Oracle
                i have 4-5 items in the list view and each is supposed to navigate to a feature(task flow). so do i have to invoke this method programmatically passing the id of the feature? doesnt look a nice way for say large number of features required to be navigated in this way.
                • 5. Re: ADF mobile: how to link task flow to a list view item
                  user404
                  Well, if that list contains all features, you can use the 'features' from the ApplicationFeatures DC (they contain the ID, name, ... so you can use #{row.id} instead of hardcoding it).
                  If that list does only contain a few features, you can make your own list.
                  In your own backing bean or data control, you can get all the features by using:
                          ApplicationFeatures af = new ApplicationFeatures();
                          af.getFeatures();
                  And filter them.

                  An example that I made/use myself:
                  It uses an commandLink to navigate because I need to be able to 'disable' (= not clickable) some features (it has the same look as an ListView).
                  So iff just use the getFeatures(), you can use the ListView for navigation.

                  <amx:iterator var="row" value="#{bindings.features.collectionModel}" id="i1">    
                          <amx:tableLayout width="100%" id="tl2" inlineStyle="background-color:White;">
                            <amx:rowLayout id="rl2">
                              <amx:cellFormat width="50px" height="50px" halign="center" id="cf4" valign="middle"
                                              inlineStyle="border-bottom:thin solid #b8b9c8;">
                                <amx:image source="#{row.icon}" id="i2" inlineStyle="width:40px;"/>
                              </amx:cellFormat>
                              <amx:cellFormat width="100%"  height="43px" id="cf3" valign="middle"
                                              inlineStyle="border-bottom:thin solid #b8b9c8;">
                                <amx:commandLink text="#{row.name}" id="cl1" inlineStyle="color:Black; font-weight:bolder; font-size:110%;"
                                                 disabled="#{!row.enable}">
                                  <amx:setPropertyListener from="#{row.id}" to="#{pageFlowScope.feature}" />
                                  <amx:actionListener binding="#{bindings.resetFeature.execute}"/>
                                </amx:commandLink>
                              </amx:cellFormat>
                            </amx:rowLayout>
                          </amx:tableLayout>
                        </amx:iterator>
                  This my own data control :
                  public class MenuDC {
                      
                      private ExtendedFeatureInformation[] features;
                      private String message;
                      
                      public MenuDC() {
                      }
                  
                      public ExtendedFeatureInformation[] getFeatures() 
                      {
                          ApplicationFeatures af = new ApplicationFeatures();
                          this.fillExtendedFeatureList(af.getFeatures());
                          return features;
                      }
                      
                      private void fillExtendedFeatureList(FeatureInformation[] realFeatures)
                      {
                          message = "";
                          ModelController.getSingletonModelController().refreshMinorTables();
                          features = new ExtendedFeatureInformation[realFeatures.length];
                          for(int i = 0; i < realFeatures.length; i++)  
                          {
                              boolean enable = true;
                              FeatureInformation fi = realFeatures;
                  if(fi.getId().equals("be.kpd.newDayReport"))
                  {
                  if(ModelController.getSingletonModelController().getVarFormLocalDB(HardcodedVarCodes.LAST_SYNC).equals(""))
                  enable = false;
                  }
                  if(fi.getId().equals("be.kpd.overviewDayReport"))
                  {
                  if(ModelController.getSingletonModelController().getRegisDFromLastSevenDays().size() == 0)
                  enable = false;
                  }

                  if(!enable)
                  {
                  message = "SYNC_NEEDED";
                  }

                  ExtendedFeatureInformation efi = new ExtendedFeatureInformation(fi.getId(),fi.getName(),fi.getIcon(),fi.getImage(),enable);
                  features[i] = efi;
                  }
                  }

                  public String getMessage() {
                  return message;
                  }
                  }


                  I made my own POJO which implements the FeatureInformation interface,
                  because I needed an extra boolean attribute for disabling some features.
                  public class ExtendedFeatureInformation implements FeatureInformation {
                      
                      private String id,name,icon,image;
                      private boolean enable;
                      
                      public ExtendedFeatureInformation() {
                          super();
                      }
                  
                      public ExtendedFeatureInformation(String id, String name, String icon, String image, boolean enable) {
                          super();
                          this.id = id;
                          this.name = name;
                          this.icon = icon;
                          this.image = image;
                          this.enable = enable;
                      }
                  
                      public String getId() {
                          return id;
                      }
                  
                      public String getName() {
                          return name;
                      }
                  
                      public String getIcon() {
                          return icon;
                      }
                  
                      public String getImage() {
                          return image;
                      }
                  
                      public boolean isEnable() {
                          return enable;
                      }
                  }