You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Tobias Neubert (JIRA)" <my...@incubator.apache.org> on 2005/04/28 14:04:27 UTC

[jira] Created: (MYFACES-219) JSCookMenu as child of a form

JSCookMenu  as child of a form
------------------------------

         Key: MYFACES-219
         URL: http://issues.apache.org/jira/browse/MYFACES-219
     Project: MyFaces
        Type: New Feature
    Versions: 1.0.9 beta    
 Environment: Windows XP, Tomcat 5.0.28
    Reporter: Tobias Neubert
    Priority: Minor


The HtmlCommandJSCookMenu component renders its own html-form called linkDummyForm. If it is embedded into another form the other form (including its children) will never be decoded because its submitted-property is set to false in UIForm.decode().

It should be possible to control wether the HtmlCommandJSCookMenu component should render its own form or should be part of an existing form.

In my application I developed a solution for this problem.

1. The HtmlJSCookMenuTag needs a new property, which holds the id of the form which is the parent of this tag. I called it formId. This new property has to be added in HtmlJSCookMenuTag.setProperties().

2. The HtmlCommandJSCookMenu component needs the formId property, described in step 1, aswell. And it has to be added to saveState() and restoreState()

3. The HtmlJSCookMenuRenderer has to read the formId of its component. 

3.1 If it is not set everything stays as it is in the moment. That means: DummyFormResponseWriter.writeDummyForm is set to true, which causes the writer to append a linkDummyForm at the end of the rendered html page.

3.2 If it is set writeDummyForm of DummyFormResponseWriter is set to false. Instead of rendering a form (called linkDummyForm) at the end of the rendered html page, there are only two input-fields, which will be rendered within HtmlJSCookMenuRenderer.encodeChildren(): jscook_action, which holds the choosed actionstring from the menu (in the moment it is rendered as part of the linkDummyForm only) and a new field named jscook_form_id which gets the formId of the HtmlCommandJSCookMenu component.

4. The cmItemMouseUp function within the JavaScript library named JSCookMenu.js needs to read the jscook_form_id field, rendered previously in step 3.2 like this:
-------begin code--------------------------------------------
var formId = null;
var dummyForm = null;
var inputFormIds = document.getElementsByName('jscook_form_id');
if (inputFormIds.length > 0) {
  formId = inputFormIds[0].value;
  dummyForm = document.forms[formId];
} else {
  dummyForm = document.forms['linkDummyForm'];
}
	
dummyForm.elements['jscook_action'].value = link;
dummyForm.submit();
------------end code-------------------------

5. Moreover it is needed to configure the immediate attribute of the component in the HtmlJSCookMenuTag. In the moment it is hardcoded in HtmlCommandJSCookMenu. There exists another issue here in the database concerning this point.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MYFACES-219) JSCookMenu as child of a form

Posted by "sean schofield (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-219?page=all ]

sean schofield updated MYFACES-219:
-----------------------------------

    Fix Version: Nightly Build
    Description: 
The HtmlCommandJSCookMenu component renders its own html-form called linkDummyForm. If it is embedded into another form the other form (including its children) will never be decoded because its submitted-property is set to false in UIForm.decode().

It should be possible to control wether the HtmlCommandJSCookMenu component should render its own form or should be part of an existing form.

In my application I developed a solution for this problem.

1. The HtmlJSCookMenuTag needs a new property, which holds the id of the form which is the parent of this tag. I called it formId. This new property has to be added in HtmlJSCookMenuTag.setProperties().

2. The HtmlCommandJSCookMenu component needs the formId property, described in step 1, aswell. And it has to be added to saveState() and restoreState()

3. The HtmlJSCookMenuRenderer has to read the formId of its component. 

3.1 If it is not set everything stays as it is in the moment. That means: DummyFormResponseWriter.writeDummyForm is set to true, which causes the writer to append a linkDummyForm at the end of the rendered html page.

