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

  • Home
  • SEARCH
  • 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 6234277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:27:20+00:00 2026-05-24T10:27:20+00:00

I’ve been using binding frameworks for a while now and i’d like to know

  • 0

I’ve been using binding frameworks for a while now and i’d like to know how you handle this cases.

You have a newspaper that has some attributes like

  • (String) headline
  • (Boolean) published
  • (Date) publishmentDate

On your view, you have a list of newspapers, than can be edited all in the same time. This means you can change the headlines of all newspapes, or all their state “published” in a single request.

The matter is that, as we are using a binding framework, you will edit the newspapers’ data a bit like if you were editing the data in a DB… binding each value to a field, independently from each others.

But… what i’d like to do is that when i publish a newspaper, the publishmentDate is updated to the current date.
I could for sure put a publishmentDate field on the form, or even a hidden field setted to the current date… But this is neither clean or secure.

I think it’s better to have an action publish() that will set the flag to true, but also update the publishmentDate (and other logic if needed…)

I just wonder how do you handle that?

I’ve seen and thought about different approaches:


1) Sometimes we bind the new parameters to an existing persistent ORM entity.
This means we retrieve the entity just before the binding, so that we bind the values to an existing, “already filled” entity object. This is sometimes called “hydrating the entity”
Thus the only way to know if you have to launch a “publish action” is by comparing the old field with the new one, so that you know if it was edited and in which direction (false->true = publish)
It’s possible to use an ORM listener, (like @PostLoad, a Hibernate Interceptor/EventListener or anything else) so that you keep these “before binding” values you need.

This works nice but it’s quite “weird” to launch a publish action on the vehicle, while the binding already set the published flag to true.


2) It’s possible to do nearly the same thing but to use another flag… for exemple a flag that represents the user wish to publish a newspaper.
Thus you don’t have to compare with the previous value, you just check if the user wish to publish a newspaper and then launch the action… (and the real published flag was still = false when you launched the action this time…)

The matter is that as you are using a binding framework, you want the published checkbox to be checked on your view for newspapers that have already been published.
So if the attribute for binding is now published_wish, you’ll have to set it a value or all your checkboxes will always be unchecked…
This means that you’ll have, before showing the view, do something like published_wish = published
Most times the wish flag will not be persisted, but i’ve seen some cases where the “wish” MUST BE persisted, thus no need to do published_wish = published


3) Use an empty non persisted entity for the binding, then recopy the values of this non persisted entity to the real persisted object.
So when you recopy the values from one object to the other, you can launch any action you want, customize everything…
But it’s a bit heavy to have to recopy all these parameters…


There may be other ways to do…

How would you do that? So that it doesn’t just work well, but it is also elegant, maintenable… i don’t see any perfect solution here

  • 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-05-24T10:27:21+00:00Added an answer on May 24, 2026 at 10:27 am

    I agree with you and I would also use a Publish button in this case (with possibly an “Unpublish” button as well), allowing the user to select multiple articles and publish them all at once. I wouldn’t allow the user to edit the Published checkbox and the publication date directly.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
Does anyone know how can I replace this 2 symbol below from the string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm looking for suggestions for debugging... If you view this site in Firefox or
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a text area in my form which accepts all possible characters from
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.