Bail to send new saved data back to our modal handler.

@param int    $item_id    Item ID.
@param string $item_title Item title.
@param object $field_args Field arguments.
962
public function admin_modal_bail( $item_id, $item_title, $field_args ) {

		$model_data = $this->build_dfv_field_item_data_recurse_item( $item_id, $item_title, $field_args );
		?>
			<script type="text/javascript">
				window.parent.jQuery( window.parent ).trigger(
					'dfv:modal:update',
					<?php echo wp_json_encode( $model_data, JSON_HEX_TAG ); ?>
				);
			</script>
		<?php

		die();

	}
928786
public function addItem(
        $id,
        $description = null,
        $quantity = null,
        $amount = null
    ) {
        $param = $id;
        if ($this->items == null) {
            $this->items = array();
        }
        if (is_array($param)) {
            array_push($this->items, new PagSeguroItem($param));
        } else {
            if ($param instanceof PagSeguroItem) {
                array_push($this->items, $param);
            } else {
                $item = new PagSeguroItem();
                $item->setId($param);
                $item->setDescription($description);
                $item->setQuantity($quantity);
                $item->setAmount($amount);
                array_push($this->items, $item);
            }
        }
    }
1207799
public function editFieldValue($field_id, $field_value_id = null)
    {
        $this->setFieldFieldValue($field_id);
        $this->setFieldValue($field_value_id);
        $this->setTitleEditFieldValue();
        $this->setBreadcrumbEditFieldValue();

        $this->setData('field', $this->data_field);
        $this->setData('field_value', $this->data_field_value);
        $this->setData('widget_types', $this->field->getWidgetTypes());
        $this->setData('languages', $this->language->getList(array('enabled' => true)));

        $this->submitEditFieldValue();
        $this->setDataImagesEditFieldValue();

        $this->outputEditFieldValue();
    }
8571
public function updateItem(Item $item): void
    {
        $query = $this->connection->createQueryBuilder();

        $query
            ->update('ngbm_collection_item')
            ->set('collection_id', ':collection_id')
            ->set('position', ':position')
            ->set('value', ':value')
            ->set('value_type', ':value_type')
            ->set('config', ':config')
            ->where(
                $query->expr()->eq('id', ':id')
            )
            ->setParameter('id', $item->id, Type::INTEGER)
            ->setParameter('collection_id', $item->collectionId, Type::INTEGER)
            ->setParameter('position', $item->position, Type::INTEGER)
            ->setParameter('value', $item->value, Type::STRING)
            ->setParameter('value_type', $item->valueType, Type::STRING)
            ->setParameter('config', $item->config, Type::JSON_ARRAY);

        $this->applyStatusCondition($query, $item->status);

        $query->execute();
    }
547402
protected function setTitleEditCollectionItem()
    {
        $vars = array('%name' => $this->data_collection['title']);

        if (empty($this->data_collection_item['collection_item_id'])) {
            $text = $this->text('Add item to %name', $vars);
        } else {
            $text = $this->text('Edit item of %name', $vars);
        }

        $this->setTitle($text);
    }
1352362
public void handleSelection(String itemId) {

        Collection<?> selection = (Collection<?>)m_fileTable.getValue();
        if (selection == null) {
            m_fileTable.select(itemId);
        } else if (!selection.contains(itemId)) {
            m_fileTable.setValue(null);
            m_fileTable.select(itemId);
        }
    }
1039500
def item(title, url = '#', options = {})
      raise 'item third parameter expects a Hash' unless options.kind_of?(Hash)

      prev_item = menu_items.last

      if prev_item.parent == true # This came from root or dropdown
        lft = prev_item.lft + 1 # Go down. from lft
        rgt = prev_item.rgt + 1
      else
        lft = prev_item.rgt + 1 # Go accross, from rgt
        rgt = prev_item.rgt + 2
      end

      menu_items.each do |item|
        item.rgt = (item.rgt + 2) if item.rgt > (lft - 1)
        item.lft = (item.lft + 2) if item.lft > (lft - 1)
      end

      atts = build_menu_item_attributes(title, url, options).merge({:lft => lft, :rgt => rgt})

      menu_items.build(atts)
    end
