voyent
Has anyone used Javascript to create/click button to set backing bean property  XML
Forum Index -> Portals & Portlets
Author Message
grubin

Joined: 10/Dec/2011 07:44:13
Messages: 19
Offline


I'm in Liferay 6.1 (yes, a portlet) and ICEfaces 3.0.

And it's even slightly more complicated than the question would indicate. I need also to add 3 f:params. Of course, by the time the Javascript function runs, everything's in HTML.

In fact, here's the h:commandButton before the JSF has been HTMLed:
Code:
<div id="divbutt"><h:commandButton id="hidebutt" value="Edit" actionListener="#{wtfBean.aedEventBean.setRendered}" style="display: none">
 <f:param name="dbedit" value="#{node.userObject.displayPanel}" />
 <f:param name="dbitemId" value="#{node.userObject.itemId}" />
 <f:param name="dbparentId" value="#{node.userObject.parentId}" />
 </h:commandButton></div>


and this is the resultant HTML:
Code:
<div id="divbutt">
 <input id="A8660:wtfForm:hidebutt" name="A8660:wtfForm:hidebutt" onclick="mojarra.jsfcljs(document.getElementById('A8660:wtfForm'),{'A8660:wtfForm:hidebutt':'A8660:wtfForm:hidebutt','dbedit':'','dbitemId':'','dbparentId':''},'');return false" style="display: none" type="submit" value="Edit" />
 </div>


(Line breaks have been inserted.)

What I want to do is to include ONLY the h:commandButton in my xhtml and to inject the f:params in the Javascript. This is necessary because only then do I know the values to insert.

I've look throgh the HTML page source and cannot find additional references to dbedit, dbitemId or dbparentId, the values of which I have to inject.

Has anyone got any advice on how I should or could accomplish what I need to do.

Background: In Javascript I'm responding to a double-click on a canvas in an HTML5 segment that's actually embedded in an ice:panelBorder. That part works. I know what the user double-clicked on. I need to pass info the the session bean in order to cause an ice:panelGrid to be visible and rendered.

I'm almost there. It's complex, but should be doable.

Thanks. All ideas will be appreciated.

In return I'll post a Wiki article on integrating Liferay, ICEfaces and HTML5 in a single portlet.
 
Forum Index -> Portals & Portlets
Go to:   
Powered by JForum 2.1.7ice © JForum Team