Uncheck checkbox after alert message - oracle-apex

I created dynamic action in oracle apex i.e when selecting more than one check box it displays that "to select only one checkbox" if i click ok button of this message the checkboxes should be unchecked

After the confirm DA, add another DA with plsql code
:PXX_CHECKBOX_ITEM := null;
items to submit ->
:PXX_CHECKBOX_ITEM

What Valerio wrote would work, but I am guessing this is to do with the apex.item stuff you have been dealing with.
You will need to add another DA that is triggered by clicking the ok button. Then you need to have the DA run Javascript code. Since I saw you were asking about how to run javascript, in this case you need to go into the true actions of the dynamic action and set the Action to Execute Javascript code.(For other Javascript code you can click on Page XX: Name of page in the Rendering tab on the left, and if you scroll down on the right there should be a section for Javascript)
And the Javscript code you need to execute to uncheck should be $s or something similair. https://apex.oracle.com/pls/apex/germancommunities/apexcommunity/tipp/6341/index-en.html is a good starting point on just these basics.
I actually tend to avoid interactive reports, I prefer Interactive Grids. But you do you. If you do get into Interactive grids I recommend you go through this: https://github.com/mgoricki/orclapex-ig-cheat-sheet

Related

Allow to check only one checkbox in Oracle apex

I created classic report with check boxes using apex_item.checkbox .I want to know how to allow to check only checkbox.That is if i click more than checkbox alert message should display.Please help me out
Thanks in advance.
If you want to do this via dynamic actions then you will want do a dynamic action on event Change, Selection Type jQuery Selector and the jQuery Selector being input[name = "something"]
This something you can figure out by running the page as is, and if you click F12 on your keyboard, the console will open. Then select the element that is your checkbox and find its name and this should be your "something". Play around with this to make it work(set the DA to run an alert or something to see when its triggered).
Then perhaps have a page item that is filled when this DA runs, and then if the page item is already filled and the DA runs, throw up an error saying you cant do this.
Or if you want to clear the previously checked box, you could save the name of currently checked box in the page item. And have the DA do a javascript function that clears the value in the field in the page item.
Basically have the DA get the name of the checked box from the item where you store it, and do some dynamic javascript. When I needed to do something similair I created a var in javascript that was formed like $s(" + checked_box + ", ""); assembling this with concat. And then do an eval(this_concacted_instruction).
I hope my ramblings guide you to a solution. I remember the first time I was working with this stuff I took a week to get one page sorted(although it was a bit more difficult than your problem), but it felt sooo good when I got it done. So keep on trying.
GLHF

Selenium webdriver - Find coordinates of tab navigated video player element for interaction

I'd like to automate a video-player on a webpage using Selenium in Python.
I cannot locate the interactive parts of the player with driver.find_element_by_... I've decided to try and accomplish this by making browser specific logic that knows how to navigate the page and player via keyboard navigation (count tabs for Chrome, vs Safari, vs Firefox, etc.).
driver.find_element_by_tag_name('body').send_keys(Keys.TAB))
I am able to select each of the controls of the player with tab (play/pause, current position, mute-volume control, full-screen, and additional options) and have had moderate success manipulating the player's controls with ActionChains once selected with TAB navigation
actions = ActionChains(driver)
actions.send_keys(Keys.DOWN) # to reduce volume or
actions.send_keys(Keys.LEFT) # to rewind playback
An example of something that doesn't work as expected with this method is sending a Key.SPACE to the MUTE button when selected. Instead the space is applied as a page navigation action and scrolls down the page like pressing page down. I'm looking for a method that either makes the controls work as expected when manually navigating the page with a keyboard, ex. space on highlighted object interacts and would normally mute the video in this context, or a workaround that lets me accomplish the same thing. To that end I was thinking if I could get the windows coordinates of the TAB selected object within the video-player and simply perform a click that would at least let me interact with the control.
Also if I'm going about this all the wrong way let me know. Thanks!
What you're really looking for is how to navigate the Shadow DOM. Those are the web elements inside the video player.
I answered how to reach inside the Shadow DOM in an other question, albeit for Java. However the principle is the same.
You can read the whole thing at the link, but the basics are you create a "starting point" WebElement at the Shadow DOM via JavaScript, then all future look-ups reference it:
WebElement button = startingPoint.findElement(By.cssSelector("..."));

Set active tab when navigating from one tab to another by button click

I have been struggling with this for a while now. I'm trying to navigate to one tab (let's say Home) to another (let's say About). I'm able to navigate that either the page get's added to nav stack, but then it's not changing active tab. That, or then we use select to set the active tab, which means that I lose the navigation stack. Here's the latter option code:
export class HomePage implements OnInit {
tab: Tabs;
constructor(public navCtrl: NavController) {
this.tab = this.navCtrl.parent;
}
navigate() {
this.tab.select(1);
}
But this means that as mentioned, I lose the nav stack and can't use the back button that would show if I use push. That brings us to the other option, when I use .push():
this.navCtrl.push(About)
The active tab won't change, but still shows Home as the active tab, even though we are successfully navigated to About tab.
So what I wish for, is to have both the 'Back' button and the active tab (About) selected when I'm clicking the button to go to About from Home. Here's a demo with the push option, as you can see the active tab does not change: https://plnkr.co/edit/6KIL8mxfTMCsvACpiD1K?p=preview
PS. I looked at this question, but it wasn't useful to me: Changing tabs dynamically in Ionic 2
I'm using Ionic 3
I don't think this is how the tabs component is intended to work. With tabbed navigation you kind of have n navigation stacks (where n is the number of different tabs you have) which means if you .push() a new page on the nav-stack you push it on the stack of the currently selected tab.
Switching to another tab kind of is the same as starting with a new root, you start with the initial page ([root]="yourFirstPage") and can then add new pages to this particular nav-stack (and you can pop them off the nav-stack with a back button).
In you particular example you are trying to .push() the About page on the stack of the Home page and expect the NavController to know that you intended to switch to another stack and to push a new page to the new stack.
One solution to your problem could be to always remember the previous tab when you use .select() and display back button manually in the navbar which uses .select(previousTab) on click.
I hope that makes things clearer for you.
It's the default behaviour to act like this. When you select a tab it clears the nav stack and set the root to another page. When you push your about page when in home page you're pushing a new page in your home nav stack, this is why it doesn't change and shoudn't change.
The reason to use tabs is that you can segment and divide stuff in they correct categories. When updating a product you don't whant the user the see, for example, billing information in the same stack of products since it doesn't belongs to that category.
The .select() method (whose you've implemented in your home.page.ts) is the closest you can have from beeing able to select a tab without clicking in a specific tab.
What you can do is simply remove about from beeing a tab and push it in home OR remove the button to go from the home to about page, since there's already a tab for this.
In any case what you want to do is an error that Ionic team removed the possibilities from people doing.
Hope this helps you.

Display template for content search webpart issue for datatable and Tabs

I have developed display template and using it in Content search web part.
For displaying result on page i am using JQuery datatable/JQuery Tabs in display template.
Everything works fine, but sometime while loading page i am getting error like ("Object doesn't support property or method 'dataTable' (OnPostRender: )" and for tabs error is "Object doesn't support property or method 'tabs' (OnPostRender: )").
And if i refresh page many times then error will go and result is display as code.
I have register JQuery, JS and CSS using $includeScript.
I have also tried with RegisterSod for JQuery and JS file but still issue is same.
Thanks in Advance.
Can be:
This error usually occurs when an html element id has the same id as some variable in the javascript function, try change the name.
If you put the code I'll be able to help you better.
test = button.attr('test'); // Object doesnt support this method
$test= button.attr('test'); // works fine
Or debbug your code with and discover your problem. Enable script debugging IE:
In Internet Explorer, choose Internet Options from the Tools menu.
In the Internet Options dialog box, click the Advanced tab.
On the Advanced tab, under Browsing, clear Disable Script Debugging.
Click OK.
If you have IE 8+ click here
Tutorial Using jQuery dataTables: link here

django form add new rows upon changing to edit

Here's my use case:
I'd like to display the information about something first using django_tables2, with a button on the top right corner called "Edit", once a user hits "Edit", at the bottom of the table, display a button called "Add New Record", and once the user clicks that button, a bunch of input fields pop up to let users enter values for each field, also the user could continue to click "Add new Record" to keep adding new.
How can I achieve this in Django?
I've read a lot of examples on stackoverflow but didn't find anything tailored to this particular case.
Thanks a lot.
Let's dive right into listing out what you want to do and the requirements you'll need to do so.
You basically want to toggle hiding and showing some functionality for this web page. This is easily accomplished by including the "Edit" button, "Add New Record" button, and popup (most likely in its own <div> somewhere in the page). So the "Edit" button will have the display set to something, be it inline, block, etc., while the "Add New Record" and popup would have a display of "none" or however it is you wish to hide it.
You've got the stuff set up and ready to go but now you need to show it when you click the "Edit" button. This is generally accomplished through Javascript. Just find the "Add New Record" button and switch the visibility.
When you click on the "Add" button you want to display a popup. This can be done in a variety of ways with different libraries. One of my personal favorites is using jquery's blockUI. Why? It doesn't allow the user to click anywhere except in the popup so it's a quick way to handle users trying to reach outside the scope of the popup.
So you've got all the new rows added and you are done editing. Maybe you have a "Save" button or something like that where you can click. When you do, you'll want to push all those new rows you just added to the database. Django handles this well and you could do something like include the new rows in part of the POST request or however you care to implement this solution.
So there's a bit of work ahead of you to get this page up and running with the exact functionality you need but hopefully this starts steering you in the right direction of where you need to go.