-
1. Watermark component
psesi Feb 12, 2011 5:19 PM (in response to blabno)Thanks for making this component available - I've been looking for just this type of support for some time. I have downloaded the library and tested. I wasn't able to get it to work immediately because the *.watermark.js scripts aren't being automatically included in the page referencing the <watermark:watermark> component. If I "manually" include the script files on the page, things work as expected. I have not used a custom component like this before, so I may have gotten something wrong in configuration. As a quick rundown, I copied the watermark "resources-config.xml" and "watermark-component-dependcies.xml" to META-INF, "watermark.tld" to WEB-INF, copied in "watermark.tablib.xml", added to web.xml facelets.LIBRARIES context-param, and in faces-config.xml added <component> and <renderer> entries for org.richfaces.Watermark. I am using the Richfaces 3.3.3 final library. Any help on the matter would be much appreciated!
-
2. Re: Watermark component
blabno Feb 13, 2011 2:51 PM (in response to psesi)Custom components require default loading strategy. Do you have this in web.xml?
{code} <context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>DEFAULT</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>DEFAULT</param-value>
</context-param>{code}
Why "ALL" strategy does not work? Well, during RF build all components' scripts are aggregated into one file. Then at runtime it is that file that gets included in stead of each component's script. Now, was custom component available during the build? No, that's why it is custom, it was created later thus it was not included into ALL file. The same goes for styles.
-
3. Watermark component
psesi Feb 13, 2011 5:51 PM (in response to blabno)Right! Thanks for the quick and informative response. Had the load strategies set to ALL as you suspected. Changed them to DEFAULT and all is working as expected. Thanks again for your help - and for the watermark!
-
4. Watermark component
srini0883 Feb 14, 2011 5:56 AM (in response to psesi)Hi Bernard,
The component looks great.
Between, i have a query, what are the steps we need to follow to migrate from the existing RF version to 4.0?
Does 4.0 version components are compatible with the RF previous versions ?
Regards,
Srini
-
5. Watermark component
blabno Feb 14, 2011 6:07 AM (in response to srini0883)Component is not ready for RF4.0 due to lack of community feedback. If you want I can migrate it to RF4.x soon.
Components from RF3 are not compatible with 4.x.
-
6. Watermark component
srini0883 Feb 14, 2011 6:38 AM (in response to blabno)So i can Assume that 4.x components are not compatible with RF 3 versions right?
Thanks,
Srini
-
-
8. Watermark component
belgrade Feb 23, 2011 2:22 PM (in response to blabno)Hi, thanks for the good work. However, just tried it, and was working properly on a regular inputText, but did not work for me on a rich:calendar. Any insight would be greatly appreciated.
Thanks,
Dragan
-
9. Watermark component
belgrade Feb 23, 2011 3:17 PM (in response to belgrade)I suspect, the reason would be that the id given to the calendar component, is not the actual id of the input text component rendered.
-
10. Watermark component
blabno Feb 24, 2011 2:17 AM (in response to belgrade)Exactly, it's because input control has component id+suffix. Focus component does support suffixes but watermark does not, yet.
I'm not sure how should I implement this.
One way is using "for" attribute. However now we get to issue: what if we put id of non-jsf component as value of "for"? Should the component throw exception that no component with given id was found or assert (like in focus) that it may be client side non-jsf element.
In latter case it could throw javascript error if no element was found.
Next issue with "for" is re-rendering. You have to remember always to re-render also all components that point to re-rendered component in their "for".
Other way would be supporting only jsf components and using the assumption that component id + suffix would be enough, thus adding "suffix" attribute only.
If you see other options please let me know.
-
11. Watermark component
belgrade Feb 24, 2011 10:04 PM (in response to blabno)From my point of view, supporting jsf components would be a priority. If someone is using a non-jsf components, then may as well use jQuery plugin directly. My problem is that I could not make neither one support a calendar component, and am reluctant to enable the feature on some, but not other input fields. Thanks again.
-
12. Watermark component
blabno Feb 25, 2011 3:10 AM (in response to belgrade)Dragan, you can download artifact again, i've modified it to support "for" and "suffix" attributes". It is still under the same version.
-
13. Watermark component
belgrade Feb 26, 2011 10:09 AM (in response to blabno)Thanks a lot Bernard. Did not expect such a quick reaction. Amazing. I will give it a try.
-
14. Watermark component
radkrish86 Apr 5, 2011 5:56 AM (in response to blabno)Hi Bernard,
I have downloaded the jar and made necessary configurations (DEFAULT in web.xml) to display watermark in one of the textbox, it didn't work.
I am using JSF 1.2, RichFaces 3.3.1. Do i need to upgrade the richfaces to any other higher version to use this watermark??
Thanks,
RK