wicket DatePicker - show last select value - wicket

I am using org.apache.wicket.datetime.markup.html.form.DateTextField (part of wicket-datetime-6.9.0-sources.jar ) with wicket 6.9.0
I need the DatePicker to auto select the last selected value, when it is opened an empty value.
As it is, when I open the date picker with an empty value no date is selected.
Last selected value, means , lets say somone choose 1.1.2019 so the next time the datepicker instance will b opened from another date field the value would show 1.1.2019

Related

Google Sheets: Show values on a tab depending on date

We have a restaurant and want to show the Menu on a screen with google sheets.
I am using 2 tabs in Google sheets, The main (number 1) with the menu showing to the visitors, the second tab (number 2) has all the dates from today until coming 6 weeks like:
Column A
Column B
Column C
Column D
21 June
Appetizer this day
Main dish this day
Desert today
22 June
Appetizer this day
Main dish this day
Desert today
23 June
Appetizer this day
Main dish this day
Desert today
etc. etc.
Now what we want is that the 3 menu items are copied to the main tab on the day of today, so if it is 22 June, the corresponding appetizer, main dish and desert are copied to the main tab.
Is that possible?
This can be achieved with Google Apps Script. You can have a JavaScript code snippet that does this for you.
Open the required spreadsheet. Go to the Tools menu and click Script Editor. This will open up the script editor window with an empty function, code will have to be written inside this function, give it a name, I'm using updateFood():
function updateFood() {
// Fetch all the sheets/tabs of the current spreadhsheet
let sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
// Select the second sheet/tab using [1], first tab will be [0]
// Fetching the second sheet because that is where the data about the upcoming dates are present
let listSheet = sheets[1];
// Get all the data in the sheet
let data = listSheet.getDataRange().getValues();
// Iterate over all data in the sheet
for(i = 0; i < data.length; i++) {
// Get the date of the current row and create a date object
rowDate = new Date(data[i][0]);
// Get today's date
today = new Date();
// Check if the row date is equal to today's date
if(rowDate.setHours(0,0,0,0) == today.setHours(0,0,0,0)) {
// If the code reaches here, this row has the date same as today
// Get the first tab/sheet and then I'm selecting the cells A1, B1 and C1
// Modify the range as per which cells you want the dish names to be in
let range = sheets[0].getRange("A1:C1");
// Set the values of the selected three cells as the value of the second, third and fourth column in the current row of the 2nd tab which are Appetizer, Main dish and Dessert for that date respectively
range.setValues([[data[i][1], data[i][2], data[i][3]]])
}
}
}
And that's all the code you need! Save it and then you can try clicking on run code and then checking the first tab to see the values updated. However, when you click run for the first time, Google will ask you to grant permissions to the script to access your sheet. Click Review Permissions and then click on your account. Then click Advanced and then click:
.
But you will have to run this code every day. This can be achieved using a time-driven trigger.
In the same script editor window, look at the triggers button on the left:
Click on the + Add Trigger on the bottom right of the screen.
And select the values as follows (change the time as required):
That's all you need. Make sure that in the second tab, create dates in the date column with the Excel DATE(YEAR, MONTH, DAY) function rather than manually typing in the dates.

How to edit a pdf generated using iReport?

I have generated this pdf using iReport. Now while viewing this pdf using document viewer, I need to edit that gross amount field and take print out. No need to saving the edited file. How is this possible?
iReports Custom Fields for columns (sum, average, etc)
Right-Click on Variables and click Create Variable
Click on the new variable
a. Notice the properties on the right
Rename the variable accordingly
Change the Value Class Name to the correct Data Type
a. You can search by clicking the 3 dots
Select the correct type of calculation
Change the Expression
a. Click the little icon
b. Select the column you are looking to do the calculation for
c. Click finish
Set Initial Value Expression to 0
Set the increment type to none
Leave Incrementer Factory Class Name blank
Set the Reset Type (usually report)
Drag a new Text Field to stage (Usually in Last Page Footer, or Column Footer)
Double Click the new Text Field
Clear the expression “Text Field”
Select the new variable
Click finish
Put the new text in a desirable position 

How to change date range which was entered as a parameter

for my evaluation I have set a date range as an input parameter. This chosen date range should be displayed in a textbox (by using a formula field for example).
What I reached so far is, that I choose a date range and CR goes through the corresponding data.
But I can only see the first and last date on which something happenend.
Example:
Entered Date range: 01.01.2019 - 16.10.2019
First/last date with a created notification: 03.01.2019 - 14.10.2019
Displayed date range: 03.01.2019 - 14.10.2019
This could cause confusion because it looks like we evaluated a shorter date period.
Is there a method to just show the entered parameters?
Thanks in advance!
Instead of placing the parameters in a formula and displaying them as this may be causing your issue. Do the following;
Get a textbox and place it in the report header. On the right in your field explorer, expand the Parameter Fields and drag the DateFrom and DateTo in the textbox. Something like this;
Doing so will display the entered range in the parameter and not the range values actually exist for.

SAP: DATE field on screen but no F4 button

I added a date and value field to a screen (ZFI_ERWEITERUNGEN_KREDITOR, 0100). Everything looks fine except the fact that no F4 button appears next to the date field. Checking other date fields the F4 button is available.
Does anyone have a clue where this behviour comes from and how can I avoid it?
Problem is solved!
Go to the field attributes in SE51 (Screen Painter):
- Program -> Possible Entries
Choose one value from the drop-down list.

How to dynamically create and destroy datepicker in materializecss

I want to initialize and destroy datepicker in materializecss. I know how to initialize but unable to find it how to destroy.
I have one textbox and one dropdown.based on dropdown, the textbox type is changed. so when user select dob, I initialized textbox with materializecss datepicker but after that I am not able to change textbox back to its normal mode, I mean where user can insert text or number.
I am using below code to initialize -
$('#txtDatePicker').pickadate({
selectMonths: true, // Creates a dropdown to control month
selectYears: 100 // Creates a dropdown of 15 years to control year
});
A datepicker usually has 3 buttons, however if these buttons are initialized without values ie. today: "" they will not be shown.
$('.datepicker').pickadate({
today: '',
clear: 'Clear selection',
close: 'Cancel'
});
For more information see: http://amsul.ca/pickadate.js/date/#buttons
From your comment
so lets say you have initialized date picker and now I want to destroy it, so that simple text can be written into it.
I think that if you only need a simple text can be written into it. Just add an option like this
$('.datepicker').pickadate({
editable: true
});