File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes How to update commandlink from one page to other page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to update commandlink from one page to other page?" Watch "How to update commandlink from one page to other page?" New topic
Author

How to update commandlink from one page to other page?

Andrew Progash
Greenhorn

Joined: Jul 16, 2013
Posts: 4
I want to update disabled attribute of commandlink from one page to other page but i don't know how to do it.

For example:
page1
<p:commandButton actionListener="#{MyBean.checkLogin()}" id="login" value="Login">
<p:ajax listener="#{MyBean.enableButton}" update="b1"/>
</p>


page2
<p:commandLink actionListener="#{MyBean.goStep1}" id="b1" disabled="#{!Mybean.enabled_back}"><button id="default" type="button">Back</button></p:commandLink>


if click button in page, set disabled attribute of button in page2 and go to page2.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629
    
  15

1. Change the name of MyBean to "myBean". POJO conventions are for Class names to begin uppercase, instance and property names begin with lowercase. Failure to observe this may cause various tools to malfunction.

2. Change #{MyBean.checkLogin()} to #{myBean.checkLogin}. The "()" is not appropriate here.

3. Change MyBean.checkLogin from an actionListener to a simple POJO action.

4. You cannot reference an element ID from any other View than the one that contains it. It doesn't matter, though, since when the second View is opened, the current backing bean values will apply.

Note that JSF does not support opening 2 windows/browser tabs at the same time. HTTP itself doesn't support 1 open window updating another one except as JavaScript permits. Then again, as a user, I don't like apps that open multiple windows. My desktop is crowded enough as it is.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to update commandlink from one page to other page?
 
Similar Threads
how to include one jsf page in another jsf page ?
Deactivating validations
how to include one jsf page in another jsf page ?
Disabling a cell in Datagrid
How to set disable for p:commandLink with JavaScript?