First item in Google if you type "partialtriggers trinidad". Should
tell you what you need to know.
http://myfaces.apache.org/trinidad/devguide/ppr.html
Hope that helps,
Scott
On 03/02/2011 01:50 AM, Håkon Sagehaug wrote:
Hi
I've read some about these triggers, but not sure how to use it, should I
connect the partialTrigger to the #{helloWorldBacking.pollText} value, so
when ever this is updated, the value is also? Or do I connect it to the
commandButton in my form, little confused :)
cheers, Håkon
On 2 March 2011 09:00, Scott O'Bryan<[email protected]> wrote:
Ahh yeah. Look, your component is not updating because you're not
telling it to. You need to set up a partialTrigger in order to get
the StatusIndicator to update.
On Mar 2, 2011, at 12:48 AM, "Håkon Sagehaug"<[email protected]>
wrote:
Hi
Thanks for the reply, here is my xhtml, with a simple login form
<tr:document title="Login Demo">
<tr:statusIndicator>
<f:facet name="busy">
<tr:outputText value="#{helloWorldBacking.pollText}" />
</f:facet>
</tr:statusIndicator>
<tr:form>
<tr:panelPage>
<f:facet name="infoStatus">
<tr:legend name="required" />
</f:facet>
<tr:inputText label="Username" id="username"
value="#{helloWorldBacking.username}" required="true"
/>
<tr:inputText label="Password" id="password"
value="#{helloWorldBacking.password}" required="true"
secret="true" />
<tr:commandButton id="button2" text="Login"
partialSubmit="true"
action="#{helloWorldBacking.send}" />
</tr:panelPage>
</tr:form>
</tr:document>
And parts of the backing bean
public String send() {
FacesContext facesContext = FacesContext.getCurrentInstance();
System.out.println("user name " + username + " is logged in "
+ userLoggedIn);
try {
Thread.sleep(5000);
Token tok = tokenMgr.getToken(username, password, true);
Thread.sleep(2000);
pollText = "Token fetched";
if (tok != null) {
userLoggedIn = true;
return ("success");
}
username = "";
password = "";
} catch (TrustException e1) {
e1.printStackTrace();
} catch (AxisFault e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (XMLStreamException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
FacesMessage message = new FacesMessage("Login failed");
facesContext.addMessage("username", message);
username = "";
password = "";
return ("error");
}
As you can see I sleep the thread to simulate the operations needed to
log
in the user, for now I'm only getting the token. After that I'll fetch
the
project, data etc...
So I wanted the pollText to apear dynmically in the status indicator,
but
can get it to update,.
Any tips?
cheers, Håkon
On 1 March 2011 23:23, Scott O'Bryan<[email protected]> wrote:
I see no reason why this wouldn't work.. What specifically is failing
for you and perhaps a code snipi might help me visualize your issue.
On Mar 1, 2011, at 3:04 PM, "Håkon Sagehaug"<[email protected]>
wrote:
Hi all,
I've just stared using Trinidad and myFaces, and had a question. I'm
implementing a login in page for uses, and wanted to use the
statusIndicator, to give back messages for the user like
1. Got user information
2. Loading datasets
3. Logged in
And tried to have a tr:outputText within the statusIndicator. The
value
for
the outPuttext would be linked to a backing bean, but I was not very
successful, do you have any other tips?
I guess one can use the progressIndicator, but I would like text to be
returned not a procentage progress.
cheers, Håkon