remotecommand

Passing parameter from xhtml through p:remoteCommand to java bean not working

為{幸葍}努か 提交于 2021-01-29 06:45:59
问题 I'm using p:fileUpload component from which I need to pass to java bean class, number of files which will be uploaded. Count of files is available here PrimeFaces.widgets.<widget_name>.files.length . So I'm trying to pass this value to java bean through p:remoteCommand , but for some reason method defined in action parameter is called, but parameter is not passed. I'm using Primefaces 2.1 ... I know that is prehistorical version, but I need to fix one bug in application which is using this

p:remoteCommand inside iterating component like p:dataTable only works for last row

孤者浪人 提交于 2020-07-09 05:51:07
问题 i was trying to print the value entered in the inputText but it only shows 0 except for the last row it shows the right value! here's a minimal code (i didn't include all the fields and the getters/setters) @ManagedBean(name="medicament") @ViewScoped public class MedicamentBean { private List<Medicament> medicaments; private String libelle; private int qte_vente; public void test() { System.out.println(this.qte_vente); } } html: <h:form> <p:dataTable value ="#{medicament.medicaments}" var ="m

Invoking a p:remoteCommand via a JavaScript function passing a message local to that function to another function through the “oncomplete” handler

雨燕双飞 提交于 2019-12-30 12:23:41
问题 This question is purely based on this previously asked question (courtesy) but the question is messed up completely with the Java EE 7 WebSockets API attempting to show the actual practical approach/scenario which is now very unlikely to receive any answer based on <p:remoteCommand> . Given below a snippet of JavaScript (this is only a test scenario). <script type="text/javascript"> function test() { var message = "myMessage"; window["myFunction"](); // This is literally interpreted as a

Primefaces p:remoteCommand parameter always null [duplicate]

不羁的心 提交于 2019-12-24 17:56:00
问题 This question already has answers here : Pass parameter to p:remoteCommand from JavaScript (7 answers) Closed 3 years ago . I am trying to pass a parameters with p:remoteCommand Unfortunately when I retrieve the paramer in my bean method I always get null. Is there anything wrong with my code? Here is my page code: <a href="#" onclick="rc([{'d':'01'}])">01</a> <p:remoteCommand name="rc" update=":myform:messages" actionListener="#{mybean.changedaybar}" /> and this is the bean method: public

Supplying parameters through p:remoteCommand to a Spring bean

百般思念 提交于 2019-12-11 08:18:16
问题 The following XHTML sets a selected value in <p:selectOneMenu> to a request scoped bean through <p:remoteCommand> . <h:form id="languageForm" prependId="true"> <pe:blockUI target=":body" widgetVar="blockBodyUIWidget"> <h:panelGrid columns="2"> <h:graphicImage library="default" name="images/ajax-loader1.gif" class="block-ui-image"/> <h:outputText value="#{messages['blockui.panel.message']}" class="block-ui-text"/> </h:panelGrid> </pe:blockUI> <p:selectOneMenu id="languages" value="#{localeBean

Invoking a p:remoteCommand via a JavaScript function passing a message local to that function to another function through the “oncomplete” handler

不想你离开。 提交于 2019-12-01 12:55:59
This question is purely based on this previously asked question ( courtesy ) but the question is messed up completely with the Java EE 7 WebSockets API attempting to show the actual practical approach/scenario which is now very unlikely to receive any answer based on <p:remoteCommand> . Given below a snippet of JavaScript (this is only a test scenario). <script type="text/javascript"> function test() { var message = "myMessage"; window["myFunction"](); // This is literally interpreted as a JavaScript function "myFunction()". // "myFunction()" in turn is associated with a <p:remoteCommand>. } $

Using a p:remoteCommand to update a p:dataTable

徘徊边缘 提交于 2019-12-01 06:31:29
Given the following XHTML code that has one <p:inputText> and a <p:dataTable> having only two columns. <p:remoteCommand name="updateTable" update="dataTable"/> <p:panel id="panel"> <p:inputText id="txtValue" value="#{testManagedBean.txtValue}" required="true"/> <p:message for="txtValue" showSummary="false"/> <p:commandButton actionListener="#{testManagedBean.submitAction}" oncomplete="if(!args.validationFailed) {updateTable();}" update="panel" value="Submit"/> </p:panel> <p:panel id="dataTablePanel" header="Data"> <p:dataTable id="dataTable" var="row" value="#{testManagedBean}" lazy="true"

Using a p:remoteCommand to update a p:dataTable

人走茶凉 提交于 2019-12-01 05:32:24
问题 Given the following XHTML code that has one <p:inputText> and a <p:dataTable> having only two columns. <p:remoteCommand name="updateTable" update="dataTable"/> <p:panel id="panel"> <p:inputText id="txtValue" value="#{testManagedBean.txtValue}" required="true"/> <p:message for="txtValue" showSummary="false"/> <p:commandButton actionListener="#{testManagedBean.submitAction}" oncomplete="if(!args.validationFailed) {updateTable();}" update="panel" value="Submit"/> </p:panel> <p:panel id=

Pass parameter to p:remoteCommand from JavaScript

喜你入骨 提交于 2019-11-26 01:38:01
问题 I want to pass value to remoteCommand from javascript. If this is possible, how can I do that and how can I receive them in the backing bean? 回答1: remoteCommandFunctionName({name1:'value1', name2:'value2'}); 回答2: Yes, it is possible. How to do that depends on the PrimeFaces version. You can see it in PrimeFaces users guide. Before PrimeFaces version 3.3 the syntax is as follows (copypasted from 3.2 users guide): 3.80 RemoteCommand ... Passing Parameters Remote command can send dynamic