Rendered Property for my Button not working correctly
Hi Guys,
I Have a Table which bound to my ObjectListDataProvider
Each row will have button as follow
1.Edit ( rendered = 'isRendered" ) ( action = "edit_action()" )
2.Update ( rendered = "not isRendered") ( Action = "update_action()")
3.Cancel ( rendered = "not isRendered()") (Action = "cancel_action()")
The idea is when user first load the page what they can only see is Edit Button
Then when they start Click the Edit Button for particularr row it will
invoke the edit_action() method and set some Setting which cause the isRendered() value changed so
The Edit Button now wont be rendered but Update and Cancel Button will be rendered.
But when i click on Update Button nothing happens.
it seems rendering Component at runtime doesn't work
But i use visible propert instead of rendered it works perfectly.
Anybody encounter this issue before?
Thanks
# 1
Hello,
for us it works well at runtime. We use it for many components.
>But when i click on Update Button nothing happens.
But then it worked once for the Edit Button? Otherwise you would'nt see the Update Button, right?
> But i use visible propert instead of rendered it
> works perfectly.
That's strange. Can you check you used the same value for the property?
Juergen
# 2
yes when i clicked Edit Button these few thins will happen as below.
1. edit_action() invoked because i print something inside this method for tracing so i know this is invoked
2. then Edit Button would disappear( not rendered anymore) , as In turn ,
Update and Cancel Button would be rendered.
yea i use same value
all i did just go to properties windows bind the rendered value to "isRendered()" method
Because it doesn't work i clear the value , now i set the Visible value to "isRendered()" method for Update and Edit
But i never changed the action binding
so i guess its okay
Yea it is very weird and i dont know what cause this
the problem is when we can see Update Button means it is already being rendered right so it should invoke the binding method behind when i start clicking it but it just doesn't work for rendered...
# 3
I Am afraid because of table component thing?
Because i put these three Buttons in one Column
so what i did is i bring up the table layout
adding the FIRST Edit Button There.
After that , i go to the TableColumn , right click and start adding another Button...( Update and Cancel Button )
these three buttons will be under one table column
Is this a correct way to do it?
# 4
> Is this a correct way to do it?
That's the way we do it, too.
Nothing strange about this.
You could check the JSP Code if there are any differences.
And one more question: You said you "click the Update Button and nothing happens". But the Update_Action is executed? "Nothing happens" means that the same buttons are rendered again, when only the edit button should be rendered?
You might try and add a message group component to the page. Maybe some validation error occurs and the action is never executed.
Message was edited by:
bookon
Message was edited by:
bookon
# 5
click Update Button these following action will be taken.
1. The Update Button ANd Edit Button become invisible
2. The Edit Button visible again
it still goes to preprocess prerender and destroy but it skip my action handler...
i ll try to re do it again and see what happens.
# 6
Sorry miss Something
here goes my JSP CODe
<ui:button action="#{Page1.button1_action}" binding="#{Page1.button1}" id="button1"
rendered="#{not Page1.visible}" text="Edit"/>
<ui:button binding="#{Page1.update}" action="#{Page1.update_action}" id="update" rendered="#{Page1.visible}" text="Update"/>
<ui:button binding="#{Page1.cancel}" action="#{Page1.cancel_action}" id="cancel" rendered="#{Page1.visible}" text="Cancel"/>