Hi,
I'm in the process of internationalising some JSF files so am externalising strings (and the concatenation of strings using placeholders). I have very little experience with JSF (today and yesterday) so excuse me if there is an obviuos answer to my question!
I have been using the h:outputFormat tag (and the f:param tag) successfully for simple placeholders but now I'm looking to replace a placeholder with a commandLink component.
i.e.
<h:outputFormat value="#{adminMsgs.scheduleUpdateLink} ">
<h:commandLink value="#{adminMsgs.update}" action="refresh" />
</h:outputFormat>
Properties file:
scheduleUpdateLink = After waiting a few seconds, please {0} the page.
update = update
And output along these lines:
After waiting a few seconds, please <a href="#" class="..." onclick="...;return false;">update</a> the page.
This doesn't work (the update link appears before the 'scheduleUpdateLink' text), does anyone know how I might do it?
Thanks in advance.
EDIT / UPDATE
Thanks for your reply McDowell - very useful, but still haven't completely solved my problem. I will also be needing to do the same with input boxes (h:inputText), and there may also be instances where there are multiple placeholders in one resource string. Hence I cannot guarantee the order in, say, Arabic, will be the same.
If I went with a Java function; do you know if there is a way I can pass, as a string, the JSF tags, e.g. <h:outputFormat value=..
. and use the faces context to obtain the rendered HTML which I can then insert into respective placeholders and return as plain HTML? Or any other ideas along these lines?
Cheers.