Setting next date to devexpress dateedit - asp.net

I have one devexpress dateedit control.i am trying to provide navigation to it.i kept two buttons "next" and "prev" when user click next button i want to change the current date to next date for example if current date is 02/feb next date is 03/feb like that.similarly for previous button.
how i can achieve this using java script.
Thanks in advance.
Arasu

This example has everthing you need and more.

Give your control a clientinstancename (myDateEdit or something), and refer to the control in that manner. Then in the function called by the next button get the date from the control and set it to a Date. Then set the date plus one day back to the control.
var curDate = myDateEdit.GetDate();
var newDate = new Date(curDate);
newDate.setDate(curDate.getDate() + 1);
myDateEdit.SetDate(newDate);

Related

Google Appmaker: Update form based on selected dropdown option

I have an AppMaker app that has a from based off of one address table/datasource. I can get a form with next/prev buttons, but replaced the key field (name) with a dropdown list of all names (a user can start typing names to jump there, with the dropdown showing).
My hope is that when a user selects from the dropdown, the entire form updates and the next/prev buttons work properly as well (there too many records to page thru with next/prev only). I don't have to have next/prev functionality if it complicates things too much.
Currently the dropdown is working, but I cannot get the index for the next/prev buttons set or the rest of the form to reflect the selected dropdown record.
I've tried to set the "onValueEdit" event to something like this...
var selected = widget.value;
var idx = widget.options.indexOf(selected);
console.log("Selected: "+selected+", index = "+idx+"\n");
if(idx < 0) { //...this error is never hit
console.log("Index error - setting to zero!\n");
idx = 0;
}
widget.datasource.loadPage(idx); //...update form?
Two observations via console logging:
The "idx" var is never set to the selected dropdown index reliably, and is
often "0" (tho no error msg ever shows), so the "indexOf()" function
isn't working as expected.
The "selected" var (name) is always correct.
If I call widget.datasource.loadPage(...) with a fixed value (say 5) it has no effect on what is shows in the form either (previous loaded data remains) - obviously not the way to do it :v/
Can you steer a noob in the right direction?
If you are using default App Maker form, then you can see that so-called pager, doesn't actually paginate. It triggers prevItem/nextItem datasource methods, in other words it navigates through datasource items, not pages. Here is a quote from App Maker docs:
nextItem: Selects the next item. For Query Datasources, if the current item is the last item on the page, then this loads the next page and selects the first item on the newly loaded page.
So, if you already have all your items loaded(you set query page size for your datasource to 0), then you need just to change selected item within datasource:
// onValueEdit dropdown event
// assuming, that form and dropdown share same datasource
widget.datasource.selectKey(newValue._key);
If you really have lots of items and it is not feasible to load all of them in one call... then it will be all another story...
UPDATE:
It's important that Options and Value are set as shown in the image below!
However, I had trouble setting them that way (read: wasted hours!) until I wiped them both completely using More options in the binding picklist, and tried again (I had even tried on a brand new app!). I was being forced to choose ..projections.. and then a final field before the OK button would be available.
Not sure if AppMaker is buggy here or there is something simple I'm not understanding!
None of the coding in my original question is required.
Once set this way, binding just works as you would expect it!!
All other fields are set as #datasource.item. and are bound to whatever item is chosen. No Events settings are necessary for the dropdown either, as I thought they might be.
I deleted this page and started again, and replaced the default business name data field with a drop down, I set the dropdown as:
Options: #datasources.Addresses.items
Value: #datasources.Addresses.item
It works fine?! Not sure what happend in my original page!
UPDATE:
So it seems you need to delete both the Value and Options and then re-enter these. The OK will light up when you do.
Also, my original take on App Maker was to build the UI and attach data. That was my first mistake. You build the data then have App Maker build edit/add pages for you.

Change column label on grid (PeopleSoft)

I'm having problems changing the label of a column on a PeopleSoft grid.
I have this code on the RowInit event of the main record:
Local Grid &Grid;
Local GridColumn &Column;
&Grid = GetGrid(Panel.V91MG_BI_INGMAN, "GRID");
&Column = &Grid.GetColumn("DATO_01");
&Column.Label = "Test";
The grid is composed of a Table record and a Derived/Work record. I need to rename the columns of the Derived record.
This is how the page looks like on designer view:
When I test my page, I receive the following message:
I know the grid is being set correctly, as I can change its label using &Grid.Label = "Hi".
Thanks in advance!
Your peoplecode is correct so far. You should move this code to the page activate event.
Did you set the page field name for this column?
If you want to change label only you can do same without writing code.
Go to page fields properties.
Select tab 'Label'
Select Text Radio and enter column label.

