OBIEE prompt set: Disable user input in date field - oracle

I have a report which contains date prompts. For several reasons, we want to disable manual user input into these date prompts, and to require the use of the date picker instead (this requirement won't change).
How can one do this?
What I've tried:
adding a javascript snippet (embedded in an invisible text prompt) to disable the text field. This works, however when I click "Apply" in the promptset, the date field is re-enabled!
Any insight on how I can accomplish this?
Anybody know how to hack the behavior of the Apply button so I can call my js function again? OR where can I hack the raw html of the promptset/report so that can set the date fields to "disabled=true"?

I do not know of any hack for the "Apply" button, however if we change your process a bit, instead of locking the columns down (and possibly creating confusion for the end user "Why can't I click on this prompt!!"), what we could do is hide the prompts either by using a JQuery function, or other method. The link within this answer describes several options to hide prompts:
Hidden prompts (Oracle Method)
Hiding prompts using guided navigation
Hiding prompts in a section
Hiding certain UI controls inside a prompt
This link has many other links to resources, and should hopefully answer your question, albeit in a different way.
Links (several in case one gets broken):
http://intelligentinsight.wordpress.com/2012/10/20/obiee-11g-hidden-prompts-and-hiding-prompts/ (Main Link)
http://docs.oracle.com/cd/E21764_01/bi.1111/e10544/prompts.htm#CIHCDDEG (Oracle Link, should be stable)
http://intelligentinsight.wordpress.com/2012/09/23/obiee-11g-improve-dashboard-prompt-ui-selectively-hiding-and-displaying-prompts-using-jquery/ (Link with JQuery instruction)

Related

How to clear all selections in PowerBI?

In Qlikview we have clear all option to clear all the selections, what is the similar option in PowerBI?
Even Refreshing the report(using Refresh button in Home) doesn't work.
I read somewhere that refreshing the browser(in case of web) can clear all selections and restore the previous stage but it's not a feasible solution. Is there any alternate of it ?
This can be accomplished by doing the following:
Create a bookmark with your default slicer selections
Ensure that "Display" is unchecked on the bookmark options
Upload an image that will serve as your refresh/clear-all button
Link the image to the book mark
Voila! Clear-all achieved
There is no one-click button that will clear all slicer selections on an existing report.
As you've indicated in your question, you can do a browser refresh and the report will be reset back to its default state. You can also click away from the report and go back in, and the report will be reset back to its default state.
The "Refresh" button at the top of the report gets the latest data but does not reset the report back to its default state. Switching tabs within the report also does not reset the report back to its default state.
While this isn't the answer you want to hear, there are a couple of ideas I'd encourage you to comment & vote upon. I know Microsoft do pay close attention to submitted ideas:
Clear All Slicers
Add Clear All Filters button to Power View**
** While the idea specifically mentions Power View, it's clear from the comments that the same request applies to Power BI, the successor to Power View.

Composite Fields In MSCRM 2013

I have a question on the subject of composite attributes that I would be grateful if you could help me with.
I posted this before on other question blogs but got no response I am satisfied with.
I am writing JavaScript that will update the fields (i.e. address1_line1, address1_line2, address1_line3, address1_city, address1_stateorprovince, address1_postalcode, address1_country) in the composite (address1_composite). When the fields are updated the composite does not seem to update. I have to open the composite and close it again. Is there a way of doing this automatically in JavaScript?
I have tried the following ideas:
Idea 1:
Xrm.Page.data.entity.save();
This is recomended at http://community.dynamics.com/crm/b/magnetismsolutionscrmblog/archive/2013/10/22/working-with-dynamics-crm-2013-composite-fields-fly-out-menu.aspx
This is not any good as my customers want to view the composite before saving the page. Also I would not want to save the page for my customers as they do not want this. They would like to decide when to do this themselves.
Idea 2:
Xrm.Page.data.refresh();
This is not really what I wanted as I do not want to refresh the whole page. I just want to refresh the composite. Also it bring up a popup that warns you about not having saved the page which will be annoying for my customers.
Idea 3:
Writing the address from the address lines to the composite.
This feels like a nasty hack.
There is probably more than one way of doing this. I used the function
Xrm.Page.getAttribute("address1_composite")._attribute.setValueForCompositeField();
I do not like this for the following reasons:
This is a hack as it is not using the system functionality of the done button to write the data.
You do not get the system formatting you get with the done button although this will get done when the form is saved so it is not so bad.
In the future if customers are allowed to add their own composite fields it could cause problems as the field names could be different.
It requires me to write extra code for each form that has a composite which has fields with different schema names. E.g. I have to write different code for forms with ShipTo and BillTo addresses as the code for the account form will not work.
Another idea was to set the focus to the composite field after a change has been made to any of the fields inside the composite.
Xrm.Page.data.entity.attributes.get("address1_composite").controls.get(0).setFocus();
This is the best idea so for but it is far from perfect. This forces the user to press the done button and hence the fields will be written. I was hoping for something more automated.
My Question:
What would be great is if there was a way to click the composite done button in JavaScript. This would give me the formatting of the done button and the automation I need.
Update - 14/04/2014
Since posting this question I have been in contact with Microsoft and they say there is no supported way of clicking the done button via a program.
If the field is locked down CRM JavaScript does not send the data back to the server for updating. Another approach would be:
perform the update using JavaScript (so the user sees the change); and
use a server side plugin on the Update event so the value is persisted.

Get value from autocomplete text field in ApEx

I want to create a dynamic action, that will set a value to an item on the page, when the value of another item (autocomplete text field) is set.
So the proccess goes like this:
Click on the autocomplete field
type some letters
choose one of the suggested values
I cannot find an event that will be executed when the selection of one of the suggested values happens. This way, I cannot see how I can read the value of the autocomplete field, once a suggested value is selected.
The change event doesn't fit my needs, it doesn't execute when one suggested value is selected.
I had the same problem, found this link: https://community.oracle.com/thread/2130716?tstart=0 and modified my dynamic action as follows to get the desired behaviour:
Event = Custom
Custom Event = result
From the link:
the problem seems to be the default behavior of the browser. When you
enter some text into the autocomplete and the list is displayed, the
focus is still in the text field. Also if you use the keyboard cursors
to pick an entry the focus will still be in the textfield. That's why
the change event of the textfield doesn't fire. It only fires if you
leave the field.
On the other side if you pick an entry with the mouse, the browser
will remove the focus from the text field for a moment (before the
JavaScript code puts the focus back), because you clicked outside of
the field. But that's enough so that the browser fires the change
event.
I had a look into documentation of the underlaying jQuery Autocomplete
widget
(http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/) and
there is actually an event called "result" which can be captures if an
entry is selected from the drop down list.
Try "Lose Focus" as event. It will trigger your dynamic action when you leave the autocomplete field, i.e. your curosr is moved to another field.
This probably depends on the APEX version you are using.
In case of 18.2, because the underlying component is based on Oracle JET's "inputSearch" component, you need to use following configure to capture the select change event for text with autocomplete:
event: Custom
custom event: ojupdate
Reference:
https://docs.oracle.com/cd/E87657_01/jet/reference-jet/oj.ojInputSearch.html#event:optionChange
I turned on the browser console, then turned ApEx Developer toolbar debug, and found that, on the contrary, the "Change" event does fire upon user clicking with the mouse on one of the selections. However if the user uses keyboard (type a few letters to narrow the list down, then use down arrow key to arrive at desired value, then press enter) then the Change event does not fire, just as you say.
Moreover: even when you do get the value sent back via mouse-click initiated Change event, the value isn't the autocomplete's complete and valid value, but instead the possibly partial and wrong-case value just as typed by the user. I.e., the the change event's submission of the value precedes the autocomplete's substitution.
The answer that #VincentDeelen gave is the best alternative that I can see, although it doesn't quite give that "instantantenous synchronicity" feel. You could maybe use the "Key Down" event, but be careful with that. You could get a really excessive amount of web and db traffic as each and every keystroke (including corrections) results in another firing of the dynamic action.
Testing environment: ApEx 4.2.3 with Chrome 33 as well as IE 9.
p.s. This might be worth a mention to the ApEx development team as well.
It's not really ideal, but you could use onfocus(). I'm looking for the same thing you are, I think, a custom event that fires when the selection of a suggested value happens. I haven't found it yet though and that is my work-around for now. It will run whatever function you've created for this initially with no value, but once the selection is made it will return focus and run the function again with the right value. Like I said, not ideal but it works.
Jeffrey Kemp is right. You can set it up through a dynamic action using the custom event, result. You can also register it on page load using document.getElementById("{id}").addEventListener("result", {function}); or $("#{id}").result( function( event, data, formatted ) { //something here });.
Oracle apex 19 now added a "component event" when you create a dynamic action called "Update [Text Field with autocomplete]" - this action is fired when you select a value from the list, but not when you leave the field (similar to adding the custom event "ojupdate").

Joomla handling multiple ajax forms on the same page

I'm using Joomla to develop a user profile management component with AJAX.
The goal is to allow the user to edit his own user information. There is a lot of information so instead of having one massive form, I decided to make "subforms" or sections. And for the whole thing to be user-friendly I want to send the forms and refresh the user information with AJAX.
Here's an example :
There are two sections, "Basic user info" which displays the first name, the last name and the age of the person and "Extended user info" which displays the occupation, the company and the skills of the person. Each section has an "edit" link (or button) which turns the content into a form (AJAX) allowing the user to modify the presented information. You can only edit one section's information at a time. When the user has finished modifying the data, he sends the form with a "send" link (or button) and the section gets back to simply displaying the information of the section (with the updates that were just made).
So I need to know what is the most efficient way to develop such a component. I thought of two approaches :
1) In the "tmpl" directory of the main component view we the following files :
default_basic.php (displays the basic user information),
default_basic_edit.php (displays the form which allows the user to edit the basic information)
default_extended.php (displays the extended user information),
default_extended_edit.php (displays the form which allows the user to edit the extended info)
default.php (loads each of the display subtemplates with calls to JView::loadTemplate($subtemplate))
When the user clicks on an edit link, an AJAX call is made to the following URI index.php?option=com_userinfo&view=userinfo&subview=basic_edit&format=ajax, which causes the view class to call $this->loadTemplate('basic_edit') after assigning the user information to it.
If the user clicks cancel the same process is used to load the 'basic' template again. And if the user modifies the information and clicks the send link, the form is sent and then the 'basic' template is loaded too.
2) There is only a "default.php" file in the "tmpl" directory which holds the edit version and the display version of each section. But all the edit versions are hidden at first. And when the user clicks on the edit link the display version of the section becomes hidden and the edit version is displayed (using display:none and display:block). Then, if the user clicks the cancel button we do the opposite. And if the user clicks the send button we send an AJAX request to update the data in the database and return the updated user info which will be loaded into the display version of the section. And we finally replace the edit version of the section with its display version.
I know there's a lot of text but in the end it goes down to choosing between refreshing full HTML blocks with AJAX, or just sending the updated info and modifying the content of hidden blocks and then make them appear. So what do you think is the most logical approach, knowing that we are in a Joomla 1.5 environment ? How would you procede ? (maybe there are other ways to create such a component ?)
(I tried both ways and I couldn't entirely make it work so I decided to ask to see if it is a matter of conception...)
Thank you for taking the time to read all the text.
My answer is: why even refresh parts when it can be done without it?
For example when we are talking about basic form elements like text fields and check/radio buttons I would prefer the following: on a successful save/send simply display a nice message like "Profile saved" for some seconds and the user is sure that the changes are save and sound.
In case I msissed somthing let me know.
I have tried both solutions and #2 is the only one that worked for me.

Add ... to show users that a non modal dialog follows?

I have a simple question.
I have a lot of menuitems and buttons in my application. I try to remember to add ... in the caption to indicate that a modal dialog is followed.
But should I also add those dots for a non modal dialog. I try to search in Google but cannot find any clear answer. I use Win32 and Delphi.
Regards
The ... implies that some further input is required to complete the action of the menu item.
So, "Save" means that the menu item will cause the document to save, whereas "Save..." implies that the user will need to enter the name, or choose a file format or something before the file will be saved.
Typically the further input is entered in a popup modal dialog, but (a) not every modal dialog is a prompt for further information, and (b) hypothetically some other input mechanism could be used.
The '...' implies that the user will be given the opportunity to back-out of the operation.
This was in a user interface guideline book I read back in 1995, I can't seem to find a definitive confirmation online anymore.
I'd say that this depends strongly on your personal taste. I add ... whenever any new window is opened, be it modal or non-modal, to indicate to the user that he has to expect some other window to appear.
My guess is that there should be some Microsoft UI Guidelines document about that, but neither have I ever looked for something like that nor do I know of one.

Resources