Re: wicket 7 / 8.x and relative to absolute path

2017-03-16 Thread Sven Meier

Hi,

getRequestCycle().getUrlRenderer().renderFullUrl(Url.parse(url)) should 
work.


Have fun
Sven

P.S.: To get the url of the current page use urlFor(new 
RenderPageRequestHandler(new PageProvider(this))



On 16.03.2017 12:13, Korbinian Bachl wrote:

Hello,

how is it possible to make from an relative page path and absolute one as 
string in wicket 7 or 8?

In wicket 1.4 it was quite a mess where one had to manually build it from 
string and this tended to be quite buggy (and much much code), and I somehow 
hope that it may now be easier in times of wicket 8 and java 8;

The idea is to have a basic funtion e.g:

public static String toAbsolutePath(String relativePagePath)

where one could enter the relativePagePath, relative to the current URL in the 
browser window;

Best,

Korbinian

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



wicket 7 / 8.x and relative to absolute path

2017-03-16 Thread Korbinian Bachl
Hello,

how is it possible to make from an relative page path and absolute one as 
string in wicket 7 or 8?

In wicket 1.4 it was quite a mess where one had to manually build it from 
string and this tended to be quite buggy (and much much code), and I somehow 
hope that it may now be easier in times of wicket 8 and java 8;

The idea is to have a basic funtion e.g:

public static String toAbsolutePath(String relativePagePath) 

where one could enter the relativePagePath, relative to the current URL in the 
browser window;

Best,

Korbinian

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ListView color background lineitem dinamically not working

2017-03-16 Thread Sven Meier

Hi,

you'll have to add two MarkupContainers and style both :

  

  ...
  ...


  protected void populateItem(ListItem item) {
WebMarkupContainer firstRow = new WebMarkupContainer("firstRow") {
  @Override
  protected void onComponentTag(final ComponentTag tag) {
  Items line = item.getModelObject();
  if (line.getIdLn() == 6)
tag.put("style", "background-color:green");
  else if (line.getIdLn() == 4 )
tag.put("style", "background-color:red");

  // continue with default behavior
  super.onComponentTag(tag);
};
item.add(firstRow);

firstRow.add(...

WebMarkupContainer secondRow = ...;
  }

Best regards
Sven

On 16.03.2017 11:39, ganea iulia wrote:

Thank you so much for you explanation.
I had to put the two  inside the  because I need to
repeat every two rows.
Do you have any hint on how to do it and still be able to change the color?



On Thu, Mar 16, 2017 at 12:36 PM, ganea iulia 
wrote:


Thank you so much for you explanation.
I had to put the two  inside the  because I need to
repeat every two rows.



On Thu, Mar 16, 2017 at 11:26 AM, Sven Meier  wrote:


Hi,

it seems your ListView is bound to the  tag, which cannot be styled.

Change your markup to:

   
 

Have fun
Sven


On 16.03.2017 09:58, ganea iulia wrote:


Hello,

I have a listview and I want to dinamically color some of the rows
(items).
But it is not working, nothing gets colored when it should.

*Here is the markup:*




[item1]
[item2]
[item3]
[item4]
[item5]
[item6]
[item7]
[item8]
[item9]
[item10]


Area

   



*Here is the code:*

@Override
protected ListItem newItem(final int index, IModel model) {
return new ListItem(index, getListItemModel(getModel(), index)) {

@Override
protected void onComponentTag(final ComponentTag tag) {
Items line = getModelObject();
if (line.getIdLn() == 6)
tag.put("style", "background-color:green");
else if (line.getIdLn() == 4 )
tag.put("style", "background-color:red");

// continue with default behavior
super.onComponentTag(tag);

}
};
}

Could you please advise?



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ListView color background lineitem dinamically not working

2017-03-16 Thread ganea iulia
Thank you so much for you explanation.
I had to put the two  inside the  because I need to
repeat every two rows.
Do you have any hint on how to do it and still be able to change the color?



On Thu, Mar 16, 2017 at 12:36 PM, ganea iulia 
wrote:

> Thank you so much for you explanation.
> I had to put the two  inside the  because I need to
> repeat every two rows.
>
>
>
> On Thu, Mar 16, 2017 at 11:26 AM, Sven Meier  wrote:
>
>> Hi,
>>
>> it seems your ListView is bound to the > wicket:id="forEachItem"> tag, which cannot be styled.
>>
>> Change your markup to:
>>
>>   
>> 
>>
>> Have fun
>> Sven
>>
>>
>> On 16.03.2017 09:58, ganea iulia wrote:
>>
>>> Hello,
>>>
>>> I have a listview and I want to dinamically color some of the rows
>>> (items).
>>> But it is not working, nothing gets colored when it should.
>>>
>>> *Here is the markup:*
>>> 
>>> 
>>> 
>>> 
>>> [item1]
>>> [item2]
>>> [item3]
>>> [item4]
>>> [item5]
>>> [item6]
>>> [item7]
>>> [item8]
>>> [item9]
>>> [item10]
>>> 
>>> 
>>> >> cols="100">Area
>>> 
>>>   
>>> 
>>> 
>>>
>>> *Here is the code:*
>>>
>>> @Override
>>> protected ListItem newItem(final int index, IModel model) {
>>> return new ListItem(index, getListItemModel(getModel(), index)) {
>>>
>>> @Override
>>> protected void onComponentTag(final ComponentTag tag) {
>>> Items line = getModelObject();
>>> if (line.getIdLn() == 6)
>>> tag.put("style", "background-color:green");
>>> else if (line.getIdLn() == 4 )
>>> tag.put("style", "background-color:red");
>>>
>>> // continue with default behavior
>>> super.onComponentTag(tag);
>>>
>>> }
>>> };
>>> }
>>>
>>> Could you please advise?
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>


Re: ListView color background lineitem dinamically not working

2017-03-16 Thread ganea iulia
Thank you so much for you explanation.
I had to put the two  inside the  because I need to
repeat every two rows.



On Thu, Mar 16, 2017 at 11:26 AM, Sven Meier  wrote:

> Hi,
>
> it seems your ListView is bound to the  wicket:id="forEachItem"> tag, which cannot be styled.
>
> Change your markup to:
>
>   
> 
>
> Have fun
> Sven
>
>
> On 16.03.2017 09:58, ganea iulia wrote:
>
>> Hello,
>>
>> I have a listview and I want to dinamically color some of the rows
>> (items).
>> But it is not working, nothing gets colored when it should.
>>
>> *Here is the markup:*
>> 
>> 
>> 
>> 
>> [item1]
>> [item2]
>> [item3]
>> [item4]
>> [item5]
>> [item6]
>> [item7]
>> [item8]
>> [item9]
>> [item10]
>> 
>> 
>> > cols="100">Area
>> 
>>   
>> 
>> 
>>
>> *Here is the code:*
>>
>> @Override
>> protected ListItem newItem(final int index, IModel model) {
>> return new ListItem(index, getListItemModel(getModel(), index)) {
>>
>> @Override
>> protected void onComponentTag(final ComponentTag tag) {
>> Items line = getModelObject();
>> if (line.getIdLn() == 6)
>> tag.put("style", "background-color:green");
>> else if (line.getIdLn() == 4 )
>> tag.put("style", "background-color:red");
>>
>> // continue with default behavior
>> super.onComponentTag(tag);
>>
>> }
>> };
>> }
>>
>> Could you please advise?
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: ListView color background lineitem dinamically not working

2017-03-16 Thread Sven Meier

Hi,

it seems your ListView is bound to the wicket:id="forEachItem"> tag, which cannot be styled.


Change your markup to:

  


Have fun
Sven


On 16.03.2017 09:58, ganea iulia wrote:

Hello,

I have a listview and I want to dinamically color some of the rows (items).
But it is not working, nothing gets colored when it should.

*Here is the markup:*




[item1]
[item2]
[item3]
[item4]
[item5]
[item6]
[item7]
[item8]
[item9]
[item10]


Area

  



*Here is the code:*

@Override
protected ListItem newItem(final int index, IModel model) {
return new ListItem(index, getListItemModel(getModel(), index)) {

@Override
protected void onComponentTag(final ComponentTag tag) {
Items line = getModelObject();
if (line.getIdLn() == 6)
tag.put("style", "background-color:green");
else if (line.getIdLn() == 4 )
tag.put("style", "background-color:red");

// continue with default behavior
super.onComponentTag(tag);

}
};
}

Could you please advise?




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ListView color background lineitem dinamically not working

2017-03-16 Thread Martin Grigorov
Hi,

The problem is at:



You need the  to be Wicket component.
 is not rendered at Production mode.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Mar 16, 2017 at 9:58 AM, ganea iulia  wrote:

> Hello,
>
> I have a listview and I want to dinamically color some of the rows (items).
> But it is not working, nothing gets colored when it should.
>
> *Here is the markup:*
> 
> 
> 
> 
> [item1]
> [item2]
> [item3]
> [item4]
> [item5]
> [item6]
> [item7]
> [item8]
> [item9]
> [item10]
> 
> 
>  cols="100">Area
> 
>  
> 
> 
>
> *Here is the code:*
>
> @Override
> protected ListItem newItem(final int index, IModel model) {
> return new ListItem(index, getListItemModel(getModel(), index)) {
>
> @Override
> protected void onComponentTag(final ComponentTag tag) {
> Items line = getModelObject();
> if (line.getIdLn() == 6)
> tag.put("style", "background-color:green");
> else if (line.getIdLn() == 4 )
> tag.put("style", "background-color:red");
>
> // continue with default behavior
> super.onComponentTag(tag);
>
> }
> };
> }
>
> Could you please advise?
>


Re: Dynamic datatable columns (sequel)

2017-03-16 Thread James Selvakumar
Hi Sven,

Thanks for the info. Will try that out.

On Thu, Mar 16, 2017 at 4:20 PM, Sven Meier  wrote:

> Hi,
>
> you can just change the columns list (e.g. in #onConfigure) and everything
> will work fine:
>
>   https://issues.apache.org/jira/browse/WICKET-4596
>
> Have fun
> Sven
>
>
> On 16.03.2017 04:34, James Selvakumar wrote:
>
>> Hi all,
>>
>> I want to render a datatable with dynamically different columns based on
>> user input (via a DropDownChoice) over ajax.
>> I came across this old post
>> > e-columns-td1856733.html>
>> which mentions that this feature might be available in Wicket 1.4.
>> Is this feature available in Wicket now?
>> Can someone explain me how to achieve this?
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Thanks & regards
James


ListView color background lineitem dinamically not working

2017-03-16 Thread ganea iulia
Hello,

I have a listview and I want to dinamically color some of the rows (items).
But it is not working, nothing gets colored when it should.

*Here is the markup:*




[item1]
[item2]
[item3]
[item4]
[item5]
[item6]
[item7]
[item8]
[item9]
[item10]


Area

 



*Here is the code:*

@Override
protected ListItem newItem(final int index, IModel model) {
return new ListItem(index, getListItemModel(getModel(), index)) {

@Override
protected void onComponentTag(final ComponentTag tag) {
Items line = getModelObject();
if (line.getIdLn() == 6)
tag.put("style", "background-color:green");
else if (line.getIdLn() == 4 )
tag.put("style", "background-color:red");

// continue with default behavior
super.onComponentTag(tag);

}
};
}

Could you please advise?


Re: Dynamic datatable columns (sequel)

2017-03-16 Thread Sven Meier

Hi,

you can just change the columns list (e.g. in #onConfigure) and 
everything will work fine:


  https://issues.apache.org/jira/browse/WICKET-4596

Have fun
Sven


On 16.03.2017 04:34, James Selvakumar wrote:

Hi all,

I want to render a datatable with dynamically different columns based on
user input (via a DropDownChoice) over ajax.
I came across this old post

which mentions that this feature might be available in Wicket 1.4.
Is this feature available in Wicket now?
Can someone explain me how to achieve this?




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org