[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
wrapping tooltip  XML
Forum Index -> Development
Author Message
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

We have a gridcol containing a textpane. Since we want a moderate row height, mostly the text is not completely visible. In order to have a very quick look at the whole text, we have "misused" the tooltip to show the whole text. But the text doesnt wrap in the tooltip.

Could the wrapping in the tooltip be done? Or perhaps there is another solution, a sort of popup event?

Regards,
Daniel
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5538
Offline

Hi,

yes, unfortunately the tooltip is built exactly the way you describe...

There is an attribute "usherhint" which is similar to the tooltip but only is available for input components (field, checkbox, radio button,..., but not for button). Maybe you just try out.

We will check if we can upgrade the tooltip in general. Pls. give us some days to check.

Björn

Björn Müller, CaptainCasa GmbH
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

As a central application feature, I have to render a journal. Each of its items has a few fields and a text of variable length. The user wants to edit the journal
easily and to read it at a glance. For the text area, they imagine something like in Excel, where a cell can grow automatically when the line wrap option is set in the cell format.

I have thought of the following variants to implement:

1. Something like in demotreeflex.java. First row has normal fields, second row has a text(area) and can be expanded or collapsed.
--> But currently, the height of both rows cannot be set different.
2. Tooltip would show the item's whole text. Edit would be done in a modal popup window. Button to render the whole journal in PDF.
--> But currently, the tooltip doesn't wrap. I have tried userhint, it works but you have to click the field.

Any other ideas? Has anybody implemented something similar?

Regards, Daniel
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5538
Offline

...is the "Component Overview" in the layout editor something similar? (in the menu on the left, below "Documentation")?

I believe the grid is too restrictive for what you want to do, because the height of each content-textline is equal.
So you may dynaymically build up the page (use ROWDYNAMICCONTENT) and write your journal as XML... this is how the "Component Overview" is built.

Björn

Björn Müller, CaptainCasa GmbH
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

I have decided to use a grid of textareas (able to scroll). I shall set a mean rowheight. But I would like that the user could change the height of all rows, just the way is done in "Dinamic Pane sizing" on the demo workplace. I have tried but it didn't work for rowheight. Is this basically possible?

Daniel
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5538
Offline

..no this is not possible - changing the ROWHEIGHT at runtime.

What you could do of course, build the grid in a ROWDYNAMICCONTENT and then assigne the proper ROWHEIGHT by building up a complete new grid.

Björn

Björn Müller, CaptainCasa GmbH
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

CaptainCasa wrote:
...is the "Component Overview" in the layout editor something similar? (in the menu on the left, below "Documentation")?

I believe the grid is too restrictive for what you want to do, because the height of each content-textline is equal.
So you may dynaymically build up the page (use ROWDYNAMICCONTENT) and write your journal as XML... this is how the "Component Overview" is built.

Björn 


Hi,

"Component Overview" is not exactly what we want: It shows the details of one item at a time. What we want is to see all details at once in the same way the component named "Report" did in the old framework casabac. It is right that there is no corresponding component in CC?

Daniel
[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5538
Offline

Hi,

could you please send a screenshot of what you want to do - either by upload into the forum or by mail if it contains private data? THANKS!

Björn

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5538
Offline

Please take a look onto the attached screenshot. It is part of the demo workplace of next version.

Layout:
Code:
 <%@page contentType="text/html"%>
 <%@page pageEncoding="UTF-8"%>
 
 <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
 <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
 
 <%@taglib prefix="demo" uri="/WEB-INF/democontrols"%>
 <%@taglib prefix="t" uri="/WEB-INF/eclnt"%>
 
 
 <!-- ========== CONTENT BEGIN ========== -->
 <f:view>
 	<h:form>
 		<f:subview id="workplace_demodynamicformg_sv">
 			<t:rowdemobodypane id="g_1" objectbinding="#{wp.DemoDynamicForm}"
 				rowdistance="3">
 				<t:row id="g_2">
 					<t:coldistance id="g_3" width="110" />
 					<t:textarea id="g_4" height="60"
 						text="#{wp.DemoDynamicForm.newComment}" width="100%" />
 					<t:coldistance id="g_5" width="20" />
 				</t:row>
 				<t:row id="g_6">
 					<t:coldistance id="g_7" width="110" />
 					<t:button id="g_8"
 						actionListener="#{wp.DemoDynamicForm.onAddComment}" text="Add" />
 				</t:row>
 				<t:rowdistance id="g_9" height="10" />
 				<t:rowline id="g_10" />
 				<t:rowdistance id="g_11" height="10" />
 				<t:row id="g_12" />
 				<t:row id="g_13">
 					<t:scrollpane id="g_14" height="100%" padding="right:20"
 						width="100%">
 						<t:rowdynamiccontent id="g_15"
 							contentbinding="#{wp.DemoDynamicForm.content}" />
 					</t:scrollpane>
 				</t:row>
 			</t:rowdemobodypane>
 			<t:pageaddons id="g_pa" />
 		</f:subview>
 	</h:form>
 </f:view>
 <!-- ========== CONTENT END ========== -->
 


Code:
Code:
 package workplace;
 
 import java.io.Serializable;
 import java.text.DateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.TimeZone;
 
 import javax.faces.event.ActionEvent;
 
 import org.eclnt.editor.annotations.CCGenClass;
 import org.eclnt.jsfserver.elements.impl.ROWDYNAMICCONTENTBinding;
 import org.eclnt.workplace.IWorkpageDispatcher;
 
 import workplace.DemoGridHeaderItem.Item;
 
 @CCGenClass (expressionBase="#{wp.DemoDynamicForm}")
 
 public class DemoDynamicForm
     extends DemoBase
     implements Serializable
 {
     // ------------------------------------------------------------------------
     // inner classes
     // ------------------------------------------------------------------------
 
     public class ItemInfo implements Serializable
     {
         Date i_date;
         String i_comment;
         public Date getDate()
         {
             return i_date;
         }
         public void setDate(Date date)
         {
             i_date = date;
         }
         public String getComment()
         {
             return i_comment;
         }
         public void setComment(String comment)
         {
             i_comment = comment;
         }
         public void onRemove(ActionEvent event)
         {
             m_items.remove(this);
             renderItems();
         }
     }
     
     // ------------------------------------------------------------------------
     // members
     // ------------------------------------------------------------------------
     
     ROWDYNAMICCONTENTBinding m_content = new ROWDYNAMICCONTENTBinding();
     List<ItemInfo> m_items = new ArrayList<ItemInfo>();
     
     protected String m_newComment = "<new comment>";
     
     // ------------------------------------------------------------------------
     // constructors
     // ------------------------------------------------------------------------
 
     public DemoDynamicForm(IWorkpageDispatcher dispatcher)
     {
         super(dispatcher);
         // create some items
         {
             Date d = new Date((new Date()).getTime() - 3*24*3600000); // three days ago
             ItemInfo ii = new ItemInfo();
             ii.i_date = d;
             ii.i_comment = "Captured data is associated with a user through a combination of workstation and workspace ids that are automatically generated by the collector. This identification is not tied to any personal information about the user.";
             m_items.add(0,ii);
         }
         {
             Date d = new Date((new Date()).getTime() - 3*24*3600000); // three days ago
             ItemInfo ii = new ItemInfo();
             ii.i_date = d;
             ii.i_comment = "Subversive is a totally new Eclipse plug-in, that provides you a probability to use supported SVN® clients easily directly from your workbench. Friendly user interface of Subversive makes it much more comfortable to operate repositories.";
             m_items.add(0,ii);
         }
         {
             Date d = new Date((new Date()).getTime() - 1*24*3600000); // one day ago
             ItemInfo ii = new ItemInfo();
             ii.i_date = d;
             ii.i_comment = "In order to work with SVN the plug-in user should also install one of SVN connectors.";
             m_items.add(0,ii);
         }
         renderItems();
     }
     
     // ------------------------------------------------------------------------
     // public usage
     // ------------------------------------------------------------------------
     
     public ROWDYNAMICCONTENTBinding getContent() { return m_content; }
     public List<ItemInfo> getItems() { return m_items; }
     
     public void onAddComment(ActionEvent event) 
     {
         ItemInfo ii = new ItemInfo();
         ii.setDate(new Date());
         ii.setComment(m_newComment);
         m_items.add(0,ii);
         renderItems();
     }
 
     public String getNewComment() { return m_newComment; }
     public void setNewComment(String value) { m_newComment = value; }
 
     // ------------------------------------------------------------------------
     // private usage
     // ------------------------------------------------------------------------
     
     private void renderItems()
     {
         StringBuffer sb = new StringBuffer();
         sb.append("<t:pane width='100%' rowdistance='8'>");
         String currentDateString = "inittini";
         int counter = 0;
         for (ItemInfo ii: m_items)
         {
             String dateString = buildDateString(ii.i_date);
             if (dateString.equals(currentDateString) == false)
             {
                 currentDateString = dateString;
                 if (counter != 0)
                     sb.append("</t:foldablepane></t:row>");
                 sb.append("<t:row><t:foldablepane width='100%' text='"+dateString+"' rowdistance='3'>");
             }
             else
             {
                 sb.append("<t:rowline background='#00000010'/>");
             }
             sb.append("<t:row>");
             sb.append(  "<t:label text='#{wp.DemoDynamicForm.items["+counter+"].date}' width='100' format='time' timezone='"+TimeZone.getDefault().getID()+"' rowalignmenty='top'/>");
             sb.append(  "<t:textpane text='#{wp.DemoDynamicForm.items["+counter+"].comment}' width='100%'/>");
             sb.append(  "<t:coldistance width='10'/>");
             sb.append(  "<t:button text='Remove' width='80' actionListener='#{wp.DemoDynamicForm.items["+counter+"].onRemove}' rowalignmenty='top'/>");
             sb.append("</t:row>");
             counter++;
         }
         sb.append("</t:foldablepane></t:row>");
         sb.append("</t:pane>");
         m_content.setContentXml(sb.toString());
     }
     
     private String buildDateString(Date date)
     {
         return DateFormat.getDateInstance().format(date);
     }
     
 }
 
[Thumb - dynamicform.jpg]
 Filename dynamicform.jpg [Disk] Download
 Description
 Filesize 48 Kbytes
 Downloaded:  316 time(s)


Björn Müller, CaptainCasa GmbH
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

Thanks a lot for excellent explanation. Now I could implement what I wanted.

Daniel
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team