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 8413933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:02:08+00:00 2026-06-10T01:02:08+00:00

I have one getCMSField_forpopup form for an event. I made another popup inside that

  • 0

I have one getCMSField_forpopup form for an event. I made another popup inside that to give multiple dates to that event(using has_many relation). When I give date 2 different dates/times to event “A” and then after saving event “A”, I open main getCMSField_forpopup to enter details of another event “B” then I see dates/times (complextablefield) already there which were actually meant to appear in event A’s detail not in event “B”. I want to see those only with A not with every new event. How can I make that possible ?

  • 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-10T01:02:10+00:00Added an answer on June 10, 2026 at 1:02 am

    Your problem is that you enter Dates for 1 Event, but then you can see this Dates on every single Event?

    to me this sounds like either your Event has no ID at this time and therefore a query on Dates “WHERE EventID = x” does not work, or your Dates get saved without the ID of the Event

    You could simply check your database if your Dates have the ID of an Event set.

    1. If the ID if the Event is 0, then the issue is that you are not saving the event ID, this either means that:

      • you have created the Dates before saving the Event, in this case the solution is just saving the Event before you add Dates, you could also hide the Dates field when it has not been saved, see below the $this->isNew() stuff
      • or silverstripe fails to save the EventID, in this case you could fix it by adding a hidden field to your getCMSFields_forPopup of the Date and save the Event ID there, but its gonna be a little tricky getting this ID into the popup
    2. if this is not the issue, then the problem is that when you create a new Event it has no ID, and therefore can not filter by ID, you can simply do this inside your getCMSFields_forPopup of the Event:

      if (!$this->isNew()) {
         // add your ComplexTableField for Dates here so it only 
         // gets added if this record has already been saved
      }
      

    But actually I would recommend using nested DataObjectManager (a DataObjectManager inside a DataObjectManager)(see tutorial on youtube: http://youtu.be/eeXOTlXFmQQ), DataObjectManager does all that work for you, so this problem should not occur.
    It only displays the DataObjectManager for Dates if you have already saved the Event once, otherwise it tells the user that he needs to save it first.
    And it also sets the Event ID on the Dates for you

    Or, even better, you could upgrade to SilverStripe 3, where you can use GridField.
    GridField works way better then DataObjectManager and looks a lot nicer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one table which contains events and dates, and another which contains the
I have one parent div with style position relative and couple divs inside that
I have one service that simply is for starting and stopping another service I
I have one thread that writes results into a Queue. In another thread (GUI),
I have one Master LinearLayout with several other LinearLayouts nested inside of it that
I have one entire html openning inside an iframe that contains a javascript function
have one time consuming step that flattens a bunch of files. basically i'd like
I have one model User and will be creating another one Category . Both
I have one testing module that I want to use for android testing. I
I have one page design with scrolling eased by jquery using this code: function

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.