3.2 If it is set writeDummyForm of DummyFormResponseWriter is set to false. Instead of rendering a form (called linkDummyForm) at the end of the rendered html page, there are only two input-fields, which will be rendered within HtmlJSCookMenuRenderer.encodeChildren(): jscook_action, which holds the choosed actionstring from the menu (in the moment it is rendered as part of the linkDummyForm only) and a new field named jscook_form_id which gets the formId of the HtmlCommandJSCookMenu component.

4. The cmItemMouseUp function within the JavaScript library named JSCookMenu.js needs to read the jscook_form_id field, rendered previously in step 3.2 like this:
-------begin code--------------------------------------------
var formId = null;
var dummyForm = null;
var inputFormIds = document.getElementsByName('jscook_form_id');
if (inputFormIds.length > 0) {
  formId = inputFormIds[0].value;
  dummyForm = document.forms[formId];
} else {
  dummyForm = document.forms['linkDummyForm'];
}
	
dummyForm.elements['jscook_action'].value = link;
dummyForm.submit();
------------end code-------------------------

5. Moreover it is needed to configure the immediate attribute of the component in the HtmlJSCookMenuTag. In the moment it is hardcoded in HtmlCommandJSCookMenu. There exists another issue here in the database concerning this point.

  was:
The HtmlCommandJSCookMenu component renders its own html-form called linkDummyForm. If it is embedded into another form the other form (including its children) will never be decoded because its submitted-property is set to false in UIForm.decode().

It should be possible to control wether the HtmlCommandJSCookMenu component should render its own form or should be part of an existing form.

In my application I developed a solution for this problem.

1. The HtmlJSCookMenuTag needs a new property, which holds the id of the form which is the parent of this tag. I called it formId. This new property has to be added in HtmlJSCookMenuTag.setProperties().

2. The HtmlCommandJSCookMenu component needs the formId property, described in step 1, aswell. And it has to be added to saveState() and restoreState()

3. The HtmlJSCookMenuRenderer has to read the formId of its component. 

3.1 If it is not set everything stays as it is in the moment. That means: DummyFormResponseWriter.writeDummyForm is set to true, which causes the writer to append a linkDummyForm at the end of the rendered html page.

3.2 If it is set writeDummyForm of DummyFormResponseWriter is set to false. Instead of rendering a form (called linkDummyForm) at the end of the rendered html page, there are only two input-fields, which will be rendered within HtmlJSCookMenuRenderer.encodeChildren(): jscook_action, which holds the choosed actionstring from the menu (in the moment it is rendered as part of the linkDummyForm only) and a new field named jscook_form_id which gets the formId of the HtmlCommandJSCookMenu component.

4. The cmItemMouseUp function within the JavaScript library named JSCookMenu.js needs to read the jscook_form_id field, rendered previously in step 3.2 like this:
-------begin code--------------------------------------------
var formId = null;
var dummyForm = null;
var inputFormIds = document.getElementsByName('jscook_form_id');
if (inputFormIds.length > 0) {
  formId = inputFormIds[0].value;
  dummyForm = document.forms[formId];
} else {
  dummyForm = document.forms['linkDummyForm'];
}
	
dummyForm.elements['jscook_action'].value = link;
dummyForm.submit();
------------end code-------------------------

5. Moreover it is needed to configure the immediate attribute of the component in the HtmlJSCookMenuTag. In the moment it is hardcoded in HtmlCommandJSCookMenu. There exists another issue here in the database concerning this point.


