Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8578605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:25:45+00:00 2026-06-11T20:25:45+00:00

I have the following model: class Model_GrantMinimal extends Model_Table { public $table=’grant’; function init()

  • 0

I have the following model:

class Model_GrantMinimal extends Model_Table {
    public $table='grant';

    function init() {
        parent::init();

        $this->hasOne('User');

        $this->getField('id')->hidden(true);
        $this->getField('user_id')->hidden(true);
        $this->addField('grant_number');
        $this->addField('grant_name');
    }
}

And inside the page I have the following code:

$grant=$this->add('Model_GrantMinimal');
$grant->load($id);
$user=$grant->ref('user_id');
        $field = $grantForm->addField('Dropdown','Manager');
        $field->setModel($user);
        $field
            ->validateNotNull()
            ->add('Icon',null,'after_field')
            ->set('arrows-left3')
            ->addStyle('cursor','pointer')
            ->js('click',$grantForm->js()->reload())
        ;

And everything works almost perfectly – how do I make sure the Dropdown ($field in php) is linked to the overall form, i.e. when I change the value in the dropdown that value is passed into the $grantForm->onSubmit – and how do I ensure the the defaultValue (pre-selected value) of the dropdown is the User that is set by user_id inside GrantMinimal

I’m loving the framework so far – its really impressive and coming from the .NET framework where MVVM and MVC are so common, specially with the latest WPF related. It has been a treat compared to the old way of writing HTML/PHP, just taking a while to fully understand whats what.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:25:46+00:00Added an answer on June 11, 2026 at 8:25 pm

    Figured it out after a couple of hours of debug tracing:

    class Model_GrantMinimal extends Model_Table {
        public $table='grant';
    
        function init() {
            parent::init();
    
            $this->hasOne('User');
    
            $this->getField('id')->hidden(true);
            $this->getField('user_id')->hidden(true);
            $this->addField('grant_number');
            $this->addField('grant_name');
    
            $this->hasOne('User');
    
            $this->getField('user_id')->caption('Manager')->hidden(false);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following model : class Model extends BaseModel { public function save($conn
In my GWT app I have the following model class: import com.google.gwt.user.client.rpc.IsSerializable; public class
I have the following model: public class Contact { public Contact() { Name =
I have the following model: public class Tag { public int Id { get;
I have the following model class Comment extends AppModel { var $useTable = comments;
I have following model: public class FormularModel { [Required] public string Position { get;
I have the following java model class in App Engine: public class Xyz ...
I have the following model: class A(models.Model): name = models.CharField(max_length=50) content_type = models.ForeignKey(ContentType) This
I have the following model in django: class Node(models.Model): name = models.CharField(max_length=255) And this
I have the following Model class: package com.swaranga.model; public final class Book { private

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.