javascript to show contents of inplace component
Posted: 11 Feb 2010, 19:12
Is there a way to dynamically show the contents of an inplace component?
If #{myBean.phone} is empty string, there is nothing for the user to click on to get to the inplace content. I could use the label attribute of the inplace component, but when myBean.phone is not null, the custom converter is not used. My initial thought was that I could use an optionally rendered outputLink that could execute some sort of click() or show() method on the inplace component, but I could not get this to work.
After examining the javascript (source) that shows/hides the inplace component, it looks like I could construct some javascript that uses jQuery(contentId).show(), but this seems brittle and the wrong way to go.
Can anyone think of a good solution to this?
thanks!
Code: Select all
<h:form id="form">
<p:inplace id="myInplace" widgetVar="inplacePhone">
<h:inputText value="#{myBean.phone}">
<rc:convertPhone/> <!-- my custom converter -->
</h:inputText>
</p:inplace>
</h:form>
After examining the javascript (source) that shows/hides the inplace component, it looks like I could construct some javascript that uses jQuery(contentId).show(), but this seems brittle and the wrong way to go.
Can anyone think of a good solution to this?
thanks!