Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Dropdownfield in DOM ?! Dropdown in Popup = Yes, Dropdown Content = No :(


Go to End
Reply

9 Posts   1385 Views

Avatar
benni91

30 July 2011 at 9:35am Community Member, 72 Posts

Hi everyone,

i'm trying to build a "clients opinion" page, where clients can tell there opinion about a done project.
Now i got caught on the Dropdownfield in the DOM where you can choose the client and a person who's responsible for this project.
Booth of this Informations are stored in the ClientObject.

My problem is, that the dropdown field didn't get the content from the clientobject :/

You should access the whole thing over the HomePage.

can someone help me out?

here's the code

OpinionObject.php -> http://pastie.org/2291897
ClientObject.php -> http://pastie.org/2291894
HomePage.php -> http://pastie.org/2291883

THX :)

Avatar
benni91

2 August 2011 at 7:30am Community Member, 72 Posts

No One ?

Avatar
UncleCheese

2 August 2011 at 2:17pm 4085 Posts

I'm unclear on what you're trying to do.. You didn't have any has_one relations set up for those drop downs.. you still have a has_many that isn't being used.. but this should at least get you started.

http://pastie.org/2306916

Avatar
benni91

3 August 2011 at 2:30am Community Member, 72 Posts

Thx for the help.

I'll do the rest later @home. After Testing it i'll report my result :)

Avatar
benni91

3 August 2011 at 9:35am (Last edited: 3 August 2011 10:39pm), Community Member, 72 Posts

Thx that works :)

but what if i got 2 dropdowns?

can i do it like this than:

   public function getCMSFields_forPopup() {
      $map = array();
      if($set = DataObject::get("ClientObject")) {
      $map = $set->toDropdownMap('ID','Name');

      $map2 = array();
      if($set2 = DataObject::get("OtherObject")) {
      $map2 = $set2->toDropdownMap('ID','Other');
   }

Avatar
UncleCheese

4 August 2011 at 1:55am 4085 Posts

Yup!

Avatar
benni91

4 August 2011 at 2:10am Community Member, 72 Posts

so
$map and $set are just variables which i can rename however i want ?

Avatar
UncleCheese

4 August 2011 at 6:06am 4085 Posts

Yup!

Go to Top