error in heritance

classic Classic list List threaded Threaded
18 messages Options
Gim
Reply | Threaded
Open this post in threaded view
|

error in heritance

Gim
 Hello!i´m doing a call to the son class, and and show the error:

WicketMessage: Base markup of inherited markup not found. Component class: com.consisint.frontend.pages.ThirdByRolPolicy Enable debug messages for org.apache.wicket.util.resource.Resource to get a list of all filenames tried.

Root cause:

org.apache.wicket.markup.MarkupNotFoundException: Base markup of inherited markup not found. Component class: com.consisint.frontend.pages.ThirdByRolPolicy Enable debug messages for org.apache.wicket.util.resource.Resource to get a list of all filenames tried.
at org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.checkForMarkupInheritance(InheritedMarkupMarkupLoader.java:98)
at org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:63)
at org.apache.wicket.markup.loader.DefaultMarkupLoader.loadMarkup(DefaultMarkupLoader.java:55)


 The classes is:

  public  class  ThirdByRolMain extends Panel {
    protected WebMarkupContainer wmc;
    protected Form formThird;
    protected   Object object;
    protected  DataView<ThirdModel> dataView;               // data table
    protected  SortableThirdProvider thirdProvider;   // data model
    protected  List<String> partAdds = new ArrayList<String>();
    protected  Label numberRowLabel;
    protected  FeedbackPanel feedback;
    public ThirdByRolMain(final String id,final Object object,final String idClass, final Role role,final boolean isClient,final Policy pol){


        super(id);
         System.out.println("id padreeeeee= " + id);
        wmc = new WebMarkupContainer( "wmc" ) {
            @Override
            public boolean isTransparentResolver()
            {
                return true;
            }};

        add(wmc);
       // formThird= new Form("form");
   
        this.object=object;
        WebMarkupContainer containerDetailSearch = new WebMarkupContainer("detailSearch");
        containerDetailSearch.setOutputMarkupId(true);
        add(containerDetailSearch);
}

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:wicket="http://www.w3.org/1999/XSL/Transform">
<head>
</head>
<body>
<wicket:panel>
    <div wicket:id="wmc"><wicket:child> </wicket:child></div>
    <div wicket:id="detailSearch"></div>
</wicket:panel>
</body>
</html>




public class ThirdByRolPolicy extends ThirdByRolMain{

    private ConfirmationAnswer  isSure;
    private ModalDialog dataBasicModalDialog,modalDialogSecurity;
    private boolean isEmpty=true;
    private ValueMap properties = new ValueMap();
    private String idThirdOld="";

    public ThirdByRolPolicy(final String id,final Object object,final String idClass, final Role role,final boolean isClient,final Policy pol){
       
        super(id, object,idClass,role, isClient, pol);
        Form formThird = new Form("thirdForm");
        wmc.add(formThird);

    }

}


<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:wicket="http://www.w3.org/1999/XSL/Transform">
<wicket:extend>
<form wicket:id="thirdForm"></form>
 </wicket:extend>
</html>



 Help me please, thank you!
Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

alex shubert
replace <wicket:extend>
with <wicket:panel>


--
Best regards
Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

alex shubert
Sorry, did'nt unfold your message. It looks like you forgot to insert
<wicket:child> in parent markup. That tags mark the place where
inherited component will be placed.

I hope I didnt miss anything now.

On 23 November 2010 15:55, alex shubert <[hidden email]> wrote:
> replace <wicket:extend>
> with <wicket:panel>
>
>
> --
> Best regards
> Alex
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Gim
Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

Gim
  Hello Alex, i´m using inheritance. See the cod. html of  class extend Panel:


 <?xml version="1.0" encoding="UTF-8"?>
<html xmlns:wicket="http://www.w3.org/1999/XSL/Transform">
<head>
</head>
<body>
<wicket:panel>
    <div wicket:id="wmc"><wicket:child> AQUI VA EL CHILD</wicket:child></div>
    <div wicket:id="detailSearch"></div>
</wicket:panel>
</body>
</html>


Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

alex shubert
That day is too long for me.
What about html files names? May be typo or incorrect place? Or maybe
you build script does not move html to the same packet as
corresponding java classes is?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

multilevel markup inheritance

Juraj Petko
In reply to this post by Gim
Hello,
   i am starting to explorer this beautifull framework and want to make a
big use of markup inheritance. What i can't do is to make a page3, which
markup inherits from page2 and at the same time page2 markup inherits
from page1. Am i doing something wrong, or there is no support for this?
thanks, juraj


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: multilevel markup inheritance

James Carman
Page/markup inheritance is supported.  Do you have code that isn't working?

On Tue, Nov 23, 2010 at 8:31 AM, Juraj Petko <[hidden email]> wrote:

> Hello,
>  i am starting to explorer this beautifull framework and want to make a
> big use of markup inheritance. What i can't do is to make a page3, which
> markup inherits from page2 and at the same time page2 markup inherits
> from page1. Am i doing something wrong, or there is no support for this?
> thanks, juraj
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: multilevel markup inheritance

Matthias Keller
In reply to this post by Juraj Petko
Hi juraj

Absolutely no problem, wicket can handle that just easily.
Let's assume you've got a BasePage (containing for example the HTML
header and the <body> tag), a LayoutPage (containing the main layout)
and a specific page (Page1):

BasePage.html :
<html>
<head>...</head>
<body>
<wicket:child>This will be replaced by LayoutPage</wicket:child>
</body>
</html>

LayoutPage.html :
<wicket:extend>
   ..layout stuff..
<wicket:child>This will be replaced by Page1</wicket:child>
   .. more layout stuff ..
</wicket:extend>

Page1.html :
<wicket:extend>
   .. Page1 stuff ..
</wicket:extend>

Matt

On 2010-11-23 14:31, Juraj Petko wrote:
> Hello,
>   i am starting to explorer this beautifull framework and want to make a
> big use of markup inheritance. What i can't do is to make a page3, which
> markup inherits from page2 and at the same time page2 markup inherits
> from page1. Am i doing something wrong, or there is no support for this?
> thanks, juraj



smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: multilevel markup inheritance

Andrea Del Bene-2
In reply to this post by Juraj Petko
No problem, it should work fine. Page inheritance is just like standard
class inheritance

> Hello,
>   i am starting to explorer this beautifull framework and want to make a
> big use of markup inheritance. What i can't do is to make a page3, which
> markup inherits from page2 and at the same time page2 markup inherits
> from page1. Am i doing something wrong, or there is no support for this?
> thanks, juraj
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: multilevel markup inheritance

Juraj Petko
In reply to this post by Matthias Keller
oki, now its working fine also multilevel,  thx


> Hi juraj
>
> Absolutely no problem, wicket can handle that just easily.
> Let's assume you've got a BasePage (containing for example the HTML
> header and the <body> tag), a LayoutPage (containing the main layout)
> and a specific page (Page1):
>
> BasePage.html :
> <html>
> <head>...</head>
> <body>
> <wicket:child>This will be replaced by LayoutPage</wicket:child>
> </body>
> </html>
>
> LayoutPage.html :
> <wicket:extend>
>   ..layout stuff..
> <wicket:child>This will be replaced by Page1</wicket:child>
>   .. more layout stuff ..
> </wicket:extend>
>
> Page1.html :
> <wicket:extend>
>   .. Page1 stuff ..
> </wicket:extend>
>
> Matt
>
> On 2010-11-23 14:31, Juraj Petko wrote:
>> Hello,
>>   i am starting to explorer this beautifull framework and want to make a
>> big use of markup inheritance. What i can't do is to make a page3, which
>> markup inherits from page2 and at the same time page2 markup inherits
>> from page1. Am i doing something wrong, or there is no support for this?
>> thanks, juraj
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Gim
Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

Gim
In reply to this post by alex shubert
 
  Alex, the class Base extend Panel (ThirdByRolMain) and the class Sub extend Base (ThirdByRolPolicy). The two class is in package com.consisint.frontend.pages.

 And the html in C:\programs\FrontEnd\FrontEnd\WebContent\views .

 Help me please, error:

WicketMessage: Base markup of inherited markup not found. Component class: com.consisint.frontend.pages.ThirdByRolPolicy Enable debug messages for org.apache.wicket.util.resource.Resource to get a list of all filenames tried.

Root cause:

org.apache.wicket.markup.MarkupNotFoundException: Base markup of inherited markup not found. Component class: com.consisint.frontend.pages.ThirdByRolPolicy Enable debug messages for org.apache.wicket.util.resource.Resource to get a list of all filenames tried.
at org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.checkForMarkupInheritance(InheritedMarkupMarkupLoader.java:98)
at org.apache.wicket.markup.loader.InheritedMarkupMarkupLoader.loadMarkup(InheritedMarkupMarkupLoader.java:63)
?


 Thank you Alex!
Gim
Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

Gim
  I´m use wicket 1.4.6!
Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

alex shubert
In reply to this post by Gim
Look, you have java classes in path like com\consisint\frontend\pages
and corresponding HTML in \FrontEnd\FrontEnd\WebContent\views

You have to have HTML files in the same folder where you compilled
classes are. Something like
$ls com\consisint\frontend\pages

ThirdByRolMain.class
ThirdByRolMain.html
ThirdByRolPolicy.class
ThirdByRolPolicy.html
Do ot and run you code again.

> The two class is in package  com.consisint.frontend.pages.
>
>  And the html in C:\programs\FrontEnd\FrontEnd\WebContent\views .

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

alex shubert
In reply to this post by Gim
take a look

In all the Wicket examples, you have to put all files in the same
package directory. This means putting the markup files and the java
files next to one another.
(c) http://wicket.apache.org/learn/examples/markupinheritance.html



--
Best regards
Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Gim
Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

Gim
   I done  the class to change the location:

  public class ConfigHtmlPath extends ResourceStreamLocator {

    /**
     * Constructor class
     */
    public ConfigHtmlPath() {
    }

    /**
     * Find the html resource in the dir especified
     * @param clazz class to localize
     * @param path path where the class is
     * @return  the new resource stream
     */
    public IResourceStream locate(Class<?> clazz, String path)
    {
        String location;
        String extension = path.substring(path.lastIndexOf('.') + 1);
        String simpleFileName = Strings.lastPathComponent(clazz.getName(), '.');
        location = "/views/" + simpleFileName + "." + extension;
        URL url;
        try
        {
            // try to load the resource from the web context
            url = WebApplication.get().getServletContext().getResource(location);
            if (url != null)
            {
                return new UrlResourceStream(url);
            }
        }
        catch (MalformedURLException e)
        {
            throw new WicketRuntimeException(e);
        }
        // resource not found; fall back on class loading
        return super.locate(clazz, path);
    }
}


 Thank you by reply! :)
Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

