Return-Path: X-Original-To: apmail-wicket-users-archive@minotaur.apache.org Delivered-To: apmail-wicket-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DE2C6E1FB for ; Sun, 10 Feb 2013 21:23:54 +0000 (UTC) Received: (qmail 37370 invoked by uid 500); 10 Feb 2013 21:23:53 -0000 Delivered-To: apmail-wicket-users-archive@wicket.apache.org Received: (qmail 37308 invoked by uid 500); 10 Feb 2013 21:23:53 -0000 Mailing-List: contact users-help@wicket.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@wicket.apache.org Delivered-To: mailing list users@wicket.apache.org Received: (qmail 37297 invoked by uid 99); 10 Feb 2013 21:23:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Feb 2013 21:23:52 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of michael.jaruska@gmail.com designates 74.125.83.46 as permitted sender) Received: from [74.125.83.46] (HELO mail-ee0-f46.google.com) (74.125.83.46) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Feb 2013 21:23:43 +0000 Received: by mail-ee0-f46.google.com with SMTP id e49so2870140eek.19 for ; Sun, 10 Feb 2013 13:23:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=aoq31t+H8oYM1MxF5YMdUO5K8jhWozcJq4UogL5OY3I=; b=rrOZYy9p/AFaFydvaB7VSAIM6SkfWUAS0n+oAsGiUq8u9jUCQFhPg2F/WHdjLB+k4j XZ0ub+IzUOKyraBcPUVFl0uPWx5vFY9TAA0ODBQAFPBilDr4GR2NbCfQ5a0JR8YOmwK1 XaR7RA0e8IuNXzgIAqSTwLgOyryGXZzAJNnwYTp1X/dNX6gh/Be/jt+PGgFu+amuAutz W5wyhl8367291aS1XKavA2vD299wVumvA1bMFct4I2QHktM8yUguO0sc97u6ddm0xvhj A9Dx5Ln/dc09eQoupMGiqhPOCozlNUY3lCqFjeDmTgivwFFOXkp6iQF6eiavJeAZpWKi pddg== X-Received: by 10.14.179.5 with SMTP id g5mr42382751eem.41.1360531403374; Sun, 10 Feb 2013 13:23:23 -0800 (PST) Received: from [127.0.0.1] ([92.62.228.233]) by mx.google.com with ESMTPS id q5sm59196514eep.11.2013.02.10.13.23.21 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 10 Feb 2013 13:23:22 -0800 (PST) Message-ID: <51180FC8.5060103@gmail.com> Date: Sun, 10 Feb 2013 22:23:20 +0100 From: Michael Jaruska User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: users@wicket.apache.org Subject: Re: find html tag References: <51003DD0.2080403@gmail.com> <51003F0B.8070905@iswd.nl> <51004192.8020702@gmail.com> <51004257.4050202@iswd.nl> <51004406.3090901@gmail.com> <51004656.60305@iswd.nl> <5100521C.8050306@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org again with my question: is it possible to get markup in onRender() of the component? have found this article: https://cwiki.apache.org/WICKET/component-rendering.html but in onRender() section is just code snippet I'm not understand. is there more detailed example how to get markup of the component in onRender()? thanks, michael On 23.1.2013 22:47, Martin Grigorov wrote: > You can use IMarkupFilter to manipulate the raw markup before being loaded > and used by the components. > See the implementations in Wicket to see what can be done with such filter. > > > On Wed, Jan 23, 2013 at 11:11 PM, Michael Jaruska > wrote: > >> Look at my original post. User clicks on **subsubmenu2, then >> I have in String "category" (java code) value "menu/submenu/subsubmenu2". >> I need just to make 2 more steps: >> 1. in html code find anchor tag with href "menu/submenu/subsubmenu2"; >> 2. find
  • tag which is parent of the anchor from point 1; >> >> When I have point 2 done, then I know how to put somethink into
  • tag... >> >> >> >> >> On 23.1.2013 21:21, Bas Gooren wrote: >> >>> Ok, so you are indeed looking for a way to change a html attribute ;-) >>> >>> Since you wrote (in your folluw-up e-mail) that you cannot generate the >>> html, there are some ways, but they mostly work outside of the normal >>> wicket way. >>> >>> 1) In the component which actually renders your static html override >>> onComponentTagBody and fiddle with the markup stream (e.g. look at >>> replaceComponentTagBody) >>> >>> 2) store the static html somewhere by itself, and create a custom model. >>> The model can then load the html and perform string replacement. >>> You can then add a label component which uses the model and has >>> setEscapeModelStrings(false) set. >>> >>> Met vriendelijke groet, >>> Kind regards, >>> >>> Bas Gooren >>> >>> Op 23-1-2013 21:11, schreef Michael Jaruska: >>> >>>> I need to find the parent
  • tag of the anchor user clicks - I now >>>> from PageParameters which anchor >>>> has been clicked. Then I will put into this parent
  • specific >>>> atribute (id="something"). This attribute >>>> will be then processed by JavaScript on the page. >>>> >>>> >>>> On 23.1.2013 21:04, Bas Gooren wrote: >>>> >>>>> Sorry, I read too quickly. >>>>> >>>>> What are you trying to accomplish? Let's say you are able to find the >>>>> appropriate html tag, what do you want to do with it? >>>>> >>>>> Met vriendelijke groet, >>>>> Kind regards, >>>>> >>>>> Bas Gooren >>>>> >>>>> Op 23-1-2013 21:01, schreef Michael Jaruska: >>>>> >>>>>> And question is not "how can I change html attribute" but "how can I >>>>>> go through html structure" and >>>>>> find html tag with specific attribute :-) >>>>>> >>>>>> >>>>>> On 23.1.2013 20:50, Bas Gooren wrote: >>>>>> >>>>>>> Hi! >>>>>>> >>>>>>> What you want to accomplish (e.g. changing some html attributes) can >>>>>>> be done by adding an attributemodifier to each
  • component. >>>>>>> >>>>>>> In pseudocode: >>>>>>> >>>>>>> RepeatingView uls = ... >>>>>>> for_every_li: >>>>>>> WebMarkupContainer li = ... >>>>>>> uls.add(li); >>>>>>> >>>>>>> now, you can do something like this: >>>>>>> li.add(new AttributeAppender(...) { >>>>>>> isEnabled() { >>>>>>> return true if you want to append a html attribute; >>>>>>> } >>>>>>> }); >>>>>>> >>>>>>> Or alternatively: >>>>>>> >>>>>>> WebMarkupContainer li = new WMC() { >>>>>>> onComponentTag(ComponentTag tag) { >>>>>>> super(tag); >>>>>>> >>>>>>> tag.put("my-html-attribute", value); >>>>>>> } >>>>>>> } >>>>>>> >>>>>>> Met vriendelijke groet, >>>>>>> Kind regards, >>>>>>> >>>>>>> Bas Gooren >>>>>>> >>>>>>> Op 23-1-2013 20:45, schreef Michael Jaruska: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> is there a way I can find specific html tag in markup? >>>>>>>> >>>>>>>> I have this html structure: >>>>>>>> >>>>>>>> >>>>>>>> I'm processing clicks on anchors with my page: >>>>>>>> public PageTest(PageParameters parameters){ >>>>>>>> //cid = category id >>>>>>>> String category = parameters.get("cid").**toString(); >>>>>>>> ... >>>>>>>> } >>>>>>>> >>>>>>>> Now I need some way I can add atribute into parent
  • tag of >>>>>>>> tag on which I do click. >>>>>>>> Somethink like (pseudocode): >>>>>>>> public PageTest(PageParameters parameters){ >>>>>>>> //cid = category id >>>>>>>> String category = parameters.get("cid").**toString(); >>>>>>>> //find corresponding tag >>>>>>>> Tag anchorTag = go_from_top_ul_tag_and_find_a_** >>>>>>>> tag_by_category(category) >>>>>>>> //have corresponding anchor tag, get parrent tag of the anchor tag >>>>>>>> Tag anchorParentTag = anchorTag.getParent(); >>>>>>>> //and now I can do my mysterious things with menu... >>>>>>>> } >>>>>>>> >>>>>>>> But I don't know where to start my search and I totaly don't know >>>>>>>> whot to look for in docu. >>>>>>>> >>>>>>>> Please, help :-) >>>>>>>> >>>>>>>> ------------------------------**------------------------------** >>>>>>>> --------- >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org >>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> ------------------------------**------------------------------** >>>>>> --------- >>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org >>>>>> For additional commands, e-mail: users-help@wicket.apache.org >>>>>> >>>>>> >>>>> >>>>> >>>> ------------------------------**------------------------------** >>>> --------- >>>> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org >>>> For additional commands, e-mail: users-help@wicket.apache.org >>>> >>>> >>> >>> >> ------------------------------**------------------------------**--------- >> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org >> For additional commands, e-mail: users-help@wicket.apache.org >> >> > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For additional commands, e-mail: users-help@wicket.apache.org