Tagged: ,

Viewing 6 reply threads
  • Author
    Posts
    • #2786
      ajayphp
      Member

      Hi,

      Workflow tab feature is gr8, I am trying with that,

      after filled the data in fiels, and press save button,
      nothing is saving, even in tab input fields are disappearing.

      i tried with different post status method. and then save,
      even then save button title were changes save to publish (do not know how )

      could you please tell how can i fix, as all efforts will be waste if noting will
      save. this is for custom post type.

      sample code with file structute:

      File: plugin/parts/workflow/gateway.php

      <?php
      /*
      Flow: Gateways
      Page: post.php, post-new.php, post-edit.php, admin.php
      Post Type: biz_gateway
      Header: true
      Position: title
      */
      ?>

      first tab
      — File: plugin/parts/workflow/api.php

      <?php
      /*
      Title: Api
      Order: 20
      Flow: Gateways
      Default: true 
      */
      ?>
      
      <?php
        
        piklist('include_meta_boxes', array(
          'piklist_meta_help'
          ,'piklist_meta_field_api'
          ,'piklist_meta_field_upload'
          ,'piklist_meta_field_taxonomies'
          ,'piklist_meta_field_featured_image'
          ,'piklist_meta_field_relate'
          ,'piklist_meta_field_comments'
        ));
      
      /*
       * you can pass var to file, with location of file to call 
       */ 
       piklist('shared/field-api', array(
          'location' => __FILE__
          ,'type' => 'Workflow Tab'
        ));
      
      ?>
      
      

      First tab content file:
      — File: plugin/parts/shared/field-api.php

      <?php
      
       piklist('field', array(
          'type' => 'text'
          ,'field' => 'gtw_api_url'
          ,'label' => 'Api Url'
          ,'description' => "Api Url for this gateway to remote call"
          ,'attributes' => array(
            'class' => 'regular-text'
            ,'placeholder' => 'Enter Api Url...'
          )
          ,'on_post_status' => array(
            'value' => 'save'
          )
          ,'required' => true
        ));
        
      
        
         piklist('field', array(
          'type' => 'text'
          ,'field' => 'gtw_api_username'
          ,'label' => 'Api Username'
          ,'description' => "Api Username"
          ,'attributes' => array(
            'class' => 'regular-text'
            ,'placeholder' => 'Enter Api Username...'
          )
          ,'on_post_status' => array(
            'value' => 'save'
          )
          ,'required' => true
        ));
        
       piklist('field', array(
          'type' => 'text'
          ,'field' => 'gtw_api_password'
          ,'label' => 'Api Password'
          ,'description' => "Api Password"
          ,'attributes' => array(
            'class' => 'regular-text'
            ,'placeholder' => 'Enter Api Password...'
          )
          ,'on_post_status' => array(
            'value' => 'save'
          )
          ,'required' => true
        ));
        
      
        
        
        
      ?>
      

      — like above second and third tab.

      is that code file and tab content file location is fine ..?
      data is display correctly.

      — data is not saving, on click save button
      — data is not saving when move to another tab
      — after save fields not able to edit and input fields disappears.

      Please guide me in detail please.. i have read your doc not get exact idea
      what is missing.

      Regards

    • #2787
      Steve
      Keymaster

      @ajayphp– Why are you using on_post_status? Do you have a custom post status called “save”? Here are the docs on on_post_status for clarification > Try removing it.

      Also, what is this code supposed to do?

      piklist('shared/field-api', array(
          'location' => __FILE__
          ,'type' => 'Workflow Tab'
        ));
      
    • #2789
      ajayphp
      Member

      Hi,

      code: +++++++++++
      piklist(‘shared/field-api’, array(
      ‘location’ => __FILE__
      ,’type’ => ‘Workflow Tab’
      ));
      +++++++++

      i saw this code in add on piklist example:
      it seems calling fields file and passing variable to that file.

      can we put the fields declation direct here ?
      or what is the way to include tab fields content file ?
      with this workflow tab ?

    • #2791
      ajayphp
      Member

      Hi,

      could you tell how we bind the tab click event
      to trigger save data of previous tabs,

      also alert on select tab , leave tab or loose / save data,
      better if we can save auto.

      or call tabs content with ajax rather http url request

    • #2792
      Steve
      Keymaster

      @ajayphp

      We use this code in the demo to show the path of the file being used. It doesn’t do anything except display the path:

      piklist(‘shared/field-api’, array(
      ‘location’ => __FILE__
      ,’type’ => ‘Workflow Tab’
      ));
      

      Workflow tabs currently do not support auto-save or save when switching tabs.

    • #2795
      ajayphp
      Member

      Hi,

      Pls pls tell me tab content(fields) file location ?

      and where you mention in doc about field-group

      and what is difference between followings:

      +++
      piklist(‘field’, array(
      ‘type’ => ‘group’
      ,’label’ => ‘Address (Un-Grouped)’
      ,’description’ => ‘An Un-grouped field. Data is saved as individual meta and is searchable.’
      ,’fields’ => array(
      array(

      +++
      piklist(‘field’, array(
      ‘type’ => ‘group’
      ,’field’ => ‘address_group’
      ,’label’ => ‘Address (Grouped)’
      ,’list’ => false
      ,’description’ => ‘A grouped field. Data is not searchable, since it is saved in an array.’
      ,’fields’ => array(
      array(

      +++
      ,’add_more’ => true

      +++

    • #2796
      Steve
      Keymaster

      @ajayphp

      1) WORKFLOW TAB CONTENT: The contents of the Workflow tabs are in regular meta-boxes are settings sections that you already created. This is the code that tells the Tab which DIVs (meta-boxes or sections) to show:

      piklist('include_meta_boxes', array(
          'piklist_meta_help'
          ,'piklist_meta_field_api'
          ,'piklist_meta_field_upload'
          ,'piklist_meta_field_taxonomies'
          ,'piklist_meta_field_featured_image'
          ,'piklist_meta_field_relate'
          ,'piklist_meta_field_comments'
        ));
      

      2) GROUPED / UNGROUPED: When you define a field (i.e. 'field' => 'address_group'), all other field data is saved in an array within address_group. If you don’t define a field, they are saved separately.

Viewing 6 reply threads
  • The topic ‘in workflow tab values are not saving’ is closed to new replies.