> JSCookMenu  as child of a form
> ------------------------------
>
>          Key: MYFACES-219
>          URL: http://issues.apache.org/jira/browse/MYFACES-219
>      Project: MyFaces
>         Type: New Feature
>     Versions: 1.0.9 beta
>  Environment: Windows XP, Tomcat 5.0.28
>     Reporter: Tobias Neubert
>     Assignee: Thomas Spiegl
>     Priority: Minor
>      Fix For: Nightly Build
>  Attachments: jscook.patch
>
> The HtmlCommandJSCookMenu component renders its own html-form called linkDummyForm. If it is embedded into another form the other form (including its children) will never be decoded because its submitted-property is set to false in UIForm.decode().
> It should be possible to control wether the HtmlCommandJSCookMenu component should render its own form or should be part of an existing form.
> In my application I developed a solution for this problem.
> 1. The HtmlJSCookMenuTag needs a new property, which holds the id of the form which is the parent of this tag. I called it formId. This new property has to be added in HtmlJSCookMenuTag.setProperties().
> 2. The HtmlCommandJSCookMenu component needs the formId property, described in step 1, aswell. And it has to be added to saveState() and restoreState()
> 3. The HtmlJSCookMenuRenderer has to read the formId of its component. 
> 3.1 If it is not set everything stays as it is in the moment. That means: DummyFormResponseWriter.writeDummyForm is set to true, which causes the writer to append a linkDummyForm at the end of the rendered html page.
> 3.2 If it is set writeDummyForm of DummyFormResponseWriter is set to false. Instead of rendering a form (called linkDummyForm) at the end of the rendered html page, there are only two input-fields, which will be rendered within HtmlJSCookMenuRenderer.encodeChildren(): jscook_action, which holds the choosed actionstring from the menu (in the moment it is rendered as part of the linkDummyForm only) and a new field named jscook_form_id which gets the formId of the HtmlCommandJSCookMenu component.
> 4. The cmItemMouseUp function within the JavaScript library named JSCookMenu.js needs to read the jscook_form_id field, rendered previously in step 3.2 like this:
> -------begin code--------------------------------------------
> var formId = null;
> var dummyForm = null;
> var inputFormIds = document.getElementsByName('jscook_form_id');
> if (inputFormIds.length > 0) {
>   formId = inputFormIds[0].value;
>   dummyForm = document.forms[formId];
> } else {
>   dummyForm = document.forms['linkDummyForm'];
> }
> 	
> dummyForm.elements['jscook_action'].value = link;
> dummyForm.submit();
> ------------end code-------------------------
> 5. Moreover it is needed to configure the immediate attribute of the component in the HtmlJSCookMenuTag. In the moment it is hardcoded in HtmlCommandJSCookMenu. There exists another issue here in the database concerning this point.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MYFACES-219) JSCookMenu as child of a form

Posted by "Jason Kissinger (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-219?page=all ]

Jason Kissinger updated MYFACES-219:
------------------------------------

    Attachment: jscook.patch

Patch which adds formId attribute to x:jscookMenu of an optional form which contains this menu.  Defaults to using the dummy form as before.  I modified generated code since I didn't have time to figure out the code generation feature.

Thanks to Tobias for the code.

