You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Marat Radchenko (JIRA)" <ji...@apache.org> on 2010/01/18 14:35:54 UTC

[jira] Created: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Provide a way to disable "Child component  has a non-safe child id"
-------------------------------------------------------------------

                 Key: WICKET-2684
                 URL: https://issues.apache.org/jira/browse/WICKET-2684
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 1.4.5
            Reporter: Marat Radchenko


AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.

One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.

That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802918#action_12802918 ] 

Igor Vaynberg commented on WICKET-2684:
---------------------------------------

how is that fragile?

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804058#action_12804058 ] 

Marat Radchenko commented on WICKET-2684:
-----------------------------------------

> or use a low-level repeater where you have total control - RepeatingView 
Great! We finally got to the point :) RepeatingView is _subclass of AbstractRepeater_ whose onBeforeRender is producing warning!

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801862#action_12801862 ] 

Juergen Donnerstag commented on WICKET-2684:
--------------------------------------------

In 1.5 any restriction on child component ids has been removed, except they have to be unique for the container. That was possible because of the changes to the render process.

I need to look into 1.4 to evaluate the options

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804119#action_12804119 ] 

Igor Vaynberg commented on WICKET-2684:
---------------------------------------

the check is there for a reason and will not be removed in 1.4. you will have to stick with the first option i mentioned.

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2684.
-----------------------------------

    Resolution: Invalid

yes, you can. and it is. look at my explanation. the index is translated into the model which is in turn translated into the PK. how do you think thousands of other people use wicket with databases without messing with repeater ids? or do all wicket apps out there suffer from concurrency issues where pressing a delete button deletes the wrong thing?

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2684.
-----------------------------------

    Resolution: Invalid
      Assignee: Igor Vaynberg

>One of examples is user list with login acting as primary key on a stateless page. 
>Relying on index is fragile because users can be added/deleted by other requests,
> so i want to use user login as repeater child ids, however it triggers warning. 

this doesnt make any sense. users being added/removed from the database does not affect this at all. the flow is like this:

1) user clicks delete link #10.
2) wicket finds delete link #10 and invokes onsubmit
3) inside onsubmit user does: service.delete(getmodel().getobject())

it is the model assigned to link that contains the PK of the user, the PK does not come from the index of the link.

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804041#action_12804041 ] 

Igor Vaynberg commented on WICKET-2684:
---------------------------------------

404 may be acceptable in your particular app, but users of my backend would be highly perplexed if all of a sudden they saw a generic 404 when clicking an edit link.

if you use stateless pages and stateless links to do this sort of thing then you know the risks.

> After all, it's not wicket business what ids i assign to my components

it is ListViews, and all other components that do this, job to assign the ids and make sure they are unique. the fact that these ids even exist is an internal implementation detail.

> (and actually nothing in wicket depends on them being numeric).

not true. maybe not in 1.5 with Juergen's changes, but in 1.4 afair there are places that check that id is purely numeric and if it is it is assumed to be assigned to a wicket-created component representing an item inside a repeater. once again an implementation detail.

you want more control?  you have two options: use a bookmarkable link or use a low-level repeater where you have total control - RepeatingView


> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804039#action_12804039 ] 

Marat Radchenko commented on WICKET-2684:
-----------------------------------------

404 is acceptable behavior on the web because you always see outdated page (as it was when it was rendered). However, deleting wrong entries isn't acceptable.

After all, it's not wicket business what ids i assign to my components (and actually nothing in wicket depends on them being numeric).

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804130#action_12804130 ] 

Marat Radchenko commented on WICKET-2684:
-----------------------------------------

I don't ask to remove that check. I ask to provide a way to suppress it for particular component.
Like, protected boolean warnIfNonNumericChild() { return true; }

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804131#action_12804131 ] 

Igor Vaynberg commented on WICKET-2684:
---------------------------------------

you do realize that if you use nonnumeric ids some things will break...

if you want to turn off the warning simply disable it in your logging configuration.

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804035#action_12804035 ] 

Marat Radchenko commented on WICKET-2684:
-----------------------------------------

> the index is translated into the model which is in turn translated into the PK
Translate 1-3 numbers into "ann", "john", "peter", please.
Also, don't forget that after you initially loaded a stateless page with user list (but before you clicked on a link inside repeater), "bob" registered.

> or do all wicket apps out there suffer from concurrency issues where pressing a delete button deletes the wrong thing?
All that do not use persistent object primary key as repeater child id.


> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marat Radchenko reopened WICKET-2684:
-------------------------------------


> wicket finds delete link #10 and invokes onsubmit 

That's what is fragile. I don't want it to be "link #10". I want it to be "link <username>". And actually it perfectly works, the only annoyance is warning that i have no way to suppress.

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Marat Radchenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803660#action_12803660 ] 

Marat Radchenko commented on WICKET-2684:
-----------------------------------------

> how is that fragile?

>From issue description: Relying on index is fragile because users can be added/deleted by other requests.

I can't guarantee that link with particular index will refer to same user when page is initially rendered and when it is submitted.

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2684) Provide a way to disable "Child component has a non-safe child id"

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804037#action_12804037 ] 

Igor Vaynberg commented on WICKET-2684:
---------------------------------------

so what happens if ann john and peter are rendered. then john is deleted and someone clicks a link associated with john? now wicket wont be able to find the component and you get a url error or a 404. not good.

moral of the story is to use a bookmarkable link and encode the pk into the url yourself.

> Provide a way to disable "Child component  has a non-safe child id"
> -------------------------------------------------------------------
>
>                 Key: WICKET-2684
>                 URL: https://issues.apache.org/jira/browse/WICKET-2684
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4.5
>            Reporter: Marat Radchenko
>            Assignee: Igor Vaynberg
>
> AbstractRepeater.onBeforeRender checks child component ids to be digit-only. While i (kinda) understand reasoning behind this behavior, it is sometimes not what i want.
> One of examples is user list with login acting as primary key on a stateless page. Relying on index is fragile because users can be added/deleted by other requests, so i want to use user login as repeater child ids, however it triggers warning.
> That check should be either disableable globally or on per-component basis (latter is more desired), so I can tell AbstractRepeater that i know what i'm doing and deliberately want non-numeric ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.