You need to sign in to do that
Don't have an account?
Yoshinori Mori
Execute SOQL with selected date on the calender
Is there any method to execute SOQL with selected date on the calender?
As far as I understand, I should use action support tag and "on onclick" or "on chage" for event on visual force page.
I appreciate if you could help me with Apex code either..
Thanks
Mori
onchange is what you are looking for, something like this:
Thank you for the reply.
Could it be possible to let me know how the selected date sent to SOQL call method as a parameter and run in SOQL.
Is there any utility method like "=Date.selected( )" ?
Mori
You use a "binding" (think of an inline placeholder, much like a SQL variable) in order to pass it directly into the query statement. For example, you might do this:
Literally, all you have to do is bind to it by using a colon ":" character followed by the name of the variable as it exists in your controller.
Thank you for the addtional info.
According to a message posted and titled "pass selected date value to controller" by other contributor. he asked with example as below.(It seemds like there was no reply to it.)
Calling another DBAAccess class from the controller below to pass "actyvitydate" on the calender as a parameter can query records which have matched-dates with the activitydate?
Does this also work?
http://boards.developerforce.com/t5/Apex-Code-Development/pass-selected-date-value-to-controller/td-p/229449
controller:
Task t = new Task();
public Date selecteddate = t.activitydate;
public Task getTask() { return t; }
page:
<apex:inputField value="{!task.activitydate}"/>
Mori
I don't think it would work the way you expect if you do it this way (there's no setter method, and the task is transient and not part of the view state; there's no way for the selected date to get back into the controller). Personally, I'd recommend that you have a public variable:
Which is then initialized in the constructor:
You can do it however you'd like, so long as there is a setter method so that the value can get back into the controller.
Thank you so much for the additional info.
I'll try this.
Mori