Arun Giridhar wrote:
why itemValue is set to #{v} ? (what is v ?). on getting company object as value why cant you enable render attribute ? with update of panel or specific id.
Arun Giridhar wrote:first i dont know why you have used binding (often i have no use of it), second there is an attribute for p:commandButton called rendered="true/false" you can set a listener for p:autocomplete , when you get an object (with an event="itemSelect " ) update the rendered value rendered=#{managedBean.buttonEnabler}
I would use rendered=#{managedbean.search!=null} as rendered condition in p:commandButton
go through
primeface,this
Axel Janssen wrote:Fabio,
take a look at this stackoverflow answer: http://stackoverflow.com/a/13779025
Try to put a <h:panelGroup autoUpdate="true"> arround the 3 elements you want to rerender after the ajax request - response circle initiated by the itemSelect of the p:autoComplete.
I tend to allways prefer ids referenced in render/update-attributes
I don't understand the binding of the commandButton.
Axel Janssen wrote:
Arun Giridhar wrote:
Axel Janssen wrote:
1. render of <f:ajax> (core) use white space as delimiter and (primeface) update of <p:ajax> use ", " (comma)
to
2. your making update to current element and also updating the panelgroup which means your updating same component twice
to
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Tim Holloway wrote:You can do this without (directly) using Javascript, by using AJAX.
Basically, it works like this.
1. The parent control fires AJAX listener events when you input to it. The AJAX element indicates not only the event type and listener method, but what parts of the View (dependent control's id) to (re)render on completion of the listener method call.
2. The AJAX listener method sets a backing bean boolean property ("showMe") to indicate whether the dependent control should be visible or not.
3. The dependent control has a 'rendered="#{mybean.showMe}" attribute that causes it to appear if and only if that property is true when the control is rendered or re-rendered.
That's all you need.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
Tim Holloway wrote:Since the autocomplete tag apparently does not have a re-render attribute itself, you should try adding an f:ajax tag under it to provide the render functionality.
The other alternative is to show/hide the commandButton using CSS attribute settings as an "oncomplete" method, which would look something like this:
Modify the above code as needed. I couldn't remember the exact stylenames or function call to locate DOM objects, but that's the shape of the logic.
Alos, please note that backing bean names should not begin with uppercase letters in accordance with the Java convention that class names start with upper case, but instance names start with lower case. JSF doesn't care, but some development tools will get annoyed, and if you use annotations on your backing beans, the default naming will be wrong.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |