on 11-26-2009 10:49 AM
how do you put a <br/> in a sentence containing linktoaction?
example
example:
IWDLinkToAction la = (IWDLinkToAction) view.createElement (IWDLinkToAction.class, null);
la.setOnAction (wdThis.wdGetMyAction ());
la.setEnabled (true);
String foo = "<br/> aaaa bbbb cccc <br/> <br/>";
la.setText (foo);
la.setVisible (WDVisibility.VISIBLE);
groupElement.addChild (la);
only that this appears like this:
<br/> aaaa bbbb cccc <br/> <br/>
Instead I want to see that;
aaaa
bbbb
cccc
someone help me?
thanks
banana
Hi Friend,
Try This it worked in my Case i am using NWDS 7.1
wdContext.currentContextElement().setString("Jeetendra"+"\n"+"Kumar"+"\n");
Make a value attribute of type String.
Bind that to the text property of Link to Action.
Make the Wrapping Property True.(Don't forget).
and you are done.
Hope it will help.
Regards
Jeetendra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi friends
I tried these 2 ways but not working properly ....
Here are two sources:
Banana method:
for(int i=0;i<wdContext.nodeClassi().size();i++){
wdContext.nodeClassi().moveTo(i);
IWDLinkToAction la = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, null );
la.setOnAction(wdThis.wdGetMyAction());
la.setEnabled(true);
StringBuffer mesg= new StringBuffer();
mesg.append( wdContext.nodeClass().getClassiElementAt(i).getA() );
mesg.append( "\n" );
mesg.append(wdContext.nodeClass().getClassiElementAt(i).getB());
mesg.append( "\n" );
mesg.append(wdContext.nodeClass().getClassiElementAt(i).getC());
mesg.append( "\n" );
String prov = mesg.toString();
la.setWrapping(true);
la.setText(prov);
la.setVisible(WDVisibility.VISIBLE);
groupElement.addChild(la);
}
Dreams4Desires method :
for(int i=0;i<wdContext.nodeClassi().size();i++){
wdContext.nodeClassi().moveTo(i);
IWDLinkToAction la = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, null );
la.setOnAction(wdThis.wdGetMyAction());
la.setEnabled(true);
wdContext.currentContextElement().setLinkProv("Jeetendra"+"\n"+"Kumar"+"\n");
la.setText(wdContext.currentContextElement().getLinkProv());
la.setWrapping(true);
la.setVisible(WDVisibility.VISIBLE);
groupElement.addChild(la);
}
I use NWDS 7.0.15
Help me
Thank
Banana
Edited by: Captain Banana on Nov 27, 2009 8:27 AM
Edited by: Captain Banana on Nov 27, 2009 8:28 AM
Hi Banana,
I had already told you that newline character (\n) just doesn't work for LinkToAction on 7.0. I has tried it myself. Only, if we put it in transparent container and set the width of the transparent container to something say 150px and then turn the wrapping of the LinkToAction UI element to true, you can have more than 1 line to display text of LinkToAction. I understand, the text wrapping for LinkToAction should have worked, but that is just a bug. So, we have to find alternatives rather. And the alternative includes setting space in between the words that need to be displayed in different lines manually. It is trial and check.
Use the following code to insert a transparent container and the create Link to Action within a transparent container and then insert the transparent container in your group UI element.
for(int i=0;i<wdContext.nodeClassi().size();i++){
wdContext.nodeClassi().moveTo(i);
IWDTransparentContainer root= (IWDTransparentContainer)view.getRootElement();
IWDGroup groupElement = (IWDGroup) view.createElement(IWDGroup.class, null);
root.addChild(groupElement);
IWDTransparentContainer wrapperTc= (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class, null);
wrapperTc.setWidth("150px");
groupElement .addChild(wrapperTc);
IWDLinkToAction la = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, null );
la.setOnAction(wdThis.wdGetMyAction());
la.setEnabled(true);
StringBuffer mesg= new StringBuffer();
mesg.append( wdContext.nodeClass().getClassiElementAt(i).getA() );
mesg.append( " " );
mesg.append(wdContext.nodeClass().getClassiElementAt(i).getB());
mesg.append( " " );
mesg.append(wdContext.nodeClass().getClassiElementAt(i).getC());
mesg.append( " " );
String prov = mesg.toString();
la.setWrapping(true);
la.setText(prov);
la.setVisible(WDVisibility.VISIBLE);
wrapperTc.addChild(la);
}
Hope your problem is solved.
Regards,
Tushar Sinha
Hi Banana,
Did you try using newline character between the strings to show them in different lines. I mean use
String xyz = "aaaa \nbbbb \n cccc";
and then set this string to your text.
Regards,
Tushar Sinha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Banana,
I tried using newline character between the strings to show them in different lines. I mean use
String xyz = "aaaa \nbbbb \n cccc";
and then set this string to text of Link to Action but doesn't work.
Got an idea. You can put this LinkToAction in a transparent container and set the width to around 150, set the wrapping of the link to action and the transparent container both as true and then adjust the spacing of the letters manually. I checked. It works.
I mean something link
String xyz = "aaaa... bbbb.... cccc";
Regards,
Tushar Sinha
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.