-
1. Re: Problem with h:commandButton and rendered attribute
lvdberg Jan 13, 2010 1:05 PM (in response to giunad)Hi,
this is not really a Seam question, but ok I can imagine your struggle. The rendered attribute does exactly what you state. If the value is false NOTHING is rendered so you can NEVER reference its ID for reRendering, because there is nothing in the DOM available. This is exactly where the nice seam.tag s:div comes in. It renders its content based on the rendered attribute, but stays present itself. So you can reference it in a reRender. You can alos use an Ajax panel wich works basically the same.
Leo
-
2. Re: Problem with h:commandButton and rendered attribute
giunad Jan 13, 2010 1:53 PM (in response to giunad)hi,
maybe I was poor in my writing, sorry english is not my language.
what exactly happens is:
- I reach edit page (edit.jsf?mode=edit)
- the update button is showed
- I click on it
- the update method is NOT fired
- the page is reloaded.why?
I understand how rendered attribute works, but this work happens before I click the button.
If I can see update button, rendering is over, isn't it?So what is stopping seam/jsf to fire update method?
thanks
-
3. Re: Problem with h:commandButton and rendered attribute
lvdberg Jan 13, 2010 2:06 PM (in response to giunad)Hi,
Send the code of the bean, because it should work normal. Surely there is the always present tinny little detail we're missing now.
Leo
-
4. Re: Problem with h:commandButton and rendered attribute
giunad Jan 13, 2010 2:31 PM (in response to giunad)here is:
@Stateful @Scope(ScopeType.SESSION) @Name("advManager") public class AdvManagerBean implements AdvManager, Serializable { private static final long serialVersionUID = -8882059433848876582L; @DataModel(scope=ScopeType.PAGE) private List<Adv> advList; @DataModelSelection @Out(required = false, scope = ScopeType.CONVERSATION) private Adv adv = new Adv(); private Spot spot1 = new Spot(); @In(required = true) private Account currentAccount; @PersistenceContext(type = PersistenceContextType.EXTENDED) private EntityManager em; // - - - ACTIONS - - - public String insert() { // do insert return "inserted"; } public String update() { // do update return "update"; } // - - - SETTER & GETTER - - - }
-
5. Re: Problem with h:commandButton and rendered attribute
mikkus70 Jan 13, 2010 3:05 PM (in response to giunad)The navigation rule for the update() action expects an outcome of
updated
, whereas the method returnsupdate
. This means the rule is not fired. -
6. Re: Problem with h:commandButton and rendered attribute
lvdberg Jan 13, 2010 3:12 PM (in response to giunad)Hi,
I can't see a reason why you should have the bean at the session context. because its a Stateful SB it already ha a Conversation scope.
To get that working you should somewhere have a conversation started. I can imagine you click on the list a conversation starts, you do some things and you submit the form. Don't understand why you complicate stuff with the Param by adding it (somehow) to the url. Just use buttons to insert and edit
Leo
-
7. Re: Problem with h:commandButton and rendered attribute
giunad Jan 13, 2010 3:40 PM (in response to giunad)It's 'updated' in my code. 'update' was just a cut and past error.
thansk -
8. Re: Problem with h:commandButton and rendered attribute
giunad Jan 13, 2010 3:45 PM (in response to giunad)
Leo van den Berg wrote on Jan 13, 2010 15:12:
Don't understand why you complicate stuff with the Param by adding it (somehow) to the url. Just use buttons to insert and edit
Leoso I'm using the same page for insert and for update. I need just 2 different buttons.
-
9. Re: Problem with h:commandButton and rendered attribute
jurijlender Jul 5, 2010 11:52 AM (in response to giunad)could anyone find an answer to that problem? i am having the same problem too. i estimate that it is because the ajax-buttons are mapped with the action before some proerties are set in the bean. at least this is what i found out concerning the action using for the rendered attribute.