Hi,
We want to use global limited tooltips for the replacement of P:messages.And when we are going to apply p:messages in one panel we can see the same messages in other panels which not required.But we had problem with using global limited tooltip and mostly "ForSelector" attribute is not proper. I tried same like showcase example and we had same problem with Shared Tooltip for filters.Any insight would be appreciated.
Environment:
Primefaces 3.2
Primefaces extension 0.4.0
JSF2.0
WAS 6.1
Using Global limited tooltip and Shared tooltip
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/
___________________
Sudheer Jonna
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/
___________________
Sudheer Jonna
Hi,
What is your code? Can you post it here? I haven't understood how you plan to intergrate p:messages inside of pe:tooltip. See this blog post how to show error messages inside of pe:tooltip in a generic way http://ovaraksin.blogspot.de/2012/03/sh ... -with.html
What is your code? Can you post it here? I haven't understood how you plan to intergrate p:messages inside of pe:tooltip. See this blog post how to show error messages inside of pe:tooltip in a generic way http://ovaraksin.blogspot.de/2012/03/sh ... -with.html
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
Hi Oleg,
Thank you for your response.
We started doing validations in our new PF application And we had options like using P:messeges or global limited tooltip.
1.When we are going to use P:messages validations going to apply all the panels.
2. Global limited tooltips are not working
Example validations required: FirstName cannot be empty,maximum and mininum length of account number.......
we are using templates in all pages.is it the reason for problems? And we want to use shared tooltips for filters also but same problem like Global limited tooltip
Now we are trying like this
XHTML
Java (controller bean)
The following code working only if we include P:messegs in our page
Search Panel Code in my application
Thank you for your response.
We started doing validations in our new PF application And we had options like using P:messeges or global limited tooltip.
1.When we are going to use P:messages validations going to apply all the panels.
2. Global limited tooltips are not working
Example validations required: FirstName cannot be empty,maximum and mininum length of account number.......
we are using templates in all pages.is it the reason for problems? And we want to use shared tooltips for filters also but same problem like Global limited tooltip
Now we are trying like this
XHTML
Code: Select all
<p:inputText id="lastName" required="true" label="Last Name" title="#{component.valid ? '' : myController.messageForLastName}"/>
Code: Select all
public String getMessageForLastName() {
return FacesContext.getCurrentInstance().getMessages("lastName").next().getDetail();
}
Search Panel Code in my application
Code: Select all
<ui:define name="SearchPanel">
<p:messages id="messages" autoUpdate="true"/>
<p:panel styleClass="myPanelStyle myPanelStyleTitle" collapsed="true"
id="pnl" header="Search Accounts" toggleable="true"
toggleSpeed="500" closeSpeed="2000" widgetVar="panel">
<f:facet name="header">
<h:outputText value="SEARCH" style="margin-left:1%;" /></f:facet>
<p:spacer width="0" height="8"></p:spacer>
<div style="margin-right: auto; margin-left: auto;">
<p:panelGrid columns="6" cellspacing="3">
<h:outputText value="Investor Name" style="font-weight:bold;" />
<h:panelGroup>
<p:inputText id="investorname"value="#{accounts.searchDet.invName}" label="investorname" >
</p:inputText>
<pe:keyFilter for="investorname" regEx="/[a-zA-z0-9\@\']/i"/>
<p:watermark for="investorname" value="Enter Value To Search" />
<!-- <p:message for="investorname" />-->
</h:panelGroup>
<h:outputText value="Account Number" style="font-weight:bold;" />
<h:panelGroup>
<p:inputText id="accountnumber" label="Account Number" maxlength = "9" value="# {accounts.searchDet.accountnumber}" required="true"
title="#{component.valid ? '' : 'Account number cannot be empty'}">
<f:validateLength minimum="2" maximum="9"/>
</p:inputText>
<pe:keyFilter for="accountnumber" mask="pint"/>
<p:watermark for="accountnumber" value="Enter Value To Search" />
</h:panelGroup>
<h:outputText value="Dealer Code *" style="font-weight:bold;" />
<h:panelGroup>
<p:inputText id="delcode" value="#{accounts.searchDet.dealerCode}" label="Delcode" disabled = "#{accounts.dealerDisabled}" required="true" title="#{component.valid ? '' : accounts.messageForDealerCode}">
<f:validateLength maximum="4"/>
</p:inputText>
<pe:keyFilter for="delcode" mask="alphanum"/>
<p:watermark for="delcode" value="Enter Value To Search" />
</h:panelGroup>
<h:outputText value="Representative Code" style="font-weight:bold;" />
<h:panelGroup>
<p:inputText id="repCode" rendered = "#{accounts.repCodeRendered}"
value="#{accounts.searchDet.repCode}" label="RepCode" disabled = "#{accounts.repDisabled}" required="true" title="#{component.valid ? '' : accounts.messageForRepCode}">
<f:validateLength maximum="6"/>
</p:inputText>
<p:watermark for="repCode" value="Enter Value To Search" />
<p:autoComplete id="dd" dropdown="true" maxlength = "4" disabled = "#{accounts.repDisabled}" rendered = "#{accounts.repCodeDDRendered}"
value="#{accounts.searchDet.repCode}" queryDelay = "300" forceSelection = "true" autocomplete = "off" scrollHeight="200"completeMethod="#{accounts.complete}" />
<p:watermark for="dd" value="Enter Value To Search" />
</h:panelGroup>
<h:outputText value="SIN" style="font-weight:bold;" />
<h:panelGroup>
<p:inputText id="sin"
value="#{accounts.searchDet.sin}" label="Sin" maxlength = "11" required="true" title="#{component.valid ? '' : accounts.messageForSin}">
<f:validateLength min="1" maximum="11"/>
</p:inputText>
<pe:keyFilter for="sin" mask="num"/>
<p:watermark for="sin" value="Enter Value To Search" />
</h:panelGroup>
<h:outputText value="Dealer Account Number" style="font-weight:bold;" />
</p:panelGrid>
<!-- <pe:tooltip global="true" position="left center" targetPosition="right center"/> -->
<p:commandButton value="Search" update=":form:tbl,:form:chartpanel,:form:Detail,:form:user," process = "@form"
actionListener="#{accounts.searchAccount}" onclick="PrimeFaces.cleanWatermarks();" oncomplete="PrimeFaces.showWatermarks(); "/>
<!--<pe:tooltip global="true" position="left center" targetPosition="right center" forSelector=".ui-state-error"/>
--></div>
</p:panel>
</ui:define>
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/
___________________
Sudheer Jonna
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/
___________________
Sudheer Jonna
Strange. Do you mean messages in tooltips only work when p:messages is available?The following code working only if we include P:messegs in our page
By the way, you don't need to update global pe:tooltip. It's not a problem, but place it outside of updateable area.
And you can use pe:keyFilter as child component
Code: Select all
<p:inputText id="investorname"value="#{accounts.searchDet.invName}" label="investorname" >
<pe:keyFilter regEx="/[a-zA-z0-9\@\']/i"/>
</p:inputText>
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests