Home » Eclipse Projects » JavaServer Faces » Where can I change the HostElement attribute value?
Where can I change the HostElement attribute value? [message #475029] |
Wed, 15 August 2007 23:44  |
Eclipse User |
|
|
|
Hi all:
I want to change some attribute value of the host element when converter
is working:
public Element doConvertRefresh(){
....
getHostElement().setAttribute("maxsize","80");
....
}
but when I change the attribute value,the attribute object will notify
the listener to refresh the host element tag,so
the doConvertRefresh method will be invoke agian...
Where can I change the HostElement attribute value?
Thanks !
|
|
| |
Re: Where can I change the HostElement attribute value? [message #475033 is a reply to message #475032] |
Thu, 16 August 2007 19:10   |
Eclipse User |
|
|
|
To add a little more information to my previous posting, typically you
would call createElement(String) to create a new Element, manipulate this
new Element's attributes, and ultimately return the new Element.
For example:
Element resultElement = createElement("input");
resultElement.setAttribute("type", "text");
resultElement.setAttribute("value",
getHostElement().getAttribute("value"));
resultElement.setAttribute("maxsize", "80");
return resultElement;
The method "getHostElement()" will return the source document's Element
that is being converted, and even if you could manipulate it from within
the tag converter, this would not affect the expected result of a tag
conversion.
Perhaps I do not understand what it is you are attempting to do in your
tag converter. Please feel free to elaborate further.
- Ian, JSF Tools Project
|
|
|
Re: Where can I change the HostElement attribute value? [message #475034 is a reply to message #475032] |
Thu, 16 August 2007 22:41   |
Eclipse User |
|
|
|
"Ian Trimble" <ian.trimble@oracle.com>
??????:24108ccc01065d107d035447a639b132$1@www.eclipse.org...
>I don't think I understand the use case. Why are you changing the "host"
>element within this method? The purpose of this method is to create and
>return the HTML Element that will be rendered by the Web Page Editor. If
>you are trying to change an Element in the source document, this is not the
>place to attempt it.
>
> - Ian, JSF Tools Project
>
Hi Ian:
Thank you for your help.
first, I show the use case follow:
when I show the some tag , the tag don't use the "style" attribute to
control its size but
only use the special attribute "width" or "height". It means that the
"style" attribute is useless .
So when user resize the host element by web page editor ,"style" attribute
value of the host element was changed,then
the special attribute "width" or "height" should be change .
You are right,The converter's purpose is ONLY convert the tag element to
html tag element,so I think that I should install new EditPoliy for the
special tag , then I can change the host element attribute value use by some
GEF commands when I can get the resize request by my EditPolicy , right?
|
|
| | | |
Re: Where can I change the HostElement attribute value? [message #475038 is a reply to message #475036] |
Mon, 20 August 2007 05:31  |
Eclipse User |
|
|
|
"Cameron Bateman" <cameron.bateman@oracle.com>
??????:24096201b4cd9251984ed39ec361579a$1@www.eclipse.org...
>> You are right, the tag converter should only to convert the custome tag
>> to html tag ,so I think that I should install some
>> new EditPoliy for the special tag element model, then I can change the
>> element attribute value by some GEF commands
>> when I can get the resize request by my EditPolicy , right?
>
> That's right. My suggestion is to subclass ElementResizableEditPolicy and
> override the getResizeCommand method. You can use the IElementEdit
> interface to override the edit policy on targeted edit parts with your
> own.
>
> If you have a list of standard use cases like this, it would be great if
> you could list them here or on a bug. That will help us standardize the
> edit policy interfaces with commonly used behaviour that can be quickly
> customized through meta-data.
>
>
> Thanks,
>
> Cameron
>
I have writen a new ResizeEditPolicy for my host tag and it was working well
now
I will list some special use cases and suggestions here.
Thank you for your help
|
|
|
Re: Where can I change the HostElement attribute value? [message #614197 is a reply to message #475029] |
Thu, 16 August 2007 17:33  |
Eclipse User |
|
|
|
I don't think I understand the use case. Why are you changing the "host"
element within this method? The purpose of this method is to create and
return the HTML Element that will be rendered by the Web Page Editor. If
you are trying to change an Element in the source document, this is not
the place to attempt it.
- Ian, JSF Tools Project
|
|
|
Re: Where can I change the HostElement attribute value? [message #614199 is a reply to message #475032] |
Thu, 16 August 2007 19:10  |
Eclipse User |
|
|
|
To add a little more information to my previous posting, typically you
would call createElement(String) to create a new Element, manipulate this
new Element's attributes, and ultimately return the new Element.
For example:
Element resultElement = createElement("input");
resultElement.setAttribute("type", "text");
resultElement.setAttribute("value",
getHostElement().getAttribute("value"));
resultElement.setAttribute("maxsize", "80");
return resultElement;
The method "getHostElement()" will return the source document's Element
that is being converted, and even if you could manipulate it from within
the tag converter, this would not affect the expected result of a tag
conversion.
Perhaps I do not understand what it is you are attempting to do in your
tag converter. Please feel free to elaborate further.
- Ian, JSF Tools Project
|
|
|
Re: Where can I change the HostElement attribute value? [message #614203 is a reply to message #475032] |
Thu, 16 August 2007 22:41  |
Eclipse User |
|
|
|
"Ian Trimble" <ian.trimble@oracle.com>
??????:24108ccc01065d107d035447a639b132$1@www.eclipse.org...
>I don't think I understand the use case. Why are you changing the "host"
>element within this method? The purpose of this method is to create and
>return the HTML Element that will be rendered by the Web Page Editor. If
>you are trying to change an Element in the source document, this is not the
>place to attempt it.
>
> - Ian, JSF Tools Project
>
Hi Ian:
Thank you for your help.
first, I show the use case follow:
when I show the some tag , the tag don't use the "style" attribute to
control its size but
only use the special attribute "width" or "height". It means that the
"style" attribute is useless .
So when user resize the host element by web page editor ,"style" attribute
value of the host element was changed,then
the special attribute "width" or "height" should be change .
You are right,The converter's purpose is ONLY convert the tag element to
html tag element,so I think that I should install new EditPoliy for the
special tag , then I can change the host element attribute value use by some
GEF commands when I can get the resize request by my EditPolicy , right?
|
|
|
Re: Where can I change the HostElement attribute value? [message #614206 is a reply to message #475033] |
Thu, 16 August 2007 22:53  |
Eclipse User |
|
|
|
Thank you!
First I give my use case:
when I want to show the some tag , the tag don't use the "style" attribute
to control its size but
only use the special attribute "width" or "height". It means that the
"style" attribute is useless
So when user resize the host element by web page editor ,"style" attribute
value of the host element was changed,then
the special attribute "width" or "height" should be change .
You are right, the tag converter should only to convert the custome tag to
html tag ,so I think that I should install some
new EditPoliy for the special tag element model, then I can change the
element attribute value by some GEF commands
when I can get the resize request by my EditPolicy , right?
|
|
|
Re: Where can I change the HostElement attribute value? [message #614207 is a reply to message #475035] |
Fri, 17 August 2007 14:44  |
Eclipse User |
|
|
|
> You are right, the tag converter should only to convert the custome tag to
> html tag ,so I think that I should install some
> new EditPoliy for the special tag element model, then I can change the
> element attribute value by some GEF commands
> when I can get the resize request by my EditPolicy , right?
That's right. My suggestion is to subclass ElementResizableEditPolicy and
override the getResizeCommand method. You can use the IElementEdit
interface to override the edit policy on targeted edit parts with your own.
If you have a list of standard use cases like this, it would be great if
you could list them here or on a bug. That will help us standardize the
edit policy interfaces with commonly used behaviour that can be quickly
customized through meta-data.
Thanks,
Cameron
|
|
|
Re: Where can I change the HostElement attribute value? [message #614212 is a reply to message #475036] |
Mon, 20 August 2007 05:29  |
Eclipse User |
|
|
|
"Cameron Bateman" <cameron.bateman@oracle.com>
??????:24096201b4cd9251984ed39ec361579a$1@www.eclipse.org...
>
> If you have a list of standard use cases like this, it would be great if
> you could list them here or on a bug. That will help us standardize the
> edit policy interfaces with commonly used behaviour that can be quickly
> customized through meta-data.
I have writen a new ResizeEditPolicy for my tag and it was working well now.
I will write some special use cases and some suggestions here.
Thank you for your help
|
|
|
Re: Where can I change the HostElement attribute value? [message #614216 is a reply to message #475036] |
Mon, 20 August 2007 05:31  |
Eclipse User |
|
|
|
"Cameron Bateman" <cameron.bateman@oracle.com>
??????:24096201b4cd9251984ed39ec361579a$1@www.eclipse.org...
>> You are right, the tag converter should only to convert the custome tag
>> to html tag ,so I think that I should install some
>> new EditPoliy for the special tag element model, then I can change the
>> element attribute value by some GEF commands
>> when I can get the resize request by my EditPolicy , right?
>
> That's right. My suggestion is to subclass ElementResizableEditPolicy and
> override the getResizeCommand method. You can use the IElementEdit
> interface to override the edit policy on targeted edit parts with your
> own.
>
> If you have a list of standard use cases like this, it would be great if
> you could list them here or on a bug. That will help us standardize the
> edit policy interfaces with commonly used behaviour that can be quickly
> customized through meta-data.
>
>
> Thanks,
>
> Cameron
>
I have writen a new ResizeEditPolicy for my host tag and it was working well
now
I will list some special use cases and suggestions here.
Thank you for your help
|
|
|
Goto Forum:
Current Time: Wed Jul 23 14:54:08 EDT 2025
Powered by FUDForum. Page generated in 0.05887 seconds
|