This is the continuation of my ongoing question (Dynamic Link Labelling)[http://forum.webratio.com/questions/671/dynamic-link-labelling-for-custom-unit].
I moved it to this thread because it's now specifically about getting a AjaxURL tag in a Custom Unit style sheet to work (and no about getting the Label to display correcty as per the past post). Hope this helps people.
The compilation error is about the <wr:AjaxURL>
tag, where the "context" attribute is the variable used to locate the link.
My IFML looks like:
image?
As per the last entry on the previous forum item:
- the "link" variable is correctly referring the link outgoing from the unit.
- As per the image below, the operation chain is being followed correctly. I have two examples of my Custom Control trilogy (the actuate, the save and the display) on the one popup, and both do what they should and receive the correct input parameters in each case.
- I get a compilation error on the "onclick" code as suggested (see code below), but if I exclude it the pages work as they should except instead of re-freshing only the Ajax popup, the browser does a full GET or POST and the popup page now fills the entire browser pane.
When the "onclick" and AjaxURL is not included it operates like:
image?
(here's the full style unit code)[https://dl.dropboxusercontent.com/u/11776886/CustomStyleUnit.txt]
So the question is now, why do I get a compilation error (in the style sheet of the custom unit)?
So reiterating, if I have the following code in the link:
onclick="<wr:AjaxURL context="link" type="button"/>"
I get this compilation error:
com.webratio.commons.transform.EvaluateException: Undefined Link Context: Unable to find the link in the specified context [context = link/.].
[occurred at line 11 in AjaxURL.template]
using the link defined as you suggest
<input title="<c:out value="${<wr:UnitId/>.signInputLabel}"/>" onclick="<wr:AjaxURL context="link" type="button"/>" type="submit" id="button:<wr:Id context="link"/>" name="button:<wr:Id context="link"/>" value="<c:out value="${<wr:UnitId/>.signName}"/>"/>
As asked, the code of the link is only inserted in the custom template. There is only the single custom template. The behaviour described about is that where there is no <wr:AjaxURL>
tag or onclick tag in the button tag. As mentioned, when I put that suggested "onclick" code in the input button tag it doesn't compile.
I did read the API description of the <wr:AjaxURL>
tag and it did mention I needed it wrapped in an iterator tag? I did try hacking an iterator around the single link
var but didn't have any luck.
Finally, in previous help it was suggested to create a link that was hidden. I think that this could be the problem and I have not set this up correctly. When I try to include the "hide" definition for the link I'm not getting the same IDE options presented. This weekend I will install the latest WebRatio and try building a Custom Unit and single page website from new. I'll post if I have success, or any variation in defining the link and hiding it as previously sugggested.
Thanks.