Search Results

Search found 71 results on 3 pages for 'rerender'.

Page 1/3 | 1 2 3  | Next Page >

  • Absolute reRendering using RichFaces

    - by wheelie
    Hey there, I am implementing copy/paste functionality for a complex object tree, this means you can copy an object and paste it where the object type is the same. Therefore I need to reRender the <a4j:commandLink>-s which are performing the paste action (so it will show on the GUI or not). Simplified example: Problem is that copy links are deep in the tree. How is it possible to reRender on a higher level in the component tree? (very)Simplified example: ... <h:form id="form1"> ... <a4j:commandLink value="Copy" reRender=":paste1, :paste2, :paste3" /> <a4j:commandLink id="paste1" value="Paste" rendered="#{myBean.myHashMap.key}" /> <a4j:outputPanel> <a4j:region renderRegionOnly="true"> <a4j:commandLink value="Copy" reRender=":paste1, :paste2, :paste3" /> <a4j:commandLink id="paste2" value="Paste" rendered="#{myBean.myHashMap.key}" /> </a4j:region> <a4j:outputPanel> <a4j:region renderRegionOnly="true"> <a4j:commandLink value="Copy" reRender=":paste1, :paste2, :paste3" /> <a4j:commandLink id="paste3" value="Paste" rendered="#{myBean.myHashMap.key}" /> </a4j:region> </a4j:outputPanel> </a4j:outputPanel> ... </h:form> Something like that. In practise this differs in that a rich:tree is displayed. Also, there can be multiple instances of the same paste link: object:0::paste3, object:1::paste3. private final String pasteIDs = ":xxPaste, ... , :xyPaste"; According to the RichFaces reference, putting the separator to the beginning of the ID means it is an "absolute" search expression, however this way i get the same result: only the 'local' paste link gets rerendered, the others not. Every copy-paste link pair is encapsulated in <a4j:region renderRegionOnly="true">, because it is necessary for other components to restrict the reRender to that region. Could this be blocking the reRender I want to make? Also I want to rerender exactly those paste links, so no other rerender action is triggered. Hope it is clear what i want to achieve. Any help would be appreciated! Daniel

    Read the article

  • Seam reRender component in partial

    - by meed2000
    Hello, I'm using seam to develop a simple web app. Using a4j commandButton in many places, with the property reRender="componentName" componentName is in most places a a4j outputPanel Which always worked, until I used a template. with include of two different views. reRender applied to the whole view does work, but reRender applied to an inner component does not. Same issue with page rules, all action I had defined are not functioning any more. Is this a problem with Seam, did someone experience this? <a4j:outputPanel id="panel1"> <h:form> <div class="section"> // whatever code </div> <a4j:commandButton id="button1" value="Add" action="#{bean1.action()}" reRender="panel1"/> <h:commandButton id="reset" value="Reset" action="#{bean1.reset}"/> </h:form> </a4j:outputPanel>

    Read the article

  • Seam reRender component in partial; reRender across naming containers

    - by meed2000
    Hello, I'm using seam to develop a simple web app. Using a4j commandButton in many places, with the property reRender="componentName" componentName is in most places a a4j outputPanel Which always worked, until I used a template. with include of two different views. reRender applied to the whole view does work, but reRender applied to an inner component does not. Same issue with page rules, all action I had defined are not functioning any more. Is this a problem with Seam, did someone experience this? <a4j:outputPanel id="panel1"> <h:form> <div class="section"> // whatever code </div> <a4j:commandButton id="button1" value="Add" action="#{bean1.action()}" reRender="panel1"/> <h:commandButton id="reset" value="Reset" action="#{bean1.reset}"/> </h:form> </a4j:outputPanel>

    Read the article

  • Does subTable support reRender?

    - by Tom
    Here is a minimal rich:dataTable with an a4j:commandLink inside. When clicked it sends an AJAX request to my bean and reRenders the dataTable. <rich:dataTable id="dataTable" value="#{carManager.all}" var="item"> <rich:column> <f:facet name="header">name</f:facet> <h:outputText value="#{item.name}" /> </rich:column> <rich:column> <f:facet name="header">action</f:facet> <a4j:commandLink reRender="dataTable" value="Delete" action="#{carForm.delete}"> <f:setPropertyActionListener value="#{item.id}" target="#{carForm.id}" /> <f:param name="from" value="list" /> </a4j:commandLink> </rich:column> </rich:dataTable> The exmaple obove works fine so far. But when I add a rich:subTable to the table, reRendering fails... <rich:dataTable id="dataTable" value="#{garageManager.all}" var="garage"> <f:facet name="header"> <rich:columnGroup> <rich:column>name</rich:column> <rich:column>action</rich:column> </rich:columnGroup> </f:facet> <rich:column colspan="2"> <h:outputText value="#{garage.name}" /> </rich:column> <rich:subTable value="#{garage.cars}" var="car"> <rich:column><h:ouputText value="#{car.name}" /></rich:column> <rich:column> <a4j:commandLink reRender="dataTable" value="Delete" action="#{carForm.delete}"> <f:setPropertyActionListener value="#{item.id}" target="#{carForm.id}" /> <f:param name="from" value="list" /> </a4j:commandLink> </rich:column> </rich:column> </rich:dataTable> Now the rich:dataTable is not rerendered but the item gets deleted since the item does not show up after a complete page refresh. Does subTable support reRender the way i'd like to use it here? Tanks Tom

    Read the article

  • Does a nested subTable break reRender?

    - by Tom
    Here is a minimal rich:dataTable with an a4j:commandLink inside. When clicked it sends an AJAX request to my bean and reRenders the dataTable. <rich:dataTable id="dataTable" value="#{carManager.all}" var="item"> <rich:column> <f:facet name="header">name</f:facet> <h:outputText value="#{item.name}" /> </rich:column> <rich:column> <f:facet name="header">action</f:facet> <a4j:commandLink reRender="dataTable" value="Delete" action="#{carForm.delete}"> <f:setPropertyActionListener value="#{item.id}" target="#{carForm.id}" /> <f:param name="from" value="list" /> </a4j:commandLink> </rich:column> </rich:dataTable> The exmaple obove works fine so far. But when I add a rich:subTable to the table, reRendering fails... <rich:dataTable id="dataTable" value="#{garageManager.all}" var="garage"> <f:facet name="header"> <rich:columnGroup> <rich:column>name</rich:column> <rich:column>action</rich:column> </rich:columnGroup> </f:facet> <rich:column colspan="2"> <h:outputText value="#{garage.name}" /> </rich:column> <rich:subTable value="#{garage.cars}" var="car"> <rich:column><h:ouputText value="#{car.name}" /></rich:column> <rich:column> <a4j:commandLink reRender="dataTable" value="Delete" action="#{carForm.delete}"> <f:setPropertyActionListener value="#{item.id}" target="#{carForm.id}" /> <f:param name="from" value="list" /> </a4j:commandLink> </rich:column> </rich:column> </rich:dataTable> Now the rich:dataTable is not rerendered but the item gets deleted since the item does not show up after a complete page refresh. Why does subTable break support for reRender-ing the way i'd like to use it here? Tanks Tom

    Read the article

  • Why does a subTable break a4j:commandLink's reRender?

    - by Tom
    Here is a minimal rich:dataTable example with an a4j:commandLink inside. When clicked, it sends an AJAX request to my bean and reRenders the dataTable. <rich:dataTable id="dataTable" value="#{carManager.all}" var="item"> <rich:column> <f:facet name="header">name</f:facet> <h:outputText value="#{item.name}" /> </rich:column> <rich:column> <f:facet name="header">action</f:facet> <a4j:commandLink reRender="dataTable" value="Delete" action="#{carForm.delete}"> <f:setPropertyActionListener value="#{item.id}" target="#{carForm.id}" /> <f:param name="from" value="list" /> </a4j:commandLink> </rich:column> </rich:dataTable> The exmaple obove works fine so far. But when I add a rich:subTable (grouping the cars by garage for example) to the table, reRendering fails... <rich:dataTable id="dataTable" value="#{garageManager.all}" var="garage"> <f:facet name="header"> <rich:columnGroup> <rich:column>name</rich:column> <rich:column>action</rich:column> </rich:columnGroup> </f:facet> <rich:column colspan="2"> <h:outputText value="#{garage.name}" /> </rich:column> <rich:subTable value="#{garage.cars}" var="car"> <rich:column><h:ouputText value="#{car.name}" /></rich:column> <rich:column> <a4j:commandLink reRender="dataTable" value="Delete" action="#{carForm.delete}"> <f:setPropertyActionListener value="#{item.id}" target="#{carForm.id}" /> <f:param name="from" value="list" /> </a4j:commandLink> </rich:column> </rich:column> </rich:dataTable> Now the rich:dataTable is not rerendered but the item gets deleted since the item does not show up after a manual page refresh. Why does subTable break support for reRender-ing here? Tanks Tom

    Read the article

  • Selenium fails to find component after dom update (reRender)

    - by Bozho
    I'm testing a richfaces application with selenium. It works fine, unless I use reRender. (for those unfamiliar with richfaces - whenever an ajax request finished, parts of the DOM are updated/chagned/removed). So, after a reRender selenium (the IDE at least) fails to locate the elements which were within the reRendered area. Both FireBug and WebDeveloper locate the elements, and on "view source" the elements are there. So, is there a way to tell selenium to update its DOM "knowledge" with the latest changes? Firefox 3.5.6, latest version of Selenium IDE.

    Read the article

  • JSF invoke backing bean method and reRender components on ENTER key

    - by Markos Fragkakis
    Hi, I have a datatable with as search fields. I want a method on the backing bean to be invoked when ENTER key is pressed, as well as the DataTable to be re-rendered. My approach so far only works in IE 6, and 7, not in FF. This is the inputText: <h:inputText value="#{applicantProductListBean.applicantNameFilterValue}" id="applicantNameFilterValue" onkeypress="submitByEnter(event)"> </h:inputText> and this is the Javascript method I am invoking: function submitByEnter(e){ if(e.keyCode==13){ // alert("Enter was pressed"); e.returnValue=false; e.cancel=true; document.getElementById("applicantProductListForm:refreshButton").click(); } } As you can see, the Javascript method clicks on the button refresh, which exists on the page: <a4j:commandButton value="Refresh" id="refreshButton" action="#{applicantProductListBean.refreshData}" image="/images/icons/refresh48x48.gif" reRender="table, scroller"> </a4j:commandButton> The refreshData method does not return anything. As said before, this only works in IE 6 and IE 7. Does anyone know why it does not work in FF? An alternative I was considering was HotKey, which can indeed catch the event of ENTER, but it can only invoke Javascript, so it isn't appropriate. Is the proper way to do this via RichFaces or plain JSF? Cheers! UPDATE: Slightly modified the answer by BalusC, the script that works is: if (event.preventDefault) { // Firefox event.preventDefault(); } else { // IE event.returnValue = false; }

    Read the article

  • Form value not passed to Seam bean after a4j reRender

    - by Casper
    I'm making a webapp in Seam but ran into a problem I can't seem to fix. I have a JSF form where the customer can select a reservation type through a combobox. Based on the selected value, other form components gets rendered. For example: the customer selects Hours as reservation type, a panelGroup gets rendered where the customer can select a start- and an end hour. But if the customer would select 'part of the day' as reservation type, a selectOneMenu gets rendered where the customer can select a part of the day (morning, afternoon, evening) The rerendering well but the values of the components with a rendered conditional won't get passed to the bean. They stay null values. This is the code i'm talking about: <h:panelGrid columns="2"> <h:outputText value="Reservation Type" /> <h:selectOneMenu value="#{selectedPeriodPart}"> <s:selectItems value="#{productManager.getAvailableDayPartsSpot()}" var="daypart" label="#{daypart.label}"></s:selectItems> <s:convertEnum /> <a4j:support ajaxSingle="true" event="onchange" action="#" reRender="spot"></a4j:support> </h:selectOneMenu> <h:outputText id="date_spot" value="Date" /> <a4j:outputPanel id="calendar_spot" layout="block"> <rich:calendar value="#{reservation.reservationPeriod.startDate}" locale="en" cellWidth="24px" cellHeight="22px" style="width:200px" /> </a4j:outputPanel> <h:outputText rendered="#{selectedPeriodPart eq 'DAY_PART'}" value="Daypart" /> <h:selectOneMenu value="#{selectedDaypart}" rendered="#{selectedPeriodPart eq 'DAY_PART'}"> <f:selectItem id="si_morning" itemLabel="Morning (6:00 - 12:00)" itemValue="morning" /> <f:selectItem id="si_afternoon" itemLabel="Afternoon (12:00 - 18:00)" itemValue="afternoon" /> <f:selectItem id="si_evening" itemLabel="Evening (18:00 - 00:00)" itemValue="evening" /> </h:selectOneMenu> <h:outputText rendered="#{selectedPeriodPart eq 'HOURS'}" value="Hours" /> <h:panelGroup id="hours_spot" rendered="#{selectedPeriodPart eq 'HOURS'}"> <ui:include src="/includes/reservation/select_hours.xhtml" /> </h:panelGroup> </h:panelGrid> </s:div></code> Note: The calendar value do get passed back to the bean but the value of this piece of code doesn't (it does if you remove the rendered conditional):

    Read the article

  • Can I ReRender the entire tree of a component?

    - by Ben
    Hi, I have a JSF application with several major components and a component tree under each. On a certain event (Value change) I would like to reRender the entire component tree for one of those components. For example: can I rerender components 1,2 and 3 in one shot here: <h:panelgroup id="1"> <h:panelgroup id="2"> <h:panelgroup id="3"> <h:panelgroup/> <h:panelgroup/> <h:panelgroup/> <h:commandButton rerender="1*"> <--- Made up code. Is that possible? Another Idea - Can I reRender with wildcards? (I.E - ReRender all components who's ID's begin or contain: "UpdateMe") Thanks!

    Read the article

  • JSF 2.0 AJAX: jsf.ajax.request to call method not only rerender an area of page

    - by gerry
    Hi, I'm looking for a soultion of the following problem: _The is a list of links with different types of cars. _The user can click on each car in the list and a ajax request should be sent. _The response of the ajax request should be dependent on the id (of each car) and displayed in an panelGroup. So what I need is a possibility to call a method on the backing-bean. Additionally, this method should be called with a car id as its parameter. My code so far looks like: ... <ul> <ui:repeat value="#{carTree.getCars)}" var="car"> <h:outputScript name="jsf.js" library="javax.faces" target="head" /> <li onclick="showDetails(#{car.id});">#{car.name}</li> </ui:repeat> </ul> ... <h:panelGroup id="carDetails" layout="block" style="float:left;"> // need the details of each 'selected /clicked' car here </h:panelGroup> ... And the method in the backing bean should look like: public class CarTree { ... public String getCarDetails(int carid){ return "The car details for the car id "+carid+" are......"; } ... } I've no idea how to call a method by using the new JSF 2.0 AJAX functionality. Please, help me...

    Read the article

  • Can I ReRender a JSF Component from backing bean code?

    - by Ben
    Hi, Can I rerender a jsf ui component when a valuechangelistener method is run? The reason i'm asking is that my valuechangelistener method changes the values of the input boxes but when I run it, they don't seem to be rerender. The following doesn't work: <h:inputText id="inputbox_id"/> <h:selectOneMenu valueChangeListener="#{myBean.changeCountryMenu}"> <a4j:support event="onchange" rerender="inputbox_id" action="#{bean.test}> </h:selectOneMenu> Notice that bean.test() is never run. So the solution I thought of is to rerender the inputbox from the valueChangeListener. If there is some other better solution i'd be glad to hear... Thank you! Ben.

    Read the article

  • JSF ui:repeat and f:ajax giving wrong value for h:inputText after rerender.

    - by Andrew
    I have a list of questions and I can display them ok using a ui:repeat, but after clicking the Edit button the rerendered inputText is given the wrong question.id. For some reason, if you click Edit on the first item, the inputText value assigned is that of the second item in the list, even though other outputs (other than the h:inputText element) are correct. <h:form id="questionnaireForm"> <ui:repeat value="#{ProjectManager.currentProject.preQuestions}" var="question" varStatus="current" id="preQuestionsRepeat"> <div> <ui:fragment rendered="#{!question.editing}"> <f:ajax render="@form"> <p>#{question.id} #{question.questionText}</p> <h:inputText value="#{question.id}"/> <h:commandLink styleClass="link" action="#{question.setEditing}" value="Edit"> </h:commandLink> </f:ajax> </ui:fragment> </div> <div> <ui:fragment rendered="#{question.editing}"> <f:ajax render="@form"> <p>#{question.id} #{question.questionText}</p> <h:inputText value="#{question.id}"/> </f:ajax> </ui:fragment> </div> </ui:repeat> </h:form> Obviously I don't really want to edit the id. I just want the correct question.something to show up in my inputText :-) Perhaps I'm not using correctly? It seems fine according to my reading so far. Many thanks for your assistance.

    Read the article

  • JSF2 - Why does render response not rerender component setting?

    - by fekete-kamosh
    From the tutorial: "If the request is a postback and errors were encountered during the apply request values phase, process validations phase, or update model values phase, the original page is rendered during Render response phase" (http://java.sun.com/javaee/5/docs/tutorial/doc/bnaqq.html) Does it mean that if view is restored in "Restore View" phase and then any apply request/validation/update model phase fails and skips to "Render response" that Render response only passes restored view without any changes to client? Managed Bean: package cz.test; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; @ManagedBean @RequestScoped public class TesterBean { // Simple DataStore (in real world EJB) private static String storedSomeValue = null; private String someValue; public TesterBean() { } public String storeValue() { storedSomeValue = someValue; return "index"; } public String eraseValue() { storedSomeValue = null; return "index"; } public String getSomeValue() { someValue = storedSomeValue; return someValue; } public void setSomeValue(String someValue) { this.someValue = someValue; } } Composite component: <?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:c="http://java.sun.com/jsp/jstl/core"> <!-- INTERFACE --> <composite:interface> <composite:attribute name="currentBehaviour" type="java.lang.String" required="true"/> <composite:attribute name="fieldValue" required="true"/> </composite:interface> <!-- IMPLEMENTATION --> <composite:implementation> <h:panelGrid columns="3"> <c:choose> <c:when test="#{cc.attrs.currentBehaviour == 'READONLY'}" > <h:outputText id="fieldValue" value="#{cc.attrs.fieldValue}"> </h:outputText> </c:when> <c:when test="#{cc.attrs.currentBehaviour == 'MANDATORY'}" > <h:inputText id="fieldValue" value="#{cc.attrs.fieldValue}" required="true"> <f:attribute name="requiredMessage" value="Field is mandatory"/> <c:if test="#{empty cc.attrs.fieldValue}"> <f:attribute name="style" value="background-color: yellow;"/> </c:if> </h:inputText>&nbsp;* </c:when> <c:when test="#{cc.attrs.currentBehaviour == 'OPTIONAL'}" > <h:inputText id="fieldValue" value="#{cc.attrs.fieldValue}"> </h:inputText> </c:when> </c:choose> <h:message for="fieldValue" style="color:red;" /> </h:panelGrid> </composite:implementation> Page: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ez="http://java.sun.com/jsf/composite/components"> <h:head> <title>Testing page</title> </h:head> <h:body> <h:form> <h:outputText value="Some value:"/> <ez:field-component currentBehaviour="MANDATORY" fieldValue="#{testerBean.someValue}"/> <h:commandButton value="Store" action="#{testerBean.storeValue}"/> <h:commandButton value="Erase" action="#{testerBean.eraseValue}" immediate="true"/> </h:form> <br/><br/> <b>Why is field's background color not set to yellow?</b> <ol> <li>NOTICE: Field has yellow background color (mandatory field with no value)</li> <li>Fill in any value (eg. "Hello") and press Store</li> <li>NOTICE: Yellow background disappeared (as mandatory field has value)</li> <li>Clear text in the field and press Store</li> <li><b>QUESTION: Why is field's background color not set to yellow?</b></li> <li>Press Erase</li> <li>NOTICE: Field has yellow background color (mandatory field with no value)</li> </ol> </h:body>

    Read the article

  • How to filter Backbone.js Collection and Rerender App View?

    - by Jeremy H.
    Is is a total Backbone.js noob question. I am working off of the ToDo Backbone.js example trying to build out a fairly simple single app interface. While the todo project is more about user input, this app is more about filtering the data based on the user options (click events). I am completely new to Backbone.js and Mongoose and have been unable to find a good example of what I am trying to do. I have been able to get my api to pull the data from the MongoDB collection and drop it into the Backbone.js collection which renders it in the app. What I cannot for the life of me figure out how to do is filter that data and re-render the app view. I am trying to filter by the "type" field in the document. Here is my script: (I am totally aware of some major refactoring needed, I am just rapid prototyping a concept.) $(function() { window.Job = Backbone.Model.extend({ idAttribute: "_id", defaults: function() { return { attachments: false } } }); window.JobsList = Backbone.Collection.extend({ model: Job, url: '/api/jobs', leads: function() { return this.filter(function(job){ return job.get('type') == "Lead"; }); } }); window.Jobs = new JobsList; window.JobView = Backbone.View.extend({ tagName: "div", className: "item", template: _.template($('#item-template').html()), initialize: function() { this.model.bind('change', this.render, this); this.model.bind('destroy', this.remove, this); }, render: function() { $(this.el).html(this.template(this.model.toJSON())); this.setText(); return this; }, setText: function() { var month=new Array(); month[0]="Jan"; month[1]="Feb"; month[2]="Mar"; month[3]="Apr"; month[4]="May"; month[5]="Jun"; month[6]="Jul"; month[7]="Aug"; month[8]="Sep"; month[9]="Oct"; month[10]="Nov"; month[11]="Dec"; var title = this.model.get('title'); var description = this.model.get('description'); var datemonth = this.model.get('datem'); var dateday = this.model.get('dated'); var jobtype = this.model.get('type'); var jobstatus = this.model.get('status'); var amount = this.model.get('amount'); var paymentstatus = this.model.get('paymentstatus') var type = this.$('.status .jobtype'); var status = this.$('.status .jobstatus'); this.$('.title a').text(title); this.$('.description').text(description); this.$('.date .month').text(month[datemonth]); this.$('.date .day').text(dateday); type.text(jobtype); status.text(jobstatus); if(amount > 0) this.$('.paymentamount').text(amount) if(paymentstatus) this.$('.paymentstatus').text(paymentstatus) if(jobstatus === 'New') { status.addClass('new'); } else if (jobstatus === 'Past Due') { status.addClass('pastdue') }; if(jobtype === 'Lead') { type.addClass('lead'); } else if (jobtype === '') { type.addClass(''); }; }, remove: function() { $(this.el).remove(); }, clear: function() { this.model.destroy(); } }); window.AppView = Backbone.View.extend({ el: $("#main"), events: { "click #leads .highlight" : "filterLeads" }, initialize: function() { Jobs.bind('add', this.addOne, this); Jobs.bind('reset', this.addAll, this); Jobs.bind('all', this.render, this); Jobs.fetch(); }, addOne: function(job) { var view = new JobView({model: job}); this.$("#activitystream").append(view.render().el); }, addAll: function() { Jobs.each(this.addOne); }, filterLeads: function() { // left here, this event fires but i need to figure out how to filter the activity list. } }); window.App = new AppView; });

    Read the article

  • Using a4j:support 's onchange event with h:selectOneMenu

    - by user339637
    <h:selectOneMenu id="selectOneMenu" value="#{Bean1.val1}" > <f:selectItems value="#{Bean1.selectItems}"/> <a4j:support event="onchange" action="#{Bean1.onSelectOneMenuChange}" reRender="textbox1 , textbox2 , textbox3, textbox4" /> </h:selectOneMenu> <h:inputText id="textbox1" value="#{Bean1.textbox1}"> </h:inputText> <h:inputText id="textbox2" value="#{Bean1.textbox2}"> </h:inputText> <h:inputText id="textbox3" value="#{Bean1.textbox3}"> </h:inputText> <h:inputText id="textbox4" value="#{Bean1.textbox4}"> </h:inputText> Bean1.onSelectOneMenuChange() will change the value of Bean1.textbox1 , Bean1.textbox2,Bean1.textbox3 and Bean1.textbox4 depending on the value selected (Bean1.val1) .Sometimes , it will change all the textbox value and sometimes it will only changes some textbox value. When users change the value in the "selectOneMenu" drop down list control , the JSF framework will not call the update model values phase but call the Bean1.onSelectOneMenuChange() directly. After that , the all the textbox are reRender. Because the update model values phase is not called , the values entered by the user is never set the the Bean1 and the original value is shown in the textbox after reRender . So I want to ask: How can I manually call the update model values phase inside Bean1.onSelectOneMenuChange() ?How can I get the value input input by the users inside Bean1.onSelectOneMenuChange() and set it to the corresponding fields of the Bean1 ? 2.Another approach is that only reRender those textbox whose values are updated inside the Bean1.onSelectOneMenuChange() .However , there are many cases . For example , a value will change all the textbox value and a values may only change some textbox value.How can I reRender conditionally ? What method is more prefer for maintainability?

    Read the article

  • RichFaces a4j:support parameter passing

    - by Mark Lewis
    Hello I have a number of rich:inplaceInput tags in RichFaces which represent numbers in an array. The validator allows integers only. When a user clicks in an input and changes a value, how can I get the bean to sort the array given the new number and reRender the list of rich:inplaceInput tags so that they're in numerical order? EG <a4j:region> <rich:dataTable value="#{MyBacking.config}" var="feed" cellpadding="0" cellspacing="0" width="100%" border="0" columns="5" id="Admin"> ... <a4j:repeat... <a4j:region id="MsgCon"> <rich:inplaceInput value="#{h.id}" validator="#{MyBacking.validateID}" id="andID" showControls="true"> <a4j:support event="onviewactivated" action="#{MyBacking.sort}" reRender="Admin" /> </rich:inplaceInput> </a4j:region> </a4j:repeat> </data:Table> </a4j:region> Note I do NOT want to use dataTable sort functions. The table is complicated and I've specified id="Admin" (ie the whole table) to reRender as I've not found a way to send more localised values to the backing bean through the inplaceInput. This question is about how to use a4j:support action attribute to call the sort method so that when the reRender rerenders the component, it outputs the list in sorted order. I have the sort method working ok when I click a button to sort, but I want to have the list sorted automatically as soon as a new valid value is entered into the inplaceInput component. Thanks

    Read the article

  • Problem with richfaces ajax datatable + buttons

    - by Schyzotrop
    Hello i have another problem with RichFaces this is my application and it shows how i want it to work : http://www.screencast.com/users/Schyzotrop/folders/Jing/media/a299dc1e-7a10-440e-8c39-96b1ec6e85a4 this is video of some glitch that i can't solve http://screencast.com/t/MDFiMGMzY the problem is that when i am trying to press any buttons on others than 1st category it won't do anything IF 1st category has less rows than the one i am calling it from from 1st category it works always i am using follwoing code in jsp for collumns : <h:form id="categoryAttributeList"> <rich:panel> <f:facet name="header"> <h:outputText value="Category Attribute List" /> </f:facet> <rich:dataTable id="table" value="#{categoryAttributeBean.allCategoryAttribute}" var="cat" width="100%" rows="10" columnClasses="col1,col2,col2,col3"> <f:facet name="header"> <rich:columnGroup> <h:column>Name</h:column> <h:column>Description</h:column> <h:column>Category</h:column> <h:column>Actions</h:column> </rich:columnGroup> </f:facet> <rich:column filterMethod="#{categoryAttributeFilteringBean.filterNames}"> <f:facet name="header"> <h:inputText value="#{categoryAttributeFilteringBean.filterNameValue}" id="input"> <a4j:support event="onkeyup" reRender="table , ds" ignoreDupResponses="true" requestDelay="700" oncomplete="setCaretToEnd(event);" /> </h:inputText> </f:facet> <h:outputText value="#{cat.name}" /> </rich:column> <rich:column filterMethod="#{categoryAttributeFilteringBean.filterDescriptions}"> <f:facet name="header"> <h:inputText value="#{categoryAttributeFilteringBean.filterDescriptionValue}" id="input2"> <a4j:support event="onkeyup" reRender="table , ds" ignoreDupResponses="true" requestDelay="700" oncomplete="setCaretToEnd(event);" /> </h:inputText> </f:facet> <h:outputText value="#{cat.description}" /> </rich:column> <rich:column filterMethod="#{categoryAttributeFilteringBean.filterCategories}"> <f:facet name="header"> <h:selectOneMenu value="#{categoryAttributeFilteringBean.filterCategoryValue}"> <f:selectItems value="#{categoryAttributeFilteringBean.categories}" /> <a4j:support event="onchange" reRender="table, ds" /> </h:selectOneMenu> </f:facet> <h:outputText value="#{cat.categoryID.name}" /> </rich:column> <h:column> <a4j:commandButton value="Edit" reRender="pnl" action="#{categoryAttributeBean.editCategoryAttributeSetup}"> <a4j:actionparam name="categoryAttributeID" value="#{cat.categoryAttributeID}" assignTo="#{categoryAttributeBean.id}" /> <a4j:actionparam name="state" value="edit" /> <a4j:actionparam name="editId" value="#{cat.categoryAttributeID}" /> </a4j:commandButton> <a4j:commandButton reRender="categoryAttributeList" value="Delete" action="#{categoryAttributeBean.deleteCategoryAttribute}"> <a4j:actionparam name="categoryAttributeID" value="#{cat.categoryAttributeID}" assignTo="#{categoryAttributeBean.id}" /> </a4j:commandButton> </h:column> <f:facet name="footer"> <rich:datascroller id="ds" renderIfSinglePage="false"></rich:datascroller> </f:facet> </rich:dataTable> <rich:panel id="msg"> <h:messages errorStyle="color:red" infoStyle="color:green"></h:messages> </rich:panel> </rich:panel> </h:form> and here is code of my backing bean @EJB private CategoryBeanLocal categoryBean; private CategoryAttribute categoryAttribute = new CategoryAttribute(); private ArrayList<SelectItem> categories = new ArrayList<SelectItem>(); private int id; private int categoryid; // Actions public void newCategoryAttribute() { categoryAttribute.setCategoryID(categoryBean.findCategoryByID(categoryid)); categoryBean.addCategoryAttribute(categoryAttribute); FacesContext.getCurrentInstance().addMessage("newCategoryAttribute", new FacesMessage("CategoryAttribute " + categoryAttribute.getName() + " created.")); this.categoryAttribute = new CategoryAttribute(); } public void editCategoryAttributeSetup() { categoryAttribute = categoryBean.findCategoryAttributeByID(id); } public void editCategoryAttribute() { categoryAttribute.setCategoryID(categoryBean.findCategoryByID(categoryid)); categoryBean.updateCategoryAttribute(categoryAttribute); FacesContext.getCurrentInstance().addMessage("newCategoryAttribute", new FacesMessage("CategoryAttribute " + categoryAttribute.getName() + " edited.")); this.categoryAttribute = new CategoryAttribute(); } public void deleteCategoryAttribute() { categoryAttribute = categoryBean.findCategoryAttributeByID(id); categoryBean.removeCategoryAttribute(categoryAttribute); FacesContext.getCurrentInstance().addMessage("categoryAttributeList", new FacesMessage("CategoryAttribute " + categoryAttribute.getName() + " deleted.")); this.categoryAttribute = new CategoryAttribute(); } // Getters public CategoryAttribute getCategoryAttribute() { return categoryAttribute; } public List<CategoryAttribute> getAllCategoryAttribute() { return categoryBean.findAllCategoryAttributes(); } public ArrayList<SelectItem> getCategories() { categories.clear(); List<Category> allCategory = categoryBean.findAllCategory(); Iterator it = allCategory.iterator(); while (it.hasNext()) { Category cat = (Category) it.next(); SelectItem select = new SelectItem(); select.setLabel(cat.getName()); select.setValue(cat.getCategoryID()); categories.add(select); } return categories; } public int getId() { return id; } public int getCategoryid() { return categoryid; } // Setters public void setCategoryAttribute(CategoryAttribute categoryAttribute) { this.categoryAttribute = categoryAttribute; } public void setId(int id) { this.id = id; } public void setCategoryid(int categoryid) { this.categoryid = categoryid; } and here is filtering bean : @EJB private CategoryBeanLocal categoryBean; private String filterNameValue = ""; private String filterDescriptionValue = ""; private int filterCategoryValue = 0; private ArrayList<SelectItem> categories = new ArrayList<SelectItem>(); public boolean filterNames(Object current) { CategoryAttribute currentName = (CategoryAttribute) current; if (filterNameValue.length() == 0) { return true; } if (currentName.getName().toLowerCase().contains(filterNameValue.toLowerCase())) { return true; } else { System.out.println("name"); return false; } } public boolean filterDescriptions(Object current) { CategoryAttribute currentDescription = (CategoryAttribute) current; if (filterDescriptionValue.length() == 0) { return true; } if (currentDescription.getDescription().toLowerCase().contains(filterDescriptionValue.toLowerCase())) { return true; } else { System.out.println("desc"); return false; } } public boolean filterCategories(Object current) { if (filterCategoryValue == 0) { getCategories(); filterCategoryValue = new Integer(categories.get(0).getValue().toString()); } CategoryAttribute currentCategory = (CategoryAttribute) current; if (currentCategory.getCategoryID().getCategoryID() == filterCategoryValue) { return true; } else { System.out.println(currentCategory.getCategoryID().getCategoryID() + "cate" + filterCategoryValue); return false; } } public ArrayList<SelectItem> getCategories() { categories.clear(); List<Category> allCategory = categoryBean.findAllCategory(); Iterator it = allCategory.iterator(); while (it.hasNext()) { Category cat = (Category) it.next(); SelectItem select = new SelectItem(); select.setLabel(cat.getName()); select.setValue(cat.getCategoryID()); categories.add(select); } return categories; } public String getFilterDescriptionValue() { return filterDescriptionValue; } public String getFilterNameValue() { return filterNameValue; } public int getFilterCategoryValue() { return filterCategoryValue; } public void setFilterDescriptionValue(String filterDescriptionValue) { this.filterDescriptionValue = filterDescriptionValue; } public void setFilterNameValue(String filterNameValue) { this.filterNameValue = filterNameValue; } public void setFilterCategoryValue(int filterCategoryValue) { this.filterCategoryValue = filterCategoryValue; } unfortunetly i can't even imagine what could cause this problem that's why i even made videos to help u understand my problem thanks for help!

    Read the article

  • How to Overcome or fix MIXED_DML_OPERATION error in Salesforce APEX without future method ?

    - by sathya
    How to Overcome or fix MIXED_DML_OPERATION error in Salesforce APEX without future method ?MIXED_DML_OPERATION :-one of the worst issues we have ever faced :)While trying to perform DML operation on a setup object and non-setup object in a single action you will face this error.Following are the solutions I tried and the final one worked out :-1. perform the 1st objects DML on normal apex method. Then Call the 2nd objects DML through a future method.    Drawback :- You cant get a response from the future method as its context is different and because its executing asynchronously and that its static.2. Tried the following option but it didnt work :-    1. perform the dml operation on the normal apex method.    2. tried calling the 2nd dml from trigger thinking that it would be in a different context. But it didnt work.    3. Some suggestions were given in some blogs that we could try System.runas()   Unfortunately that works only for test class.   4. Finally achieved it with response synchronously through the following solution :-    a. Created 2 apex:commandbuttons :-        1. <apex:commandButton value="Save and Send Activation Email" action="{!CreateContact}"  rerender="junkpanel" oncomplete="callSimulateUserSave()">            Note :- Oncomplete will not work if you dont have a rerender attribute. So just try refreshing a junk panel.        2. <apex:commandButton value="SimulateUserSave" id="SimulateUserSave" action="{!SaveUser}"  style="display:none;margin-left:5px;"/>        Have a junk panel as well just for rerendering  :-        <apex:outputPanel id="junkpanel"></apex:outputPanel>    b. Created this javascript function which is called from first button's oncomplete and clicks the second button :-                function callSimulateUserSave()                {                    // Specify the id of the button that needs to be clicked. This id is based on the Apex Component Hierarchy.                    // You will not get this value if you dont have the id attribute in the button which needs to be clicked from javascript                    // If you have any doubt in getting this value. Just hover over the button using Chrome developer tools to get the id.                    // But it will show like theForm:SimulateUserSave but you need to replace the colon with a dot here.                    // Note :- I have given display:none in the style of the second button to make sure that, it is not visible for the user.                    var mybtn=document.getElementById('{!$Component.theForm.SimulateUserSave}');                                    mybtn.click();                }    c. Apex Methods CreateContact and SaveUser are the pagereference methods which contains the code to create contact and user respectively.       After inserting the user inside the second apex method you can just set some public Properties in the page,        for ex:- created userid to get the user details and display in the page to show the acknowledgement to the users that the User is created.

    Read the article

  • JBoss Seam: In ScopeType.PAGE I get: java.lang.IllegalStateException: No conversation context active

    - by Markos Fragkakis
    Hi all, I have a page-scoped component, which has an instance variable List with data, which I display in a datatable. This datatable has pagination, sorting and filtering. The first time gate into the page, I get this appended in my URL: ?conversationId=97. The page works correctly, and when I change datatable pages no now component is created. After a minute or two, and at seamingly random time, I get an exception saying that there is no context. I have not used @Create in my code or my navigation files. So, I have two questions: Why do I get this suffix in my URL? Why did a conversation start? Why the exception? The component is scoped to PAGE. If I received an exception, it should not be related to a conversation. Right? Or is the conversation the exception is referring a temporary conversation? Cheers! UPDATE: This is the page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <body> <ui:composition template="/WEB-INF/facelets/templates/template.xhtml"> <ui:define name="content"> <!-- This method returns focus on the filter --> <script type="text/javascript"> function submitByEnter(event){ if (event.keyCode == 13) { if (event.preventDefault) { // Firefox event.preventDefault(); } else { // IE event.returnValue = false; } document.getElementById("refreshButton").click(); } } </script> <h:form prependId="false"> <h:commandButton action="Back" value="Back to home page" /> <br /> <p><h:outputText value="Applicants and Products (experimentation page)" class="page_title" /></p> <h:commandButton action="#{applicantProductListBean.showCreateApplicant}" value="Create Applicant" id="createApplicantButton"> </h:commandButton> <a4j:commandButton value="Refresh" id="refreshButton" action="#{applicantProductListBean.refreshData}" image="/images/icons/refresh48x48.gif" reRender="compositeTable, compositeScroller"> <!-- <f:setPropertyActionListener--> <!-- target="# {pageScrollerBean.applicantProductListPage}" value="1" />--> </a4j:commandButton> <rich:toolTip for="createApplicantButton" value="Create Applicant" /> <rich:dataTable styleClass="composite2DataTable" id="compositeTable" rows="1" columnClasses="col" value="#{applicantProductListBean.dataModel}" var="pageAppList"> <f:facet name="header"> <rich:columnGroup> <rich:column colspan="3"> <h:outputText styleClass="headerText" value="Applicants" /> </rich:column> <rich:column colspan="3"> <h:outputText styleClass="headerText" value="Products" /> </rich:column> <rich:column breakBefore="true"> <h:outputText styleClass="headerText" value="Applicant Name" /> <a4j:commandButton id="sortingApplicantNameButton" action="#{applicantProductListBean.toggleSorting('applicantName')}" image="/images/icons/sorting/#{sortingFilteringBean.applicantProductListSorting.sortingValues['applicantName']}.gif" reRender="sortingApplicantNameButton, sortingApplicantEmailButton, compositeTable, compositeScroller"> <!-- <f:setPropertyActionListener--> <!-- target="#{pageScrollerBean.applicantProductListPage}" value="1" />--> </a4j:commandButton> <br /> <h:inputText value="#{sortingFilteringBean.applicantProductListFiltering.filteringValues['applicantName']}" id="applicantNameFilterValue" onkeypress="return submitByEnter(event)"> </h:inputText> </rich:column> <rich:column> <h:outputText styleClass="headerText" value="Applicant Email" /> <a4j:commandButton id="sortingApplicantEmailButton" action="#{applicantProductListBean.toggleSorting('applicantEmail')}" image="/images/icons/sorting/#{sortingFilteringBean.applicantProductListSorting.sortingValues['applicantEmail']}.gif" reRender="sortingApplicantNameButton, sortingApplicantEmailButton, compositeTable, compositeScroller"> <!-- <f:setPropertyActionListener--> <!-- target="#{pageScrollerBean.applicantProductListPage}" value="1" />--> </a4j:commandButton> <br /> <h:inputText value="#{sortingFilteringBean.applicantProductListFiltering.filteringValues['applicantEmail']}" id="applicantEmailFilterValue" onkeypress="return submitByEnter(event)"> </h:inputText> </rich:column> <rich:column> <h:outputText styleClass="headerText" value="Applicant Actions" /> </rich:column> <rich:column> <h:outputText styleClass="headerText" value="Product Name" /> <a4j:commandButton id="sortingProductNameButton" action="#{applicantProductListBean.toggleSorting('productName')}" immediate="true" image="/images/icons/sorting/#{sortingFilteringBean.applicantProductListSorting.sortingValues['productName']}.gif" reRender="sortingProductNameButton, compositeTable, compositeScroller"> </a4j:commandButton> <br /> <h:inputText value="#{sortingFilteringBean.applicantProductListFiltering.filteringValues['productName']}" id="productNameFilterValue" onkeypress="return submitByEnter(event)"> </h:inputText> </rich:column> <rich:column> <h:outputText styleClass="headerText" value="Product Email" /> <br /> <h:inputText value="#{sortingFilteringBean.applicantProductListFiltering.filteringValues['productEmail']}" id="productEmailFilterValue" onkeypress="return submitByEnter(event)"> </h:inputText> </rich:column> <rich:column> <h:outputText styleClass="headerText" value="Product Actions" /> </rich:column> </rich:columnGroup> </f:facet> <rich:subTable rowClasses="odd_applicant_row, even_applicant_row" value="#{pageAppList}" var="app"> <rich:column styleClass=" internal_cell composite2TextContainingColumn" valign="top"> <h:outputText value="#{app.name}" /> </rich:column> <rich:column styleClass="internal_cell composite2TextContainingColumn" valign="top"> <h:outputText value="#{app.receiptEmail}" /> </rich:column> <rich:column valign="top" styleClass="buttonsColumn"> <h:commandButton action="#{applicantProductListBean.showUpdateApplicant(app)}" image="/images/icons/edit.jpg"> </h:commandButton> <!-- <rich:toolTip for="editApplicantButton" value="Edit Applicant" />--> <h:commandButton action="#{applicantProductListBean.showDeleteApplicant(app)}" image="/images/icons/delete.png"> </h:commandButton> <!-- <rich:toolTip for="deleteApplicantButton" value="Delete Applicant" />--> </rich:column> <rich:column colspan="3"> <table class="productsTableTable"> <tbody> <tr> <td class="createProductButtonTableCell"><h:commandButton action="#{applicantProductListBean.showCreateProduct(app)}" value="Create Product"> </h:commandButton> <!-- <rich:toolTip for="createProductButton" value="Create Product" />--> </td> </tr> <tr> <td><rich:dataTable value="#{app.products}" var="prod" rowClasses="odd_product_row, even_product_row"> <rich:column styleClass="internal_cell composite2TextContainingColumn"> <h:outputText value="#{prod.inventedName}" /> </rich:column> <rich:column styleClass="internal_cell composite2TextContainingColumn"> <h:outputText value="#{prod.receiptEmail}" /> </rich:column> <rich:column styleClass="buttonsColumn"> <h:commandButton action="#{applicantProductListBean.showUpdateProduct(prod)}" image="/images/icons/edit.jpg"> </h:commandButton> <!-- <rich:toolTip for="editProductButton" value="Edit Product" />--> <h:commandButton action="#{applicantProductListBean.showDeleteProduct(prod)}" image="/images/icons/delete.png"> <f:setPropertyActionListener target="#{productBean.product}" value="#{prod}" /> </h:commandButton> <!-- <rich:toolTip for="deleteProductButton" value="Delete Product" />--> </rich:column> </rich:dataTable></td> </tr> </tbody> </table> </rich:column> </rich:subTable> <f:facet name="footer"> <h:panelGrid columns="1" styleClass="applicantProductListFooter"> <h:outputText value="#{msgs.no_results}" rendered="#{(empty applicantProductListBean.dataModel) || (applicantProductListBean.dataModel.rowCount==0)}"/> <rich:datascroller align="center" for="compositeTable" page="#{pageScrollerBean.applicantProductListPage}" id="compositeScroller" reRender="compositeTable" renderIfSinglePage="false" fastControls="hide"> <f:facet name="first"> <h:outputText value="#{msgs.first}" styleClass="scrollerCell" /> </f:facet> <f:facet name="first_disabled"> <h:outputText value="#{msgs.first}" styleClass="scrollerCell" /> </f:facet> <f:facet name="last"> <h:outputText value="#{msgs.last}" styleClass="scrollerCell" /> </f:facet> <f:facet name="last_disabled"> <h:outputText value="#{msgs.last}" styleClass="scrollerCell" /> </f:facet> <f:facet name="next"> <h:outputText value="#{msgs.next}" styleClass="scrollerCell" /> </f:facet> <f:facet name="next_disabled"> <h:outputText value="#{msgs.next}" styleClass="scrollerCell" /> </f:facet> <f:facet name="previous"> <h:outputText value="#{msgs.previous}" styleClass="scrollerCell" /> </f:facet> <f:facet name="previous_disabled"> <h:outputText value="#{msgs.previous}" styleClass="scrollerCell" /> </f:facet> </rich:datascroller> </h:panelGrid> </f:facet> </rich:dataTable> </h:form> </ui:define> This is the backing bean: @Name("applicantProductListBean") @Scope(ScopeType.PAGE) public class ApplicantProductListBean extends BasePagedSortableFilterableListBean { /** * Public field for ad-hoc injection to work. */ @EJB(name = "FacadeService") public ApplicantFacadeService applicantFacadeService; @Logger private static Log logger; private final int pageSize = 10; @Out(scope = ScopeType.CONVERSATION, required = false) Applicant currentApplicant; @Out(scope = ScopeType.CONVERSATION, required = false) Product product; @Create public void onCreate() { System.out.println("Create"); } @Override protected DataModel initDataModel(int pageSize) { // get filtering and sorting from session sorting = getSorting(); filtering = getFiltering(); // System.out.println("Initializing a Composite3DataModel"); // System.out.println("Pagesize: " + pageSize); // System.out.println("Filtering: " + filtering.getFilteringValues()); // System.out.println("Sorting: " + sorting.getSortingValues()); return new Composite3DataModel(1, sorting, filtering); } // Navigation methods /** * Navigation-returning method, returns the action to follow after pressing * the "Create Applicant" button * * @return the action to be taken */ public Navigation.ApplicantProductList showCreateApplicant() { return Navigation.ApplicantProductList.SHOW_CREATE_APPLICANT; } /** * Navigation-returning method, returns the action to follow after pressing * the "Edit Applicant" button * * @return the action to be taken */ public Navigation.ApplicantProductList showUpdateApplicant( Applicant applicant) { this.currentApplicant = applicant; return Navigation.ApplicantProductList.SHOW_UPDATE_APPLICANT; } /** * Navigation-returning method, returns the action to follow after pressing * the "Delete Applicant" button * * @return the action to be taken */ public Navigation.ApplicantProductList showDeleteApplicant( Applicant applicant) { this.currentApplicant = applicant; return Navigation.ApplicantProductList.SHOW_DELETE_APPLICANT; } /** * Navigation-returning method, returns the action to follow after pressing * the "Create Product" button * * @return the action to be taken */ public Navigation.ApplicantProductList showCreateProduct(Applicant app) { this.product = new Product(); this.product.setApplicant(app); return Navigation.ApplicantProductList.SHOW_CREATE_PRODUCT; } /** * Navigation-returning method, returns the action to follow after pressing * the "Edit Product" button * * @return the action to be taken */ public Navigation.ApplicantProductList showUpdateProduct(Product prod) { this.product = prod; return Navigation.ApplicantProductList.SHOW_UPDATE_PRODUCT; } /** * Navigation-returning method, returns the action to follow after pressing * the "Delete Product" button * * @return the action to be taken */ public Navigation.ApplicantProductList showDeleteProduct(Product prod) { this.product = prod; return Navigation.ApplicantProductList.SHOW_DELETE_PRODUCT; } /** * */ @Override public Sorting getSorting() { if (sorting == null) { return (getSortingFilteringBeanFromSession() .getApplicantProductListSorting()); } return sorting; } /** * */ @Override public void setSorting(Sorting sorting) { getSortingFilteringBeanFromSession().setApplicantProductListSorting( sorting); } /** * */ @Override public Filtering getFiltering() { if (filtering == null) { return (getSortingFilteringBeanFromSession() .getApplicantProductListFiltering()); } return filtering; } /** * */ @Override public void setFiltering(Filtering filtering) { getSortingFilteringBeanFromSession().setApplicantProductListFiltering( filtering); } /** * @return the currentApplicant */ public Applicant getCurrentApplicant() { return currentApplicant; } /** * @param currentApplicant * the currentApplicant to set */ public void setCurrentApplicant(Applicant applicant) { this.currentApplicant = applicant; } /** * The model for this page * */ private class Composite3DataModel extends PagedSortableFilterableDataModel<List<Applicant>> { public Composite3DataModel(int pageSize, Sorting sorting, Filtering filtering) { super(pageSize, sorting, filtering); } @Override protected DataPage<List<Applicant>> fetchPage(int fakeStartRow, int fakePageSize) { // if (logger.isTraceEnabled()) { System.out.println("Getting page with fakeStartRow: " + fakeStartRow + " and fakePageSize " + fakePageSize); // } // to find the page size multiply the startRow and the fakePageSize // (which is 1) to the actual page size int startRow = fakeStartRow * ApplicantProductListBean.this.pageSize; int pageSize = fakePageSize * ApplicantProductListBean.this.pageSize; // if (logger.isTraceEnabled()) { System.out.println("Getting page with startRow: " + startRow + " and pageSize " + pageSize); // } List<Applicant> pageApplicants = applicantFacadeService .findPagedWithCriteria(startRow, pageSize, filtering, sorting); // List<Applicant> pageApplicants = applicantFacadeService // .findPagedWithDynamicQuery(startRow, pageSize, filtering, // sorting, true); // if (logger.isTraceEnabled()) { System.out.println("Set of applicants: " + pageApplicants.size()); // } List<List<Applicant>> pageApplicantsListContainer = new ArrayList<List<Applicant>>(); pageApplicantsListContainer.add(pageApplicants); DataPage<List<Applicant>> dataPage = new DataPage<List<Applicant>>( this.getRowCount(), fakeStartRow, pageApplicantsListContainer); return dataPage; } @Override protected int getDatasetSize() { // int size = getServiceFacade().countWithCriteria(filtering, // sorting); // int size = // applicantFacadeService.countWithDynamicQuery(filtering, sorting, // false); int size = (int) Math.ceil((double) applicantFacadeService .countWithCriteria(filtering, sorting, false) / pageSize); if (logger.isTraceEnabled()) { logger.trace("Got Dataset Size: " + size); } return size; } } /** * @return the product */ public Product getProduct() { return product; } /** * @param product * the product to set */ public void setProduct(Product product) { this.product = product; } }

    Read the article

  • events not firing in VisualForce

    - by Ben
    In the page below,Topic__c is a single-select picklist. My intention is to have this list control which of the input fields is available below. The user selects an option, and the onchange event should fire, and rerender the fields. <apex:inputField value="{!Call_Report__c.Topic__c}" id="topic" > <apex:actionSupport event="onchange" reRender="tickerInput,sectorInput,bondInput"> <apex:param name="topicSelection" value="{!Call_Report__c.Topic__c}" /> </apex:actionSupport> </apex:inputField> <apex:inputField value="{!Call_Report__c.Tickers__c}" rendered="{!Call_Report__c.Topic__c='Issuer'}" id="tickerInput" /> <apex:inputField value="{!Call_Report__c.Sector__c}" rendered="{!Call_Report__c.Topic__c='Industry'}" id="sectorInput"/> <apex:inputField value="{!Call_Report__c.Security__c}" rendered="{!Call_Report__c.Topic__c='Specific Bond'}" id="bondInput" /> Am I doing something obviously wrong here? http://community.salesforce.com/t5/Visualforce-Development/Multi-select-picklist-not-firing-event-for-AJAX-refreshes/m-p/173572/highlight/false#M22119 seems to imply that what I am doing is reasonable...

    Read the article

  • JSF 2.0: Validate equality of 2 InputSecret Fields (confirm password) without writing Code?

    - by yournamehere
    I'm developing a pure JavaEE6 application with JSF 2.0 and Glassfish. My JSF implementation is Primefaces (beside Mojarra provided by Glassfish). I want to verify if the values of 2 password fields in a JSF form are equal. With Seam, there is the neat component <s:validateEquality for="pw1"/>. I want do to the same without Seam, just using JSF (or maybe a component of a JSF library). Until now i only saw examples which validate the form with a custom validator. But i would like to compare the fields without writing Java code or Javascript code. Is that possible? This what it looks like with Seam: ... <h:inputSecret id="passwort" value="#{personHome.instance.password}" redisplay="true" required="true"> <f:validateLength minimum="8"/> <a:support event="onblur" reRender="passwortField" bypassUpdates="true" ajaxSingle="true" /> </h:inputSecret> ... <h:inputSecret id="passwort2" required="true" redisplay="true"> <!-- find the JSF2.0-equivalent to this tag: --> <s:validateEquality for="passwort"/> <a:support event="onblur" reRender="passwort2Field" bypassUpdates="true" ajaxSingle="true" /> </h:inputSecret> ... Any help is appreciated. Thanks!

    Read the article

  • richfaces progressBar polling

    - by John
    Hi, I've got a progressBar component defined as the following on my webpage: <rich:modalPanel id="pb1Panel"> <rich:progressBar id="pb1" oncomplete="javascript:#{myBean.handleProgressEvent()} closeProgressModalPanel()" value="#{pb1Listener.percentageComplete}" label="#{pb1Listener.percentageComplete} %" minValue="1" maxValue="100" limitToList="true" timeout="3200" interval="1400" enabled="false"/> </rich:modalPanel> and a button: <a4j:commandButton id="actButton" value="action" action="#{myBean.performAction}" immediate="true" ajaxSingle="true" onclick="javascript:Richfaces.showModalPanel('pb1Panel');" reRender="pb1Panel"> <a4j:support event="onClick" value="#{rich:component('pb1')}.enable()" reRender="pb1" /> </a4j:commandButton> which doesn't work. However if I take out the .... enabled="false"/> .... from the progress bar, and the element from the button, everything seems to work just fine. Any suggestion why it's not working? I'm setting enabled="false" initially because I do not want the polling to start unless the button was clicked (to reduce unnecessary polling). The system is building on richfaces/seam. Thanks!

    Read the article

  • Seam:token tag not being respected

    - by JBristow
    When I click a command button, and then hit the browser back button to the form and click it again, it submits a second time without throwing the proper exception... Even stranger, the form id itself is DIFFERENT when I come back, which implies it has regenerated a "valid" form id at some point. Here's the relevant code: Any ideas? <h:form id="accountActivationForm"> <s:token/> <a4j:commandButton id="cancelActivateAccountButton" action="#{controller[cancelAction]}" image="/images/button-Cancel-gray.gif" reRender="#{reRenderList}" oncomplete="#{onCancelComplete}" /> &#160; <a4j:commandButton id="activateAccountButton" action="#{controller[agreeAction]}" image="/images/button-i-agree-continue.gif" styleClass="activate-account-button" reRender="#{reRenderList}" oncomplete="#{onActivationComplete}"/> </h:form> Clarifications: I inherited this, so I'm trying to change it as little as possible. (It's used in a couple places.) Each action returns a view, not null. I have confirmed this by stepping through line-by-line. The reRenderList is empty in my current test-case. onActivationComplete is also empty. I'm going to be going template-by-template to see if someone made it with nested forms, because my coworkers have had unrelated problems due to that, so it couldn't hurt to eliminate that as a possible problem.

    Read the article

1 2 3  | Next Page >