> JSCookMenu  as child of a form
> ------------------------------
>
>          Key: MYFACES-219
>          URL: http://issues.apache.org/jira/browse/MYFACES-219
>      Project: MyFaces
>         Type: New Feature
>     Versions: 1.0.9 beta
>  Environment: Windows XP, Tomcat 5.0.28
>     Reporter: Tobias Neubert
>     Priority: Minor
>  Attachments: jscook.patch
>
> The HtmlCommandJSCookMenu component renders its own html-form called linkDummyForm. If it is embedded into another form the other form (including its children) will never be decoded because its submitted-property is set to false in UIForm.decode().
> It should be possible to control wether the HtmlCommandJSCookMenu component should render its own form or should be part of an existing form.
> In my application I developed a solution for this problem.
> 1. The HtmlJSCookMenuTag needs a new property, which holds the id of the form which is the parent of this tag. I called it formId. This new property has to be added in HtmlJSCookMenuTag.setProperties().
> 2. The HtmlCommandJSCookMenu component needs the formId property, described in step 1, aswell. And it has to be added to saveState() and restoreState()
> 3. The HtmlJSCookMenuRenderer has to read the formId of its component. 
> 3.1 If it is not set everything stays as it is in the moment. That means: DummyFormResponseWriter.writeDummyForm is set to true, which causes the writer to append a linkDummyForm at the end of the rendered html page.
> 3.2 If it is set writeDummyForm of DummyFormResponseWriter is set to false. Instead of rendering a form (called linkDummyForm) at the end of the rendered html page, there are only two input-fields, which will be rendered within HtmlJSCookMenuRenderer.encodeChildren(): jscook_action, which holds the choosed actionstring from the menu (in the moment it is rendered as part of the linkDummyForm only) and a new field named jscook_form_id which gets the formId of the HtmlCommandJSCookMenu component.
> 4. The cmItemMouseUp function within the JavaScript library named JSCookMenu.js needs to read the jscook_form_id field, rendered previously in step 3.2 like this:
> -------begin code--------------------------------------------
> var formId = null;
> var dummyForm = null;
> var inputFormIds = document.getElementsByName('jscook_form_id');
> if (inputFormIds.length > 0) {
>   formId = inputFormIds[0].value;
>   dummyForm = document.forms[formId];
> } else {
>   dummyForm = document.forms['linkDummyForm'];
> }
> 	
> dummyForm.elements['jscook_action'].value = link;
> dummyForm.submit();
> ------------end code-------------------------
> 5. Moreover it is needed to configure the immediate attribute of the component in the HtmlJSCookMenuTag. In the moment it is hardcoded in HtmlCommandJSCookMenu. There exists another issue here in the database concerning this point.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MYFACES-219) JSCookMenu as child of a form

Posted by "Martin Marinschek (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-219?page=all ]
     
Martin Marinschek closed MYFACES-219:
-------------------------------------

    Resolution: Duplicate
     Assign To: Martin Marinschek  (was: Thomas Spiegl)

This is a duplicate of MYFACES-27. Please continue the discussion there, as some more information has been added to that thread.

> JSCookMenu  as child of a form
> ------------------------------
>
>          Key: MYFACES-219
>          URL: http://issues.apache.org/jira/browse/MYFACES-219
>      Project: MyFaces
>         Type: New Feature
>     Versions: 1.0.9m9
>  Environment: Windows XP, Tomcat 5.0.28
>     Reporter: Tobias Neubert
>     Assignee: Martin Marinschek
>     Priority: Minor
>      Fix For: Nightly Build
>  Attachments: jscook.patch
>
> The HtmlCommandJSCookMenu component renders its own html-form called linkDummyForm. If it is embedded into another form the other form (including its children) will never be decoded because its submitted-property is set to false in UIForm.decode().
> It should be possible to control wether the HtmlCommandJSCookMenu component should render its own form or should be part of an existing form.
> In my application I developed a solution for this problem.
> 1. The HtmlJSCookMenuTag needs a new property, which holds the id of the form which is the parent of this tag. I called it formId. This new property has to be added in HtmlJSCookMenuTag.setProperties().
> 2. The HtmlCommandJSCookMenu component needs the formId property, described in step 1, aswell. And it has to be added to saveState() and restoreState()
> 3. The HtmlJSCookMenuRenderer has to read the formId of its component. 
> 3.1 If it is not set everything stays as it is in the moment. That means: DummyFormResponseWriter.writeDummyForm is set to true, which causes the writer to append a linkDummyForm at the end of the rendered html page.
> 3.2 If it is set writeDummyForm of DummyFormResponseWriter is set to false. Instead of rendering a form (called linkDummyForm) at the end of the rendered html page, there are only two input-fields, which will be rendered within HtmlJSCookMenuRenderer.encodeChildren(): jscook_action, which holds the choosed actionstring from the menu (in the moment it is rendered as part of the linkDummyForm only) and a new field named jscook_form_id which gets the formId of the HtmlCommandJSCookMenu component.
> 4. The cmItemMouseUp function within the JavaScript library named JSCookMenu.js needs to read the jscook_form_id field, rendered previously in step 3.2 like this:
> -------begin code--------------------------------------------
> var formId = null;
> var dummyForm = null;
> var inputFormIds = document.getElementsByName('jscook_form_id');
> if (inputFormIds.length > 0) {
>   formId = inputFormIds[0].value;
>   dummyForm = document.forms[formId];
> } else {
>   dummyForm = document.forms['linkDummyForm'];
> }
> 	
> dummyForm.elements['jscook_action'].value = link;
> dummyForm.submit();
> ------------end code-------------------------
> 5. Moreover it is needed to configure the immediate attribute of the component in the HtmlJSCookMenuTag. In the moment it is hardcoded in HtmlCommandJSCookMenu. There exists another issue here in the database concerning this point.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MYFACES-219) JSCookMenu as child of a form

