How to detect which button is pressed in af:Calendar? - jsf

I have implemented an af:calendar in my page. Everything goes fine, apart that I cannot control it, I can not control when the user changes the views of the calendar or when the user moves to a different week or month. Does anyone knows how to detect what operations the user is making with the calendar.

Actually everything is described pretty well in the documentation.
The calendar does not fire "high level" events, for example it does
not fire specific events for edit, delete, create, context menu, etc.
Instead calendar fires the "low level" Calendar and CalendarActivity
events.
Let's take a calendarActivity. A calendarActivityEvent will be queued
if the user does any of the following on a calendarActivity
clicks
right clicks
focuses and presses a key
Even though a calendarActivityEvent is queued for all these, you can
tell these apart because keyboard, mouse, and triggerType information
will also be available in the event.
More details provided here.
If you need something really special, you can always resort to something like jquery to handle UI events and then relay it to the java side.

Related

NetSuite: Calling an API in real time as field values get updated

I'm looking for a way (using SuiteScript 2.0) to handle real-time persistent (stored) field updates, where a field might have changed in NetSuite (for example a lead time was just updated), and it doesn't matter if a user saved the change, or some other automated process changed that field. I just want to be able to pick up on that change:
The moment that it's done, and
Without regard for who or what kicked it off (e.g. it could be a person, but it could also be an automated change from a workflow, or a formula on the field itself which pulls values from another field)
Doing some research I found some options that looked somewhat promising at first. One being the afterSubmit event in a client script, and the other being the fieldChanged event. My issue however is, from what I understood those only really seem to be triggered by a user manually going in and making those changes, but this is only one part of the puzzle and doesn't seem to cover changes made outside of the scope of the user making those changes. Is that correct however? Or would one of those events still be able to capture changes done to that field regardless of who (or what) initiated or triggered the change, and right at the moment the change was saved/ persisted to the database?
UserEvents are basically triggers. In their deployment records you can set the context in which they fire so you can get them to fire in all circumstances (called contexts in Netsuite) but one.
That circumstance is User Events are not fired for record saves made in User Event scripts. i.e., if an AfterSubmit UserEvent script loads, changes and saves your record a fresh user event will not be fired.

Is there IndexChanged event for grid in Acumatica

Acumatica has plenty of events for views like Row_Updated, Field_Updated. I search for something like Index_Changed event but for now I can't find. Does it have some other name or exists at all?
There's no row selected index changed event that will bubble up to the graph. Instead there's a bunch of mechanisms designed to solve a narrow problem that would have required that missing event, these are the likes of DependOnGrid, StateColumn, AutoCallback/Refresh, Sync Position etc.
The reasoning behind this design could be to reduce the number of callbacks from the webpage to the server. From the user point of view, changing row selection is not a transactional operation. Having the webpage wait for the server at that time would make the webpage appear sluggish.

How to put a limit of the clicks on the button in real time?

I have a question recently: How can we realize the restriction on the button clicks in real time?
For example, there is a restriction in 10 clicks on a button. For example Bob clicked on the button and then Bob and Rob saw that there stayed 9 clicks. After the 10th pressing the button is disabled.
What will you advise?
Use a database to track the number of clicks
Depending on your functional needs, you probably want to be on the "immediate consistency" end of the spectrum vs "eventual consistency" so either use a traditional relational database with constraints and transactions or store the clicks in a single mongodb document you can update atomically.
MongoDB You might set up a ClickTrackers collection and a document like:
.
{
button: "reserveSeat":
clickedBy: [userId1, userId2]
}
Then you could use $addToSet
a redis set might work well (assuming you are allowing 1 click per user)
You will want some real-time libraries to help you push updates out to connected browsers. Perhaps meteor.js or socket.io.js
There's no way to avoid the edge case of lag between showing a user there's 1 click left, someone else clicking it, and then the first user clicking it before the click count decreases to 0 (like buying tickets to a popular concert, for example), so you must handle this and write tests for it and have a UI to say to the user "oops no clicks left, actually, sorry"
Hopefully that gets you started, but as it is your question isn't following the stackoverflow guidelines as it is "too broad" and you haven't posted any code you've tried, so go try something and come back with some code snippets.

Breaking down 1 calendar event into smaller events in SharePoint

I'm trying to create some sort of reservation system in SharePoint using a calendar list. It's been recommend to me to create events and add a column which allows a user to claim it. From there, claimed events would change color and only those who've claimed the event would have permission to unclaim the event.
This is what it would look like (see alternative option):
What I'd like to be able to do though, is instead of having to create three events like shown in the alternative option, creating 1 event (see original) and have that be broken down into 3 events or more, maybe using some form of drop down asking for intervals (ie. 15m, 30m, 1h). Based on the selected interval, it'd break the event accordingly.
A possible solution is in your main event you add another field named Interval.
The you design a workflow when you create the event that creates new events according to the interval specified using a while loop while incrementing the start time with your interval.
Those new events have a content type with a field named UserClaimed. you then associate another workflow to those new events that checks for that field and changes permissions on the event to only allow modifications of that event to the user specified.
This is the general idea, the implementation should not be that hard
just a thought -
I mean, the reason i think you want the events to pre-exist is so that users can easily create them in the correct time slot (rather than clicking the new item menu, which throws them away from the calendar view/context). Is that right?
If so, allow me to offer you this scenario:
If you are using KWizCom's Calendar Plus web part (yeah, I work for KWizCom...) it allows you to type in the event in the calendar itself directly.
Something simple like: "1pm-2:30pm Training meeting with Josh"
check the demo video here: http://www.kwizcom.com/sharepoint-add-ons/sharepoint-calendar-plus-web-part/overview/
Also, drag and drop events in the calendar to move them easily, and it also supports color coding events based on categories (meta data, views, sources, etc.).
The one thing you will need to develop is the unique meeting logic, and owner permissions.
meaning, an event handler that does not accept 2 meetings at the same time for the same room (define the unique resource field, if any), and the logic that allows only the person who created an event to edit or delete it.
ping me, I can help with the event handler - perhaps we can add this to our product, this is actually a cool idea. my work mail is shai at kwizcom dot com

How should an IPhone notification-type application show user there is a notification unobtrusively

I have a program that basically just queries a webservice, and if any data is returned it will show that information to the user, but if there is nothing to display it will just wait until the next scheduled time and run.
Right now it just puts a table in front of the user, there is nothing in the status bar that they can then select and see the actual information.
So, I have two questions.
Is there a better way to show
notification information to a user
that is less intrusive?
Should the View, with a UITable,
have a button to dismiss the view
when they are finished?
UPDATE:
It seems my question isn't clear enough, so I have the data showing up in the table properly.
My problem is before I display the data.
Currently, periodically the timer will fire off my method, and if there is any events pending for the user the table will show up right in front of them.
That is bad design, IMO, so what I would like is some simple way to let them know that there is something pending and they can look at it when they get a moment.
Ideally I would have something in the status bar to show that they have some events, but it appears that isn't an option that I can see.
One option is to see if I can have the table come up minimized and have some sound or vibration go off, but again that can be bothersome to the user, as it may interrupt what they are doing.
The proper solution appears to be that while in the background just put up a notification if there is any new information, so the user can close the notification or switch to view the details.
This isn't the ideal solution, but appears to be the best choice on the iPhone.

Resources