Hi,

I am seeing this strange behavior where despite setting the model for the
panel in the constructor when accessed as panel.getModelObject() in the page
containing the panel, I am getting model as null and hence getting
NullPointerException.

Here is an excerpt 
public class AddressPanel
{
.....
public AddressPanel(String id, ADDRESS_PURPOSE_TYPE_ID addrType, String
contactMechId, String partyId, 
            String appendId, boolean readOnly)
    {
        super(id);
        
        if (addrType != null)
            _addressType = addrType;
        _addressMap = ContactMechWorkerEx.getPostalAddressExByPk(null,
contactMechId, 
                _addressType);
        setModel(new Model(_addressMap));
        LOG.info("=============> ****** setting the model " + _addressMap);
        _readOnly = readOnly;
        _partyId = partyId;
        _appendId = appendId;
        populate();
    }
...
}


Containing page...

public class UserRegistrationPage
    extends BasePage
{
    private static final Logger LOG =
LoggerFactory.getLogger(UserRegistrationPage.class);

    public UserRegistrationPage()
    {
        super();
        populate();
    }

    /**
     * Populates the page
     */
    public void populate()
    {
        // Initialize all the constituent panels
        add(new FeedbackPanel("feedback", new
ComponentFeedbackMessageFilter(UserRegistrationPage.this)));
        final UserLoginInfoPanel userLoginInfoPanel = new
UserLoginInfoPanel("userLoginInfoPanel", "");
        final ContactInfoPanel userContactInfoPanel = new
ContactInfoPanel("userContactInfoPanel", (String) null);
        final AddressPanel shippingAddressPanel = new
AddressPanel("shippingAddressPanel",
                ADDRESS_PURPOSE_TYPE_ID.SHIPPING_LOCATION, null, null, "1",
false);
...

Note that each panels have their own forms and the page has an outer form
which contains individual panels nested forms. It used to work just fine a
day ago - obviously I modified something which caused it to not work. 

Will appreciate any feedback.
-- 
View this message in context: 
http://www.nabble.com/Strange-behavior-on-panel-model-tp17504380p17504380.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to