myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Patt-Corner" <robi...@gmail.com>
Subject Java MethodBinding syntax for Tomahawk Scheduler ScheduleMouseEvent
Date Fri, 28 Dec 2007 05:18:12 GMT
Hi ...

Can someone assist me with how to create a method binding in a Java backing
bean that will successfully bind a tomahawk Scheduler component's
ScheduleMouseEvent?

I find that I can create valuebindings with no problem, and action
methodbindings (which take no argument).  However any attempt to create a
methodbinding for a method
that has a nonempty signature results in the method not being found by the
methodbinding code.

for example, in the code below the commented out line attempts to bind the
mouse listener to an extant method.  If the method exists with the proper
signature:

public void handleScheduleClick(ScheduleMouseEvent event)
or even:
public void handleScheduleClick(Object e){

we get a "method not found" from the binding code.

If, however the method has no arguments:
public void handleScheduleClick()

then all goes swimmingly ... except that the arguments are wrong and we get
the corresponding error.

Clearly I'm missing something, probably how to add an argument to a method
binding from the Java side.

FWIW, the tag code, should I use a tag, works fine -- but I need to generate
these schedules dynamically in tabs.

My current workaround involves dredging up the schedule in the action method
and probing for its lastClickedDate, but it's not a pretty sight.

Any thoughts?

R.




============= Attempted Method Binding===============
HtmlSchedule mySchedule = new HtmlSchedule();
            mySchedule.setId("schedule" + p.getPid());
            mySchedule.setValueBinding("value", scheduleBinding);
            mySchedule.setValueBinding("visibleStartHour",
createValueBinding("#{scheduleSettings.visibleStartHour}"));
            mySchedule.setValueBinding("visibleEndHour",
createValueBinding("#{scheduleSettings.visibleEndHour}"));
            mySchedule.setValueBinding("workingStartHour",
createValueBinding("#{scheduleSettings.workingStartHour}"));
            mySchedule.setValueBinding("workingEndHour",
createValueBinding("#{scheduleSettings.workingEndHour}"));
            //mySchedule.setValueBinding("readonly", createValueBinding("#{
scheduleSettings.readonly}"));
            mySchedule.setValueBinding("theme", createValueBinding("#{
scheduleSettings.theme}"));
            mySchedule.setValueBinding("compactWeekRowHeight",
createValueBinding("#{scheduleSettings.compactWeekRowHeight}"));
            mySchedule.setValueBinding("compactMonthRowHeight",
createValueBinding("#{scheduleSettings.compactMonthRowHeight}"));
            mySchedule.setValueBinding("detailedRowHeight",
createValueBinding("#{scheduleSettings.detailedRowHeight}"));

            //mySchedule.setMouseListener(createMethodBinding("#{
providerTemplateScheduleHandler.handleScheduleClick}"));

            mySchedule.setAction(createMethodBinding("#{
providerTemplateScheduleHandler.scheduleAction}"));
            mySchedule.setReadonly(false);
            mySchedule.setSubmitOnClick(true);
            UIComponentTagUtils.setStringProperty(getFacesContext(),
mySchedule, "headerDateFormat", "EEEE");
=========End===============

Mime
View raw message