James Carman
It sounds like you're just getting started with Wicket.  Why are you
"rocking the boat" already?  Just put the markup where it belongs and
don't try messing with putting it elsewhere until you truly understand
what you're doing.

On Tue, Nov 23, 2010 at 9:26 AM, Alis <[hidden email]> wrote:

>
>   I done  the class to change the location:
>
>  public class ConfigHtmlPath extends ResourceStreamLocator {
>
>    /**
>     * Constructor class
>     */
>    public ConfigHtmlPath() {
>    }
>
>    /**
>     * Find the html resource in the dir especified
>     * @param clazz class to localize
>     * @param path path where the class is
>     * @return  the new resource stream
>     */
>    public IResourceStream locate(Class<?> clazz, String path)
>    {
>        String location;
>        String extension = path.substring(path.lastIndexOf('.') + 1);
>        String simpleFileName = Strings.lastPathComponent(clazz.getName(),
> '.');
>        location = "/views/" + simpleFileName + "." + extension;
>        URL url;
>        try
>        {
>            // try to load the resource from the web context
>            url =
> WebApplication.get().getServletContext().getResource(location);
>            if (url != null)
>            {
>                return new UrlResourceStream(url);
>            }
>        }
>        catch (MalformedURLException e)
>        {
>            throw new WicketRuntimeException(e);
>        }
>        // resource not found; fall back on class loading
>        return super.locate(clazz, path);
>    }
> }
>
>
>  Thank you by reply! :)
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/error-in-heritance-tp3055355p3055527.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Gim
Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

Gim
  James, please help me.  Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: error in heritance

James Carman
Create a quickstart and put it somewhere where we can get to it.
Then, someone will be able to help you easier.

On Tue, Nov 23, 2010 at 9:50 AM, Alis <[hidden email]> wrote:

>
>  James, please help me.  Thank you!
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/error-in-heritance-tp3055355p3055573.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]