OnClick on ticketid need to open a details of ticket using birt report

I had a requirement to create a report based on individual user whom having SR waiting for approval, On click on Ticket id the URL's should redirect to SR detailed page where he can check request approve or disapprove.
using hyper link in birt properties unable to pass the ticketid by using below url's
http://google.com/maximo/ui/maximo.jsp?event=loadapp&value=asset&additionaleventvalue=Ticketid
Could you anybody help in this regards.
If the cell you made clickable contains the ticketId, go to Properties -> Hyperlink -> Edit...
Select hyperlink type URI, and click the dropdown to the right of 'Location' to go to the Javascript window.
If you're going to use it more than once, I would make the static part of your hyperlink a variable. Then add the ticketId by clicking "column bindings" in the left-lower column in the JavaScript window and selecting the appropriate cells in the middle and right columns. You'd get something like
vars["staticPartOfHyperlink"] + row[TICKETID]
If you'd rather not use a variable, you can hard-code the static part (don't do this, it's ugly and asking for trouble):
"http://google.com/maximo/ui/maximo.jsp?event=loadapp&value=asset&additionaleventvalue=" + row[TICKETID]

Asp.net Calendar/Grid with single click entry

I'm looking for an asp.net calendar/scheduler control that will allow for single click entry.
I checked out Telerik and a few others but they seem to require double click, and then a prompt, then entry then save.
The control should act like a grid where we could input data, tab between days etc.. making it very easy to populate data for that month
Any suggestions?
That's a tough call. Most calendaring packages that I have seen require a double-click to begin entry from the schedule view. In this way, the interface can differentiate between selecting a date or time window and attempting to create or edit an entry.
In the Telerik RadScheduler control you could override the OnClientTimeClick event to immediately call Scheduler.showInsertFormAt. This could give you the single-click effect you are looking for:
<telerik:RadScheduler ID="RadScheduler1" runat="server"
DayStartTime="05:00:00" DayEndTime="18:00:00"
DataKeyField="Id" DataSubjectField="Subject" DataStartField="StartDateTime" DataEndField="EndDateTime"
OnClientTimeSlotClick="onTimeSlotClick"></telerik:RadScheduler>
<script type="text/javascript">
function onTimeSlotClick(sender, eventArgs) {
var scheduler = $find('<%= RadScheduler1.ClientID %>');
scheduler.showInsertFormAt(eventArgs.get_targetSlot());
}
</script>

Richfaces calendar manual input value not binding

I've got a richfaces calendar component defined as
<rich:calendar id="startDate" value="#{myBean.dateSet.startDate}"
timeZone="#{myBean.dateSet.timeZone}"
datePattern="#{myBean.dateSet.datePattern}"
enableManualInput="true" immediate="true">
<a4j:support event="onchanged" action="#{myBean.adjustEndDate}"
reRender="startDate,endDate" ajaxSingle="true" />
</rich:calendar>
when I'm changing the date using the calendar popup/gui everything is working fine.
However when I'm changing it via the input text field, the value is not being updated to myBean.dateSet.startDate, although it is being updated correctly on the calendar component itself (i.e. if I click the icon for calendar popup it shows the updated current date).
Any suggestions on how I can get it to update the value to myBean correctly?
Thanks!
Use oninputchange event, that's the one that tracks manual changes.
I'm not sure if this helps, but if you want to get the value inside the input text field, you refer to it as <calId>InputDate . So in your case, the input text field will have id startDateInputDate. Hope this helps somehow!
You can use the oninputchange event inside the rich:calendar component like Max Katz suggested.
For example:
<rich:calendar
...
oninputchange="invokeCalendarOnChange(event,'#{rich:clientId('$idOfTheCalendar')}')"
...
</rich:calendar>
function invokeCalendarOnChange(event, id) {
var c = RichFaces.$(id);
c.invokeEvent("change", RichFaces.getDomElement(c.id), event, c.selectedDate);
}
Hope that helps!

Resources