87073
public function saveItem( MShop_Common_Item_Interface $item, $fetch = true )
	{
		$iface = 'MAdmin_Log_Item_Interface';
		if( !( $item instanceof $iface ) ) {
			throw new MAdmin_Log_Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
		}

		if( ! $item->isModified() ) {
			return;
		}

		$context = $this->_getContext();

		try {
			$siteid = $context->getLocale()->getSiteId();
		} catch( Exception $e ) {
			$siteid = null;
		}

		$dbm = $context->getDatabaseManager();
		$dbname = $this->_getResourceName();
		$conn = $dbm->acquire( $dbname );

		try
		{
			$id = $item->getId();

			if( $id === null )
			{
				/** madmin/log/manager/default/insert
				 * Inserts a new log record into the database table
				 *
				 * Items with no ID yet (i.e. the ID is NULL) will be created in
				 * the database and the newly created ID retrieved afterwards
				 * using the "newid" SQL statement.
				 *
				 * The SQL statement must be a string suitable for being used as
				 * prepared statement. It must include question marks for binding
				 * the values from the log item to the statement before they are
				 * sent to the database server. The number of question marks must
				 * be the same as the number of columns listed in the INSERT
				 * statement. The order of the columns must correspond to the
				 * order in the saveItems() method, so the correct values are
				 * bound to the columns.
				 *
				 * The SQL statement should conform to the ANSI standard to be
				 * compatible with most relational database systems. This also
				 * includes using double quotes for table and column names.
				 *
				 * @param string SQL statement for inserting records
				 * @since 2014.03
				 * @category Developer
				 * @see madmin/log/manager/default/update
				 * @see madmin/log/manager/default/newid
				 * @see madmin/log/manager/default/delete
				 * @see madmin/log/manager/default/search
				 * @see madmin/log/manager/default/count
				 */
				$path = 'madmin/log/manager/default/insert';
			}
			else
			{
				/** madmin/log/manager/default/update
				 * Updates an existing log record in the database
				 *
				 * Items which already have an ID (i.e. the ID is not NULL) will
				 * be updated in the database.
				 *
				 * The SQL statement must be a string suitable for being used as
				 * prepared statement. It must include question marks for binding
				 * the values from the log item to the statement before they are
				 * sent to the database server. The order of the columns must
				 * correspond to the order in the saveItems() method, so the
				 * correct values are bound to the columns.
				 *
				 * The SQL statement should conform to the ANSI standard to be
				 * compatible with most relational database systems. This also
				 * includes using double quotes for table and column names.
				 *
				 * @param string SQL statement for updating records
				 * @since 2014.03
				 * @category Developer
				 * @see madmin/log/manager/default/insert
				 * @see madmin/log/manager/default/newid
				 * @see madmin/log/manager/default/delete
				 * @see madmin/log/manager/default/search
				 * @see madmin/log/manager/default/count
				 */
				$path = 'madmin/log/manager/default/update';
			}

			$stmt = $this->_getCachedStatement( $conn, $path );
			$stmt->bind( 1, $siteid, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 2, $item->getFacility() );
			$stmt->bind( 3, date('Y-m-d H:i:s' ) );
			$stmt->bind( 4, $item->getPriority(), MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 5, $item->getMessage() );
			$stmt->bind( 6, $item->getRequest() );

			if( $item->getId() !== null ) {
				$stmt->bind( 7, $item->getId(), MW_DB_Statement_Abstract::PARAM_INT );
				$item->setId( $id );
			}

			$stmt->execute()->finish();

			if( $id === null && $fetch === true )
			{
				/** madmin/log/manager/default/newid
				 * Retrieves the ID generated by the database when inserting a new record
				 *
				 * As soon as a new record is inserted into the database table,
				 * the database server generates a new and unique identifier for
				 * that record. This ID can be used for retrieving, updating and
				 * deleting that specific record from the table again.
				 *
				 * For MySQL:
				 *  SELECT LAST_INSERT_ID()
				 * For PostgreSQL:
				 *  SELECT currval('seq_malog_id')
				 * For SQL Server:
				 *  SELECT SCOPE_IDENTITY()
				 * For Oracle:
				 *  SELECT "seq_malog_id".CURRVAL FROM DUAL
				 *
				 * There's no way to retrive the new ID by a SQL statements that
				 * fits for most database servers as they implement their own
				 * specific way.
				 *
				 * @param string SQL statement for retrieving the last inserted record ID
				 * @since 2014.03
				 * @category Developer
				 * @see madmin/log/manager/default/insert
				 * @see madmin/log/manager/default/update
				 * @see madmin/log/manager/default/delete
				 * @see madmin/log/manager/default/search
				 * @see madmin/log/manager/default/count
				 */
				$path = 'madmin/log/manager/default/newid';
				$item->setId( $this->_newId( $conn, $context->getConfig()->get( $path, $path ) ) );
			}

			$dbm->release( $conn, $dbname );
		}
		catch( Exception $e )
		{
			$dbm->release( $conn, $dbname );
			throw $e;
		}
	}
