Ok guys;

Actually I was thinking if I was talking non-sense, but I run into the
same need again, and yes I just solved it by creating panels, and I am
happy, but I still think we should have it if it's not much work,
maybe not as panel, maybe we add new container to the API.

@Laurent, yes it's a dreamweaver point of view, one file for HTML and
that's all.

@Igor, If I get you right, It's not the Java code that I want to be in
the same file, it's the HTML.

I was thinking something like


//---------- Page HTML ----------

<span wicket:id="lst_students">

<wicket:innerPanel class="InfoRow">
<tr>
    <td><span wicket:id="code">0001</span></td>
    <td><span wicket:id="name">Ali</span></td>
    <td><span wicket:id="age">12</span></td>
</tr>
</wicket:innerPanel>

<wicket:innerPanel class="EditRow">
<form wicket:id="frm_student">
<tr>
    <td><span wicket:id="code">0001</span></td>
    <td><input type="text" wicket:id="name"/></td>
    <td><span wicket:id="age">12</span></td>
</tr>
</form>
</wicket:innerPanel>

</span>

//---------- Page Class ----------

ListView lst_students = new ListView("lst_students",students)
{
    protected void populateItem(ListItem item) {

        if(edit)
        {
              item.add(new EditRow("editRow",item.getModel()));
        }
        else
        {
             item.add(new EditRow("editRow",item.getModel()));
        }

    }
}


Where EditRow and InfoRow are classes (inner or not) that extends InnerPanel.

Regards, Ali



