Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Unable to change Item / Appointment (Read 1119 times)
SoFtYTech101
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Oct 4th, 2022
Unable to change Item / Appointment
Oct 4th, 2022 at 11:37pm
Print Post  
Hello !
Hope you all are doing fine.
I have a problem with changing / updating existing Item in Calendar. After clicking, on Item it opens AppointmentForm with correct data which is fine. After I change "description" and press "Save" it updates the Item on the Calendar (I can see the new value).
But after changing "subject" and pressing "Save" nothing happens, the old value remains.
Also after clicking, Item can be edited in the Calendar itself.
I think it has something to do with "setAllowInplaceEdit".
When I set that to false it works.

I think that it doesn't work just because it takes the "inplaceEdit" text as a new value which is the same as the old one and not the value typed in AppointmentForm.


Is there a way to be able to move and "resize" item with setting setAllowInplaceEdit(false)?

Thank you!


  

Cal-err.jpg ( 211 KB | 69 Downloads )
Cal-err.jpg
cal-err2.jpg ( 212 KB | 75 Downloads )
cal-err2.jpg
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Unable to change Item / Appointment
Reply #1 - Oct 5th, 2022 at 6:22am
Print Post  
Hi!

If AllowInplaceEdit is enabled and you display appointment form in response to clicks or double-clicks, the inplace-edit editor interferes, applying the old text once it closes. If you want to allow both inplace-edit and appointment form, you should be able to cancel the inline editor before displaying the form, e.g.

Code
Select All
calendar.addCalendarListener(new CalendarAdapter()
{
    @Override
    public void itemClick(ItemMouseEvent e)
    {
        // display the form if item is double-clicked
        if (e.getClicks() != 2)
            return;

        calendar.endInplaceEdit(false);
        calendar.abortDelayedInplaceEdit();
        calendar.resetDrag();

        // create the form
        AppointmentForm form = new AppointmentForm(calendar.getSchedule());
        form.setTitle(e.getItem().getHeaderText());
        form.setAppointment((Appointment)e.getItem());
        form.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);

        // display the form to the user
        form.setVisible(true);
    }
...
 



Otherwise you can just keep AllowInplaceEdit disabled. Setting it to false only prevents editing text by single-click, while moving / resizing items is still allowed.

Regards,
Slavcho
Mindfusion
« Last Edit: Oct 5th, 2022 at 9:18am by Slavcho »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint