-
1. Re: Can't pass boolean parms in componentControl
k2kirov Sep 22, 2008 7:05 AM (in response to pdpantages)I have the exact same problem. The big question is "Can we affect the component attributes with the parameters passed from componentControl or just the content of the component inside the menuItem.
This is driving me crazy :( and no solution so far -
2. Re: Can't pass boolean parms in componentControl
pdpantages Sep 22, 2008 9:21 AM (in response to pdpantages)Hello k2kirov,
No, I have not found a solution; I have been distracted with some memory leak issues and have not returned to look at this one. I thought that, in my case, I might be able to write some javascript to set the "disabled" attribute and call it on the onshow event, but I have not tried this.
I will definitely post if I can get anything to work.
PdP -
3. Re: Can't pass boolean parms in componentControl
nbelaevski Sep 22, 2008 9:30 AM (in response to pdpantages)Just the content. A possible workaround is to create two menu items: one disabled another not and make one of them hidden by using style="display: {someParam}" declaration where someParam can be set to 'none' or ''.
-
4. Re: Can't pass boolean parms in componentControl
pdpantages Oct 13, 2008 2:24 AM (in response to pdpantages)Thank you nick, the workaround fixed me up.
k2kirov, hope this helps you. I used something like this for my componentControl:<rich:componentControl event="oncontextmenu" attachTiming="onload" for="em" operation="show"> <f:param value="#{node.description}" name="nm"/> <f:param value="#{node.id}" name="id"/> <f:param value="#{node.craftUrl}" name="crft"/> <f:param value="#{node.craftUrl == null ? 'block' : 'none' }" name="cd"/> <f:param value="#{node.craftUrl == null ? 'none' : 'block' }" name="ce"/> </rich:componentControl>
I used 'block' intstead of '' to avoid FF css errors about invalid style.
In the context menu:<rich:menuItem style="display: {cd};" value="Launch Craft" disabled="true" submitMode="none"> </rich:menuItem> <rich:menuItem style="display: {ce};" value="Launch Craft" disabled="false" onclick="launchcrft('{crft}');"> </rich:menuItem>
PdP