Checkbox ajax event not triggerd - checkbox

I have the following code that is not working.
<p:selectManyCheckbox id="make" value="#{priceList.searchMakeId}" >
<p:ajax event="click" process="#form" update="recordCountPanel" immediate="true" listener="#{priceList.reCountRecords}" />
<f:selectItems value="#{priceList.vehicleMakeItems}" />
</p:selectManyCheckbox>
Bean method
public void reCountRecords() throws MWSException {
The method is never called. When I replace the p:selectManyCheckbox with h:electManyCheckbox or with p:selectManyMenu Then when clicking/changing these components, the bean method is called.
I can't find in the generated shtml source any onlclick or onchange event on the primefaces checkbox.
So I'm guessing something is not rendered correctly when I use p:selectManyCheckbox
But since I don't have any errors on my server or in browsr javascript I'm clueless of what is causing the problem.
I tried with primefaces 6.0 6.1.6 and 6.1.8 . All the same result.
Any ideas?

I found out one of my collegues wrote a custom rendere for the selectManyCheckbox. But did it for PF 3 (some issues with responsive designs) And it was never updated and since I updated to PF6 it caused problems. Removing the custom rendere fixed the issue I had and also fixed the problem with the responsive design.

Related

SelectOneChoice not populating selectItems value

I'm using JDeveloper 11.1.2.4 with JSF 1.2 and having issues with the selectOneChoice components that are being populated by JSF selectItems. Initially the problem was dealing with the selectOneChoice components in popups where if you clicked on the dropdown itself, it would recieve focus but the list would not populate unless you clicked anywhere on the page, outside of the component. I remedied that by changing from an ADF selectOneChoice to a JSF selectOneMenu and that fixed it.
This issue here, I have a selectOneChoice that's not in a popup but rather on a JSPX page that has a valueChangeListener on it. All it did initially was set a Long variable to the newValue (which is being casted to a Long) and then call the method that fills the list.
I added an if statement with a null check then a nested if-else that checks values to disable/enable buttons. So what happens now is I'll click the dropdown, select a value and everything is populated/triggered correctly. If I go and try to click the dropdown to select something else, nothing happens. It just highlights and I see the same value, until I click away and then try again and it works.
What am I missing? Why do I have to click outside of the component for it to fire?
public void templateValueChangeListener(ValueChangeEvent valueChangeEvent) {
myTemplateId = (Long)valueChangeEvent.getNewValue();
if(myTemplateId != null){
if (myTemplateId == 7){
adminButton.setDisabled(true);
notAdminButton.setDisabled(false);
setIsAdminRole(true);
} else if (myTemplateId != 7){
adminButton.setDisabled(false);
notAdminButton.setDisabled(true);
setIsAdminRole(false);
}
}
fillTemplates();
fillAvailablePositions();
}
protected void fillTemplates()
{
List<ContainerTO> list = bigSession.getTheTemplates();
templateList = new ArrayList<SelectItem>();
for(ContainerTO tem : list)
templateList.add(new SelectItem(tem.getId(), tem.getValue()));
}
and here is the JSPX code
<af:selectOneChoice label="Templates:" value="#{AdminBean.myTemplateId}"
valueChangeListener="#{AdminBean.templateValueChangeListener}"
id="soc1"
autoSubmit="true" binding="#{AdminBean.roleTemplateDropDown}"
partialTriggers="cb11 cb10"
immediate="true">
<f:selectItems value="#{AdminBean.templateList}" id="si1"/>
</af:selectOneChoice>
Thanks
So, I've found my answer. Had nothing to do with the code at all but the IDE and browser. Here, we use JDeveloper 11.1.2.4, JSF 1.2 ( -_- ) with an understood requirement to support IE. Long story short, I have to make sure the app works with IE8 because of the components used are broken in anything other than an IE 8 compatible browser. After researching everything, I had the fantastic idea to try it out in Chrome...and it worked. So thus, I re-routed my investigation.
I forced the meta to recognize the IE browser as IE7 then I suppressed the Compatibility warning in web.xml to get the annoyance away. So far so good. THIS IS JUST A WORKAROUND FOR NOW. We will be moving to JDeveloper 12c and JSF 2 as soon as possible.
To force the IE7 mode:
<context-param>
<param-name>User-Agent</param-name>
<param-value>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1;</param-value>
</context-param>
To suppress the Browser Compatibility Alerts:
<context-param>
<param-name>oracle.adf.view.rich.HIDE_UNSUPPORTED_BROWSER_ALERTS</param-name>
<param-value>IECompatibilityModes</param-value>
</context-param>
Can you try the same code from fillTemplates() to getTemplateList().
Try to fill the select items inside the getter method of f:selectItems.
Thanks.

angular ui bootstrap uib-tooltip show on custom trigger

I have this tooltip on a input field:
<input id="chatMsg" uib-tooltip="something" tooltip-trigger="openTrigger" ng-model="chatMsg" />
and i want to show it on a custum trigger like this:
angular.element('#chatMsg').trigger('openTrigger');
but i can't get it to work, on my previus versions of ui-bootstrap-tpls it was working (0.12.1) now i've upgraded to 0.14.3
i've also configured the provider like this:
app.config(['$uibTooltipProvider', function ($uibTooltipProvider) {
$uibTooltipProvider.setTriggers({
'openTrigger': 'closeTrigger'
});
}]);
Thanks.
From version 0.12.0 onwards, tooltip-trigger is no longer observable (so you are not able to change it programatically).
You can use tooltip-enable to get the same behavior. See more details here: https://github.com/angular-ui/bootstrap/issues/3372

Odd issue with ng-show always evaluating to true

I had a bit of code in my view that would only show up when a particular value was true. Lt looked like this:
button type="button" ng-click="attachBarCode('enter')" ng-show="barcodeAllowed.status">Foo</button>
This was working until recently. My controller had some logic where, based on Ajax data, it would set $scope.barcodeAllowed.status to true. All of a sudden though, the button was always showing up. To help debug the issue, I added some additional tests to my view:
first test, <span ng-show="!barcodeAllowed.status">DONT SHOW</span><br/>
second test, <span ng-show="barcodeAllowed.status">DONT SHOW</span><br/>
test -{{barcodeAllowed.status}}-end -{{!barcodeAllowed.status}}- -{{barcodeAllowed | json}}-<br/>
test if <span ng-if="barcodeAllowed.status"> if was true</span><p>
Here is where things got crazy. Both "DONT SHOWS" rendered in my view, even though it seems as if that would be impossible. When I output the values in the third line, I saw false and true, as I expected.
Finally - the ng-if? It worked perfectly! The value did not show up.
I've heard folks mention that ngShow can have scope issues inside a ngif, but my code isn't inside an ngif.
So, you won't believe what it was. I was using a Content Security policy in my app and on a whim, I disabled it. As soon as I did, it began working. I played around a bit and discovered that I needed to add 'unsafe-eval' to the to the script-src area of my CSP in order for Angular to be able to apply the styles.
The Ng-show/Ng-hide directives needs a css-class to show/hide, since it just adds a class to your element when the scope-variable is truthy/falsy.
Ref: https://docs.angularjs.org/api/ng/directive/ngShow

angucomplete-alt unable to type in textbox

Simple problem here - but cant seem to find answer. I have added the angucomplete-alt to my project - I believe that I have added it all correctly - meaning, registering it and having the js file available when the page loads. But for some reason when I click on the input and start to type - nothing happens. I am unable to type in the textbox/input. below is my code for the control. - im double checking how things are wired up on the back end. - thanks in advance.
and this exact code works in another project - configured differently - but the markup for the control is the same
<angucomplete-alt id="searchGroupsAutoComplete"
placeholder="{{searchPlaceholder}}"
pause="400"
text-searching="{{searchingText}}"
selected-object="selectedAnObjectFn"
remote-url="/api/search/SearchByQueryStrings"
remote-url-request-formatter="formatSearchDataFn"
remote-url-response-formatter="formatReturnDataFn"
remote-url-data-field="Content"
title-field="Name"
description-field="EntityType"
image-field="ThumbnailUrl"
minlength="1" />
Remove maxlength="{{maxlength}}" of INPUT tag in $templateCache.put(TEMPLATE_URL,..... (angucomplete-alt.js)
so it worked, but I don't known why.

Oracle ADF: java.lang.IllegalArgumentException when pressing Printable page behaviour 12c

Hello am developing a web application using Oracle ADF and jdev12c. I have a page like below.
The above page is created using a template. That contains three parts. First part is image, second part is deck with more than one panel group layout (Here deck child value is decided using a value from managed bean of scope session.)and third part is actual content facet in this I have dropped a task-flow(bouded) as a region contain .jsff pages.
My problem is every thing is working fine. af:showPrintableBehavior is not working. When I click on the Printable view button am getting the following exception. After the following exception nothing is working in my application. (If I click on any commndLink it is opening in another tab and repeatedly trying to generate the page content for example the table but not displaying the content)
exception
java.lang.IllegalArgumentException
org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.setCollectionModel(RowKeySetTreeImpl.java:315)
org.apache.myfaces.trinidad.component.UIXListView$RowKeyFacesBeanWrapper.getProperty(UIXListView.java:300)
org.apache.myfaces.trinidad.component.FacesBeanWrapper.getProperty(FacesBeanWrapper.java:61)
oracle.adf.view.rich.component.rich.data.RichListView$ListViewBeanWrapper.getProperty(RichListView.java:178)
org.apache.myfaces.trinidad.component.UIXComponentBase.getProperty(UIXComponentBase.java:1912)
org.apache.myfaces.trinidad.component.UIXListView.getSelectedRowKeys(UIXListView.java:451)
org.apache.myfaces.trinidad.component.UIXListView.postCreateCollectionModel(UIXListView.java:157)
org.apache.myfaces.trinidad.component.UIXCollection.getCollectionModel(UIXCollection.java:1671)
org.apache.myfaces.trinidad.component.UIXCollection.getCollectionModel(UIXCollection.java:1255)
org.apache.myfaces.trinidad.component.UIXCollection.getRowKey(UIXCollection.java:493)
oracle.adf.view.rich.component.rich.data.RichListView.visitChildren(RichListView.java:103)
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
This is not working in only this page. I have tested this in one empty page that is created without using this template. In that empty page I have created this table and tried with af:showPrintableBehavior and here this behaviour is working fine.
Please help me. How to remove the above exception. Export to excel is working fine.
Thanks in advance.
Try using a clientListener inside the button that prints the page, then stop the event from propagating further:
<af:resource type="javascript">
/**
* Shows a popup from an "action" type event.
* #param {AdfActionEvent} actionEvent the event being handled
*/
function stopEventFromPropagating(actionEvent)
{
actionEvent.cancel();
}
</af:resource>
<af:commandButton text="Click Me">
<af:clientListener type="action" method="stopEventFromPropagating"/>
</af:commandButton>

Resources