674819
def set_item_data(self, item, filename, line_number):
        """"""
        set_item_user_text(item, '%s%s%d' % (filename, self.SEP, line_number))
208344
@SuppressWarnings("unchecked")
    void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {

        if (!event.isCtrlKey() && !event.isShiftKey()) {
            changeValueIfNotMultiSelect(itemId);
            // don't interfere with multi-selection using control key
            if (event.getButton().equals(MouseButton.RIGHT) || (propertyId == null)) {
                Set<String> jobIds = new HashSet<String>();
                for (CmsJobBean job : (Set<CmsJobBean>)getValue()) {
                    jobIds.add(job.getJob().getId());
                }
                m_menu.setEntries(getMenuEntries(), jobIds);
                m_menu.openForTable(event, itemId, propertyId, this);
            } else if (event.getButton().equals(MouseButton.LEFT)
                && TableProperty.className.toString().equals(propertyId)) {

                String jobId = ((Set<CmsJobBean>)getValue()).iterator().next().getJob().getId();
                m_manager.defaultAction(jobId);
            }
        }
    }
256139
function _add_item(in_arg_key, data){

	var retval = false;
	if( typeof anchor.current_data[in_arg_key] == 'undefined' ){
	    // BUG/TODO: this should be a copy.
	    anchor.current_data[in_arg_key] = data;
	    //ll("add_item: adding key (w/data): " + in_arg_key);
	    retval = true;
	}
	return retval;
    }
249146
protected function preserveItem($field, $value, array &$item_rules)
    {
        if (! array_key_exists($this->_preserve_field, $item_rules)) {
            $preserve = false;
        } else {
            $preserve = $item_rules[$this->_preserve_field];
            unset($item_rules[$this->_preserve_field]);
        }
        
        if ($preserve) {
            $this->errorHandler()->addValue($field, $value);
        }
    }
199746
public function addItem(
        $itemData,
        $locale,
        $userId,
        OrderEntity $order,
        ItemInterface $lastProcessedProductItem = null
    ) {
        $item = $this->itemManager->save(
            $itemData,
            $locale,
            $userId,
            null,
            null,
            $order->getCustomerContact(),
            $lastProcessedProductItem
        );

        $order->addItem($item->getEntity());

        return $item;
    }
333028
public static function getStaticItem( int $item_id, string $locale = 'en_US', string $version = null ) : array
	{
		$data = self::getStaticItems($locale, $version);
		if (isset($data['data'][$item_id]) == false)
			throw new ArgumentException('Item with given ID was not found.', 404);

		return $data['data'][$item_id];
	}
841727
protected function formatItemField(ItemFieldInterface $field, ItemInterface $item)
    {
        $elements = [];

        $method = $field->getMethod();
        $values = $item->{$method}();

        if (null === $values) {
            return $elements;
        }

        if (!is_array($values)) {
            $values = [$values];
        }

        foreach ($values as $value) {
            $elements[] = $this->formatWithOptions($field, $item, $value);
        }

        return $elements;
    }
302545
public function item($modelName, $itemId = 0)
    {
        $bladeName = 'admin.model.pages.form';
        \View::composer($bladeName, ModelViewComposer::class);
        parent::item($modelName, $itemId);

        return $this->view = view($bladeName, $this->view->getData());
    }
514641
public function item($modelName, $itemId = 0)
    {
        $config            = app('itemconfig');
        $fieldFactory      = app('admin_field_factory');
        $actionFactory     = app('admin_action_factory');
        $columnFactory     = app('admin_column_factory');
        $actionPermissions = $actionFactory->getActionPermissions();
        $fields            = $fieldFactory->getEditFields();

        //if it's ajax, we just return the item information as json
        if ($this->request->ajax()) {
            //try to get the object
            $model = $config->getModel($itemId, $fields, $columnFactory->getIncludedColumns($fields));

            if ($model->exists) {
                $model = $config->updateModel($model, $fieldFactory, $actionFactory);
            }

            $response = $actionPermissions['view'] ? response()->json($model) : response()->json(array(
                'success' => false,
                'errors'  => 'You do not have permission to view this item',
            ));

            //set the Vary : Accept header to avoid the browser caching the json response
            return $response->header('Vary', 'Accept');
        } else {
            $view = view('administrator::index', array(
                'itemId' => $itemId,
            ));

            //set the layout content and title
            $this->layout->content = $view;

            return $this->layout;
        }
    }