Af Query Is not refreshing after page Navigation - oracle-adf

My Jdev 11.1.7.1
I have three pages firstpage.jspx ->home.jspx->second.jspx .
I have a table related to employee history on home.jspx .I have created in appmodule a viewcriteria and dropped it as af query with table
My Navigation works as employee logs to firstpage and then navigates to home page where he clicks search predefined af query button and sees his information .
My problem is If he goes back again to the firstpage and then to home page he sees his information populated in table .I need to clear it .
First time onload it works fine by the way if i click search then only details are populated but by navigating back and coming to same page the table is showing the details
Need a way to stop it .
Any Help Appreciated
note: Already tried the below code
I tried the below but still table is populating while navigation
RichQuery queryComp = getQryId1();
QueryModel queryModel = queryComp.getModel();
QueryDescriptor queryDescriptor = queryComp.getValue();
queryModel.reset(queryDescriptor);
queryComp.refresh(FacesContext.getCurrentInstance());
String amDef = "model.AppModuleImpl";
String config = "AppModuleLocal";
ApplicationModule ami =
Configuration.createRootApplicationModule(amDef, config);
AppModuleImpl am = (AppModuleImpl)ami;
ViewObjectImpl demo = am.getAlmbCmbChildallowSearchView1();
demo.executeEmptyRowSet();
Thanks
Vikram

Your code creates a new instance of the AM instead of accessing the existing instance that is already there.
Also - try and just add an operation that clears the criteria in your page flow diagram before you navigate to the first page.

Related

Wrong 'View live' url in Wagtail admin message after page creation when using id as slug

I am using a page model 'EventPage', which shall have a slug based on the id of the page. To achieve this, I have modified the full_clean method like this (similar to this question):
class EventPage(Page):
...
def full_clean(self, *args, **kwargs):
super().full_clean(*args, **kwargs)
# set slug to id, if already existing
if self.id is not None:
self.slug = str(self.id)
This seems to work fine in principle. However, after the page is published,the Wagtail admin/pages view shows a message box at the top ('Page ... created and published') with a View live button that links to the wrong url (i.e. using the default slug created from the page title).
In the list of pages below that, the just created page's own View live and Add child page links show the correct page url using the page id. It is just the message box's View live url at the top that needs to be corrected. Here's a screenshot:
How can I get the correct link in the message box at the top as well?
In case it matters, I am currently using Wagtail 2.9, Django 2.2.9 and Python 3.6.
I guess my problem has something to do with the fact that the page id is not known until the page is saved for the first time, and the View live link in the message box somehow uses an initial page.url which is overridden later on.
Any ideas how to solve this?
You could probably achieve this by using Hooks in Wagtail. Hooks are typically used to customize the view-level behaviour of the Wagtail admin and front end. I would suggest overwriting the button functionality this way, or possibly removing the existing button and adding your own new one in. More info in the docs: https://docs.wagtail.io/en/latest/reference/hooks.html
For anyone ending up here, the solution was given in the accepted answer to a similar question here: Wagtail 'View live' button provides wrong url after page creation while using id as slug.
In short: use Django signals instead of hooks, i.e. here a the post_save signal for EventPage.
For documentation purposes, I'm repeating here the solution from the linked question, slightly adjusted. All credits and thanks go to gasman.
Create following signal in the calendar app, calendar/signals.py:
from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import EventPage
#receiver(post_save)
def set_number_and_slug_after_event_page_created(sender, instance, created, **kwargs):
if issubclass(sender, EventPage) and created:
page = instance
page.number = page.slug = str(page.id)
page.save()
new_revision = page.save_revision()
if page.live:
new_revision.publish()
And, if not yet done, register signals in the corresponding calendar/apps.py config:
from django.apps import AppConfig
class CalendarConfig(AppConfig):
name = 'calendar'
def ready(self):
from . import signals
This worked like a charm for me.

AngularJS - HTML binding not working properly

In my angular app, there are two pages (list & checkout). In the list page the user could search for an item and the searched item will be displayed and then the user can select the item and continue to checkout.
From the checkout page the user could return back to list page, and at that time all the items in the list page should be same as how it was left before.
For implementing this feature, my code is
on moving from list page to checkout page, all the scope data are stored in a service
returnsService.setScopeData($scope);
And on returning back from checkout page to list page, this saved data are retrieved from service and assigned to scope variables.
var restoreScopeData = returnsService.getScopeData();
if (restoreScopeData) {
for (var key in restoreScopeData) {
if (key.charAt(0) != '$') {
$scope[key] = restoreScopeData[key];
}
}
}
This works fine to an extend, and I can see the list page same as how I left it.
But the problem is, now I'm not able to search for new item in the list page.
When ever a search happens, the items are populated to $scope.listSearch and they are displayed in html {{listSearch}}.
In the error case also,
I can see the new search data getting assigned to the $scope.listSearch, but the HTML binding is not happening.
I tried calling $scope.$apply() after the search assigning, but still not working.
Storing complete scope isn't good idea. You can just store the vars you need. Also, you can use localStorage for this.
As I understood, making new call is not an option, so you can try use $timeout.
$timeout(function() {
$scope.listSearch = myValue;
});
Instead of doing this, you may for localStorage or sessionStorage as suggsted by John.
You may check below link for example
https://www.codeproject.com/Articles/1015515/Working-With-Client-Side-Local-Storage

reload the angularjs after update , date not updated

i am working in angularjs 1.i am trying to make CRUD in angularjs and laravel.i have successfully make the CRUD and CRUD is working fine , in my application their is child and parent routing present using ui router.At parents Route i have show the list of all the data and then by click on add new or edit button bootstrap modal appears , route change and after updating data , I change the route to parents route which works fine but the problems is with i update the data and try to reload the parent view , parents view does not update , remain same may be because of the angular store view in browser when every we call the view, then if you again call this view it will come from browser not from sever again.
How can i come back to the parent view with update data?
Thanks for Helping
this is my code i use to reload the the parents view , i parents do not update remain same although the route changes.
$location.path(ROUTE NAME);
$window.location.assign(ROUTE NAME);
$window.location.href = ROUTE NAME;
Don't be think this is a solution for your question. Just think it would be a key for you.
At first store the parent values in local storage before reload the parent view
$localStorage.set("parant", $form)
and after reload the page, check if local storage have data, then assign to your current form, like
if($localStorage.get("parant") != undefined)
{
$form = $localStorage.get("parant")
return false;
}

Concrete5: Take the central part of my single page and have it displayed on the homepage

Within my Concrete5 there's a package that contains many single pages, which actually make the core functionality (community connections).
There's one particular page that contains search functionality. Is there any way to take the central part of that page and somehow display it on the homepage, in a div element or similar?
You can do this with jquery .load()
On the single page, wrap the content you want to import in a div with a unique id.
On the home page, add a div to import the content into
// Get the URL of the page
var url = "relative/path/to/page;
// Load the new page into the temp container
// Replace #wrapper with the selector of the element you want to import
$("#import-content").load(url + " #wrapper");
You should be able to do this by creating a new public function in the single_page's controller that returns whatever you want it to (data that you can then render in HTML, or you could have the controller method itself render an "element" with some data, or just create an HTML string in the controller method itself if you want to totally violate the MVC pattern).
Then you should be able to retrieve that data or markup from your other page like so:
$myController = Loader::controller('/path/to/singlepage'); //<--NOTE this is a C5 URL path (e.g. "slug"), not a server file path!
$myMarkup = $myController->myCustomFunctionIWroteToReturnSomeStuff();
echo $myMarkup;

cakephp back button issue

i am working on social network website where user can navigate to the album view page in many ways.
for example.
myprofile>> Gallery index page >> Album view page.
myprofile>> Gallery details page >> Album view page.
In first case back button should go to gallery index page and In second case it should go to Gallery details page.
Is there any way to add link to back button path dynamically in cakephp?
You could try using a breadcrumb-like session array. With every view you can pop a path onto the stack, and access the stack in the view (via the Session Helper) and construct the back button that way.
The stack could be as simple as a single parameter, or an array of controller, action and parameter variables to construct the path, depending on how much detail you need.
Edit: You could also use Neil Crookes' History Component: https://github.com/neilcrookes/cakephp-bits/blob/master/history_component/controllers/components/history.php
Use the breadcrump methods in the Html helper.
In your layout:
echo $this->Html->getCrumbs(' > ','Home');
In your view:
$this->Html->addCrumb('Users', '/users');
$this->Html->addCrumb('Add User', '/users/add');
In each of your views, you can add in a new crumb, or the chain of crumbs to be able to see a history of your actions.
More here: http://book.cakephp.org/view/1653/Creating-breadcrumb-trails-with-HtmlHelper

Resources