Posted by "sean schofield (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-219?page=all ]

sean schofield updated MYFACES-219:
-----------------------------------

    Fix Version: Nightly Build
                     (was: 1.0.10m10)

> JSCookMenu  as child of a form
> ------------------------------
>
>          Key: MYFACES-219
>          URL: http://issues.apache.org/jira/browse/MYFACES-219
>      Project: MyFaces
>         Type: New Feature
>     Versions: 1.0.9m9
>  Environment: Windows XP, Tomcat 5.0.28
>     Reporter: Tobias Neubert
>     Assignee: Thomas Spiegl
>     Priority: Minor
>      Fix For: Nightly Build
>  Attachments: jscook.patch
>
> The HtmlCommandJSCookMenu component renders its own html-form called linkDummyForm. If it is embedded into another form the other form (including its children) will never be decoded because its submitted-property is set to false in UIForm.decode().
> It should be possible to control wether the HtmlCommandJSCookMenu component should render its own form or should be part of an existing form.
> In my application I developed a solution for this problem.
> 1. The HtmlJSCookMenuTag needs a new property, which holds the id of the form which is the parent of this tag. I called it formId. This new property has to be added in HtmlJSCookMenuTag.setProperties().
> 2. The HtmlCommandJSCookMenu component needs the formId property, described in step 1, aswell. And it has to be added to saveState() and restoreState()
> 3. The HtmlJSCookMenuRenderer has to read the formId of its component. 
> 3.1 If it is not set everything stays as it is in the moment. That means: DummyFormResponseWriter.writeDummyForm is set to true, which causes the writer to append a linkDummyForm at the end of the rendered html page.
> 3.2 If it is set writeDummyForm of DummyFormResponseWriter is set to false. Instead of rendering a form (called linkDummyForm) at the end of the rendered html page, there are only two input-fields, which will be rendered within HtmlJSCookMenuRenderer.encodeChildren(): jscook_action, which holds the choosed actionstring from the menu (in the moment it is rendered as part of the linkDummyForm only) and a new field named jscook_form_id which gets the formId of the HtmlCommandJSCookMenu component.
> 4. The cmItemMouseUp function within the JavaScript library named JSCookMenu.js needs to read the jscook_form_id field, rendered previously in step 3.2 like this:
> -------begin code--------------------------------------------
> var formId = null;
> var dummyForm = null;
> var inputFormIds = document.getElementsByName('jscook_form_id');
> if (inputFormIds.length > 0) {
>   formId = inputFormIds[0].value;
>   dummyForm = document.forms[formId];
> } else {
>   dummyForm = document.forms['linkDummyForm'];
> }
> 	
> dummyForm.elements['jscook_action'].value = link;
> dummyForm.submit();
> ------------end code-------------------------
> 5. Moreover it is needed to configure the immediate attribute of the component in the HtmlJSCookMenuTag. In the moment it is hardcoded in HtmlCommandJSCookMenu. There exists another issue here in the database concerning this point.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira