fabio moreira

Greenhorn
+ Follow
since Sep 09, 2015
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by fabio moreira

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.



Thank you all, the solution is simpler than I imagined!!!
<p:outputPanel autoUpdate="true">


9 years ago
JSF

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.


Thanks Tim Holloway for your class on ajax! But the problem relates to the autocomplete component, because i need to redesign <h:comandButton> after his execution.
I tried to put a variable within the component but still not worked.
9 years ago
JSF

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



God morning Axel, Thanks you for your help!!!
Sorry now I realized that this code line is not required,
2. your making update to current element and also updating the panelgroup which means your updating same component twice

The ajax only serves to be able to capture a list value!
I need to repaint the screen after the User clicks the autocomplete.If nothing appears, I must warn you that it can create a company!


Thanks a lot for the help!I think this problem is not easy to solve , you may need to implement a javascript. I honestly do not like!! I prefer JAVA!!!

9 years ago
JSF

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.



Thanks Axel,
I have explained me wrong. The repainting of the component needs to be after the autocomplete event.Must perform repintagen after autocomplete event.
The binding was an attempt to manipulate a DOM HTLM Component.
But unfortunately still not solved this problem!!!I do not know what else to do!!!
9 years ago
JSF

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


Thanks, but unfortunately does not work. To be more exact , only works when i give a refresh (F5) on the page. In this case appears the button, because the boolean variable (buttonEnabler) is was set!!!
The component should be redrawn , but it seems the autocomplete does not leave!!!

9 years ago
JSF

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.



Hy Arun Giridthar! Thanks for your reply!!
Sorry I typed in this code #{v} im typed wrong! The correct is #{c} (Variable for Company).
well, i tried to give an update but it did not work, see :
9 years ago
JSF
Hi Guys!
It is possible to render the same page another component using the autocomplete ?
My code:

My ManageBean is


Help!
9 years ago
JSF
Hello!
I am new to jsf, I'm trying to run two selectOneMenu with ajax, but when I select a state, i receive an empty list!!!
I'm using JSF ( javax.faces -api - 2.2.jar ) There is some error?
https://stackoverflow.com/questions/9171050/how-to-load-second-selectonemenu-on-change-of-first-selectonemenu/32480630#32480630




9 years ago
JSF