On 1/11/06, Laurent PETIT <[EMAIL PROTECTED]> wrote:
> Nevermind,
>
> As Ali wants to be able to reuse the "panel" markup for one or many
> instances of Panel subclasses (in order to be embedded in a loop ...),
> I think we can't use a border (or the border should be positioned as
> the item inside the marker for the loop, but it's a less general use
> case than what he expected).
>
>
>
> On 1/11/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > because border is meant to /wrap/ things not replace them.
> >
> > -Igor
> >
> >
> >
> > On 1/11/06, Laurent PETIT <[EMAIL PROTECTED] > wrote:
> > >
> > > Euuuhh,
> > >
> > > and why not just subclass Border ?
> > >
> > > On 1/11/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
> > > > if the panels are not meant to be shared make them a private static
> > class
> > > > and use the parent$inner.html syntax to define html files like karthik
> > > > mentioned.
> > > >
> > > > i dont know if we need such a syntactic sugar in wicket, because then we
> > > > need to start looking in multiple places to find a problem. ie look for
> > a
> > > > separate markup file first, then if its not found look in the main
> > markup
> > > > file. but what if the panel is reusable? then you need to start looking
> > in
> > > > markup of multiple pages to find the panel markup. and what about
> > override
> > > > rules: if the panel has a separate markup file AND the page provdes a
> > markup
> > > > for it?
> > > >
> > > > yes it is inconvinient in certain situations. i have also written panels
> > > > like what you are describing and it was a pain in the ass. but
> > personally i
> > > > dont want to trade that for clarity.
> > > >
> > > > maybe a better way might be to create an InlinePanel class that does not
> > > > extend from Panel if we decide to do anything about this.
> > > >
> > > >
> > > > -Igor
> > > >
> > > >
> > > >
> > > >  On 1/11/06, Laurent PETIT < [EMAIL PROTECTED]> wrote:
> > > > >
> > > > > If I understand well,
> > > > >
> > > > > what you want is, say, starting from a big Page, made of only 1 html
> > > > > markup file and 1 java class, and first start to decompose the big
> > > > > java class into smaller units (1 Page and 0..n Panels), but still not
> > > > > decompose the html markup at that time.
> > > > > And so being able to reference different parts of the same html markup
> > > > > file from different java classes.
> > > > >
> > > > > Am I right ?
> > > > >
> > > > > I can see a use case for this. Indeed it helps reducing complexity by
> > > > > making java Component composition, but indeed, sometimes, it is a
> > > > > shame to have to manage several html files (in case that the panels
> > > > > are not yet to be shared with other pages) : no more consistency in a
> > > > > pure html editor such as Dreamweaver.
> > > > >
> > > > >
> > > > >
> > > > > On 1/11/06, Ali Zaid <[EMAIL PROTECTED]> wrote:
> > > > > > Well, I agree with you on that, I do like the way that we define
> > panel
> > > > > > now, but look at it this way, in my current application, I have HTML
> > > > > > file, and then I copy that file 4-5 times and start define panels,
> > > > > > rename these files and create classes for them, for some it doesn't
> > > > > > worth it, like a simple form with one field.
> > > > > >
> > > > > > I know it sound like a lazy guy talking, but it's not just about
> > work,
> > > > > > it can also help organizing code (HTML wise), since you have all the
> > > > > > elements in one file. for HTML + Javascript it worth it.
> > > > > >
> > > > > > tell me if I started to sound non-sense.
> > > > > >
> > > > > > Regards, Ali
> > > > > >
> > > > > > On 1/11/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > > > > > > So what you basically want is a panel but defined in the same
> > file,
> > > > like:
> > > > > > >
> > > > > > > <html>
> > > > > > >   blah
> > > > > > > </html>
> > > > > > > <wicket:panel>
> > > > > > >   boo
> > > > > > > </wicket:panel>
> > > > > > >
> > > > > > > Where of course the panel should have some kind of id as there
> > might
> > > > > > > be more of them? Personally, I think that you lose clarity oposed
> > to
> > > > > > > having seperate files for the panel. And we would lose clarity on
> > what
> > > > > > > the best way of doing things is, as there would then be two
> > different
> > > > > > > ways of specifying a panel.
> > > > > > >
> > > > > > > Eelco
> > > > > > >
> > > > > > >
> > > > > > > On 1/11/06, Ali Zaid <[EMAIL PROTECTED]> wrote:
> > > > > > > > ingram;
> > > > > > > >
> > > > > > > > Thanks, I know that I can use WebMarkupContainer, but I can't
> > reuse
> > > > it
> > > > > > > > in the same page more than once, incase of Listview for example,
> > > > when
> > > > > > > > I say I don't want to reuse it I should have clearified that I
> > don't
> > > > > > > > want to reuse in anothe page.
> > > > > > > >
> > > > > > > > I did mention I can use WebMarkupContainer in my first post,
> > anyway,
> > > > I
> > > > > > > > think my question is more into the lazy part than the practical
> > > > part.
> > > > > > > >
> > > > > > > > Thanks for the reply.
> > > > > > > >
> > > > > > > > Regards, Ali
> > > > > > > >
> > > > > > > >
> > > > > > > > On 1/11/06, Ingram Chen < [EMAIL PROTECTED]> wrote:
> > > > > > > > > You don't need to use Panel if you don't want to reuse it.
> > > > > > > > >
> > > > > > > > > try WebMarkupContainer:
> > > > > > > > >
> > > > > > > > > <html>
> > > > > > > > > <body>
> > > > > > > > > <div class="ShowInfo" wicket:id="showInfo">
> > > > > > > > >         ...Markup
> > > > > > > > >  </div>
> > > > > > > > > <div class="EditInfo" wicket:id=''editInfo">
> > > > > > > > >         ...Markup
> > > > > > > > > </div>
> > > > > > > > > </body>
> > > > > > > > > </html>
> > > > > > > > >
> > > > > > > > > and in Your page:
> > > > > > > > >
> > > > > > > > > public class InfoPage extends WebPage {
> > > > > > > > >
> > > > > > > > >       public InfoPage() {
> > > > > > > > >          WebMarkupContainer showInfo = new
> > > > WebMarkupContainer("showInfo") {
> > > > > > > > >                public boolean isVisible() {
> > > > > > > > >                     return ! isEdit();
> > > > > > > > >                }
> > > > > > > > >          };
> > > > > > > > >           showInfo.add(...some component for show...) ;
> > > > > > > > >          add(showInfo);
> > > > > > > > >
> > > > > > > > >          WebMarkupContainer editInfo = new
> > > > WebMarkupContainer("editInfo") {
> > > > > > > > >                 public boolean isVisible() {
> > > > > > > > >                      return isEdit();
> > > > > > > > >                 }
> > > > > > > > >           };
> > > > > > > > >           editInfo.add(...some component for edit...) ;
> > > > > > > > >          add(editInfo);
> > > > > > > > >
> > > > > > > > >       }
> > > > > > > > >
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On 1/11/06, Ali Zaid <[EMAIL PROTECTED]> wrote:
> > > > > > > > > >
> > > > > > > > > > that's a different file
> > > > > > > > > >
> > > > > > > > > > What I want to do is to place the
> > > > > > > > > >
> > > > > > > > > > <wicket:panel>
> > > > > > > > > >         ...Markup
> > > > > > > > > > </wicket:panel>
> > > > > > > > > >
> > > > > > > > > > inside the page that use it, ok I know that this will harm
> > the
> > > > > > > > > > reusablitity, but sometimes you don't need reusability...
> > > > > > > > > >
> > > > > > > > > > I kinda want something like
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > <html>
> > > > > > > > > > <body>
> > > > > > > > > >
> > > > > > > > > > <span wicket:id="info"/>
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > <wicket:panel class="ShowInfo">
> > > > > > > > > >         ...Markup
> > > > > > > > > > </wicket:panel>
> > > > > > > > > >
> > > > > > > > > > <wicket:panel class="EditInfo">
> > > > > > > > > >         ...Markup
> > > > > > > > > > </wicket:panel>
> > > > > > > > > >
> > > > > > > > > > </body>
> > > > > > > > > > </html>
> > > > > > > > > >
> > > > > > > > > > So when wicket see panels difinisions inside the page it
> > just
> > > > don't
> > > > > > > > > > render them, but it uses them to render "info" component.
> > > > > > > > > >
> > > > > > > > > > To be honest, I'm kinda againest what I'm asking for :), but
> > I
> > > > think
> > > > > > > > > > it can have a use sometimes, specially in design time.
> > > > > > > > > >
> > > > > > > > > > Regards, Ali
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > On 1/11/06, karthik Guru < [EMAIL PROTECTED]> wrote:
> > > > > > > > > > > Am a newbie, so i might be wrong. But if i understand your
> > > > problem
> > > > > > > > > > > correctly, you need to name the markup
> > YourPage$YourPanel.html
> > > > and place
> > > > > > > > > it
> > > > > > > > > > > in the same package.
> > > > > > > > > > >
> > > > > > > > > > > On 1/11/06, Ali Zaid < [EMAIL PROTECTED] > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Hi;
> > > > > > > > > > > >
> > > > > > > > > > > > I was wondering if I can define a panel inside a page,
> > let
> > > > me explain:
> > > > > > > > > > > >
> > > > > > > > > > > > Say I was develping a page that shows different panel
> > > > depending on
> > > > > > > > > > > > whatever :), so if whatever is true it show panel01 if
> > false
> > > > panel02.
> > > > > > > > > > > > Now, the way to do it (or how I know to do it) is to
> > have
> > > > the page,
> > > > > > > > > > > > with a span that say where the panel go, and have 2
> > markup
> > > > files that
> > > > > > > > > > > > define the 2 panels in seperate files. say I want to
> > tell
> > > > wiicket to
> > > > > > > > > > > > look for this markup inside the page, is there a way?
> > > > > > > > > > > >
> > > > > > > > > > > > I know this can also be solved by markup container, but
> > what
> > > > I really
> > > > > > > > > > > > want to use this for is a table that show some info and
> > when
> > > > the row
> > > > > > > > > > > > is clicked it show a  form to change this info.
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > Regards, Ali
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > >
> > > > -------------------------------------------------------
> > > > > > > > > > > > This SF.net email is sponsored by: Splunk Inc. Do you
> > grep
> > > > through log
> > > > > > > > > > > files
> > > > > > > > > > > > for problems?  Stop!  Download the new AJAX search
> > engine
> > > > that makes
> > > > > > > > > > > > searching your log files as easy as surfing the  web.
> > > > DOWNLOAD
> > > > > > > > > SPLUNK!
> > > > > > > > > > > >
> > > > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > > > > > > > > > > >
> > > > _______________________________________________
> > > > > > > > > > > > Wicket-user mailing list
> > > > > > > > > > > > Wicket-user@lists.sourceforge.net
> > > > > > > > > > > >
> > > > > > > > >
> > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Regards, Ali
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > -------------------------------------------------------
> > > > > > > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep
> > > > through log
> > > > > > > > > files
> > > > > > > > > > for problems?  Stop!  Download the new AJAX search engine
> > that
> > > > makes
> > > > > > > > > > searching your log files as easy as surfing the  web.
> > DOWNLOAD
> > > > SPLUNK!
> > > > > > > > > >
> > > > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > > > > > > > > >
> > _______________________________________________
> > > > > > > > > > Wicket-user mailing list
> > > > > > > > > > Wicket-user@lists.sourceforge.net
> > > > > > > > > >
> > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Ingram Chen
> > > > > > > > > Java [EMAIL PROTECTED]
> > > > > > > > > Institue of BioMedical Sciences Academia Sinica Taiwan
> > > > > > > > > blog:
> > > > http://www.javaworld.com.tw/roller/page/ingramchen
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Regards, Ali
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > -------------------------------------------------------
> > > > > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep
> > through
> > > > log files
> > > > > > > > for problems?  Stop!  Download the new AJAX search engine that
> > makes
> > > > > > > > searching your log files as easy as surfing the  web.  DOWNLOAD
> > > > SPLUNK!
> > > > > > > >
> > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > > > > > > > _______________________________________________
> > > > > > > > Wicket-user mailing list
> > > > > > > > Wicket-user@lists.sourceforge.net
> > > > > > > >
> > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > -------------------------------------------------------
> > > > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through
> > log
> > > > files
> > > > > > > for problems?  Stop!  Download the new AJAX search engine that
> > makes
> > > > > > > searching your log files as easy as surfing the  web.  DOWNLOAD
> > > > SPLUNK!
> > > > > > >
> > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > > > > > > _______________________________________________
> > > > > > > Wicket-user mailing list
> > > > > > > Wicket-user@lists.sourceforge.net
> > > > > > >
> > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Regards, Ali
> > > > > >
> > > > > >
> > > > > >
> > -------------------------------------------------------
> > > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through
> > log
> > > > files
> > > > > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > > > > searching your log files as easy as surfing the  web.  DOWNLOAD
> > SPLUNK!
> > > > > > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > > > > > _______________________________________________
> > > > > > Wicket-user mailing list
> > > > > > Wicket-user@lists.sourceforge.net
> > > > > >
> > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > > >
> > > > >
> > > > >
> > > > >
> > -------------------------------------------------------
> > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > > > files
> > > > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > > > searching your log files as easy as surfing the  web.  DOWNLOAD
> > SPLUNK!
> > > > > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > > > > _______________________________________________
> > > > > Wicket-user mailing list
> > > > > Wicket-user@lists.sourceforge.net
> > > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > >
> > > >
> > > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > files
> > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> > > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > > _______________________________________________
> > > Wicket-user mailing list
> > > Wicket-user@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> >
> >
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


--
Regards, Ali


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to