Hi I am trying to use the HighChart component in the loop but with not luck so far. My problem is that the client id is always the same for everything that runs in the loop but if I put the few components next to each other then they all have the unique id. The code in the class that comes from the component (not under my control)
@Parameter(value = "prop:componentResources.id", defaultPrefix = BindingConstants.LITERAL) private String clientId; @Parameter private JSONObject options; @Inject private JavaScriptSupport javascript; @Inject private ComponentResources resources; @SetupRender public void addDiv(MarkupWriter writer){ writer.element("div", "id", clientId); } @AfterRender public void setJS(MarkupWriter writer){ resources.renderInformalParameters(writer); writer.end(); JSONObject opt = new JSONObject(); opt.put("id", clientId); JSONObject params = getComponentOptions(); JQueryUtils.merge(params, options); opt.put("opt", params); System.out.println(opt); javascript.addInitializerCall("highcharts", opt); } public JSONObject getComponentOptions(){ return new JSONObject(); } public String getClientId() { return clientId; } So my problem is that @SetupRender public void addDiv(MarkupWriter writer){ writer.element("div", "id", clientId); } generates writes always the same id. So how can I override this class or supply an external id vie parameter so that it is unique. What would be the best way? I guess I could create a method that sets this id and then pass it to the component but I would like to avoid creating an extra method as I belive that this is something that component it self should resolve, any suggestions? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Generating-unique-tapestry-id-or-client-id-in-HighCharts-tp5716693.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org